Efficient MILP problem reformulation
I am trying to solve the following MILP through LP solve. A link for the
original problem is here
The total number of binary variables = M*N
The total number of real variables = N
The total number of constraints = N + M*N + M
M ~ 10, N ~ 40. (H_i, W_i | i = 1 to N) and T are constants.
minimize sum { CW_k | k = 1, ..., N }
with respect to
C_i_k in { 0, 1 }, Feeder i placed in column k, i = 1, ..., M; k = 1,
..., N
CW_k >= 0, Width of column k //k = 1, ..., N
and subject to
//Total height of each column less than T
// I have already implemented height of present column <= height of prev col
// to avoid duplicate solutions.
[1] sum { H_i * C_i_k | i = 1, ..., M } <= T, k = 1, ..., N
//Width of each column = max( widths of individual feeders in that column)
[2] CW_k >= W_i * C_i_k, i = 1, ..., M; k = 1, ..., N
// Each feeder can be placed in only 1 column.
[3] sum { C_i_k | k = 1, ..., N } = 1, i = 1, ..., M
However, beyond a particular value of N (say 20) lp_solve just appears to
hang. I am told that the above size is pretty much "handle-able" for
solvers.
Is there any way I can re-formulate the above MILP so that it can be
solved more efficiently. I have not tried out other solvers but I guess
the performance shall not vary much.
Any help shall be appreciated.
Thanks!
Monday, 30 September 2013
Edit rejected for not addressing multiple issues meta.stackoverflow.com
Edit rejected for not addressing multiple issues – meta.stackoverflow.com
I suggested this edit. And it was rejected. Reason: This edit is too
minor; suggested edits should be substantive improvements addressing
multiple issues in the post I don't see how this edit …
I suggested this edit. And it was rejected. Reason: This edit is too
minor; suggested edits should be substantive improvements addressing
multiple issues in the post I don't see how this edit …
How to give linked value in html input
How to give linked value in html input
May I make link in part of my values in html input like this?
May I make link in part of my values in html input like this?
JSON date to NSdate conversion
JSON date to NSdate conversion
Hi I am receiving a date from webservice. It is java webservice returning
date in some long format like 1378894347000 milliseconds from 1970. how to
properly convert this to date?
Hi I am receiving a date from webservice. It is java webservice returning
date in some long format like 1378894347000 milliseconds from 1970. how to
properly convert this to date?
Sunday, 29 September 2013
the disabled checkbox gets functioned when clicking on its row
the disabled checkbox gets functioned when clicking on its row
. .On click button the checkbox gets disabled, but i have also added a
function for getting checked or unchecked when clicked on row. .but the
problem is after clicking the button the checkbox gets disabled but when i
click the row . . .it gets unchecked. I have added the code in JSfiddle.
.its not functioning at all.I dono much in .js.So please help me
this is the code
function selectRow(row){
var firstInput = row.getElementsByTagName('input')[0];
firstInput.checked = !firstInput.checked;
if(firstInput.disabled==false &&
firstInput.checked==true){firstInput.checked =true;}
else if(firstInput.disabled==true){firstInput.checked=true;}}
html code is
in js fiidle
jsfiddle
. .On click button the checkbox gets disabled, but i have also added a
function for getting checked or unchecked when clicked on row. .but the
problem is after clicking the button the checkbox gets disabled but when i
click the row . . .it gets unchecked. I have added the code in JSfiddle.
.its not functioning at all.I dono much in .js.So please help me
this is the code
function selectRow(row){
var firstInput = row.getElementsByTagName('input')[0];
firstInput.checked = !firstInput.checked;
if(firstInput.disabled==false &&
firstInput.checked==true){firstInput.checked =true;}
else if(firstInput.disabled==true){firstInput.checked=true;}}
html code is
in js fiidle
jsfiddle
use input from combo box as integer in code (vb.net)
use input from combo box as integer in code (vb.net)
right now my code reads
Dim divisor as Integer = "10"
i have created a form with a drop-down combo box that allows a user to
choose the divisor instead of it being hardwired into the code. the name
of the combo box is 'divisor1'
how do i refer to the input in divisor1 to be read as the divisor? i.e.
Dim divisor as Integer = divisor1 'throws an error
TIA
right now my code reads
Dim divisor as Integer = "10"
i have created a form with a drop-down combo box that allows a user to
choose the divisor instead of it being hardwired into the code. the name
of the combo box is 'divisor1'
how do i refer to the input in divisor1 to be read as the divisor? i.e.
Dim divisor as Integer = divisor1 'throws an error
TIA
MySQL: Calculate average post for every hour in each day.
MySQL: Calculate average post for every hour in each day.
I trying to calculate the average post made for every hour for each day
and I have to do this for 113 months. Inside the Post table have this
attribute timePosted, DatePosted and Text. I also need to join two table
post and thread because I only want to get category id number 3.
For each month I need to get this outcome:
Month: 1
Day Hour slot Avg of post created in each hours lot
Monday 00 ###
01 ###
.
.
23 ###
Tuesday Same as above
Month 2:
Day Hour slot Avg of post created in each hours lot
Monday 00 ###
01 ###
.
.
23 ###
Tuesday Same as above
and so on to month 113.
So far this query I have done.
select the_hour,avg(the_count)
from
(
select datePost as the_day,
HOUR(timePost) as the_hour,
count(TEXT) as the_count
from post, thread
where post.datePost = '2010-05-03'
and post.threadID = thread.threadID
and thread.CatID = 3
group by the_day,the_hour
) s
group by the_hour
The above query only do for each day. How should I get around to do for
every hour for each day and I have to do this for every month.
I trying to calculate the average post made for every hour for each day
and I have to do this for 113 months. Inside the Post table have this
attribute timePosted, DatePosted and Text. I also need to join two table
post and thread because I only want to get category id number 3.
For each month I need to get this outcome:
Month: 1
Day Hour slot Avg of post created in each hours lot
Monday 00 ###
01 ###
.
.
23 ###
Tuesday Same as above
Month 2:
Day Hour slot Avg of post created in each hours lot
Monday 00 ###
01 ###
.
.
23 ###
Tuesday Same as above
and so on to month 113.
So far this query I have done.
select the_hour,avg(the_count)
from
(
select datePost as the_day,
HOUR(timePost) as the_hour,
count(TEXT) as the_count
from post, thread
where post.datePost = '2010-05-03'
and post.threadID = thread.threadID
and thread.CatID = 3
group by the_day,the_hour
) s
group by the_hour
The above query only do for each day. How should I get around to do for
every hour for each day and I have to do this for every month.
Saturday, 28 September 2013
OL li numbering issue
OL li numbering issue
I've the following ordered list:
<ol>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>
I've to display one li at a time which I'm doing using the 'display'
property. The problem is that no matter which of the li's is displayed,
the list numbering shows 1. So instead of "2. Second" or "3. Third" I'm
seeing "1. Second", "1. Third", etc.
EDIT: Clarified question
I've the following ordered list:
<ol>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>
I've to display one li at a time which I'm doing using the 'display'
property. The problem is that no matter which of the li's is displayed,
the list numbering shows 1. So instead of "2. Second" or "3. Third" I'm
seeing "1. Second", "1. Third", etc.
EDIT: Clarified question
Differential equation numerical solution
Differential equation numerical solution
I have a differential equation(linear or non-linear), for example:
y''+2y'+y=0. When I try this code to solve it numerically:
ds=0.0001 ; y=1 ; y_prime=1
for i=1 to 10000
y_prime_next=y_prime_next+(-2*y_prime_next-y_next)*ds
y_next=y+y_prime_next*ds
y_prime=y_prime_next
y=y_next
next i
it does not produce the correct result. Why isn't this method working?
I have a differential equation(linear or non-linear), for example:
y''+2y'+y=0. When I try this code to solve it numerically:
ds=0.0001 ; y=1 ; y_prime=1
for i=1 to 10000
y_prime_next=y_prime_next+(-2*y_prime_next-y_next)*ds
y_next=y+y_prime_next*ds
y_prime=y_prime_next
y=y_next
next i
it does not produce the correct result. Why isn't this method working?
How does Google parses the webpages?
How does Google parses the webpages?
When we Google something, it returns documents. Now documents as I
understand are html pages laden with tags. From my parsing experience,
html pages' structured-ness can vary, and vary hugely, some pages are
designed well with every div identified in a structured way and others are
just a mess. And with millions of documents out there that Google indexes,
how does it extract the relevant body of text, and presents to us the
starting part of text documents?
When we Google something, it returns documents. Now documents as I
understand are html pages laden with tags. From my parsing experience,
html pages' structured-ness can vary, and vary hugely, some pages are
designed well with every div identified in a structured way and others are
just a mess. And with millions of documents out there that Google indexes,
how does it extract the relevant body of text, and presents to us the
starting part of text documents?
Develop a simple database to store the book details and perform various operations like book issue/renew etc, of a small library
Develop a simple database to store the book details and perform various
operations like book issue/renew etc, of a small library
Operations on Books · issuance of a given book · renewal of a given book ·
books that are overdue (should display the bookids and the total number of
books overdue). · check status of a given book (available ? or issued, If
so to whom?) · deleting a given book (no further issuance is possible)
operations like book issue/renew etc, of a small library
Operations on Books · issuance of a given book · renewal of a given book ·
books that are overdue (should display the bookids and the total number of
books overdue). · check status of a given book (available ? or issued, If
so to whom?) · deleting a given book (no further issuance is possible)
Friday, 27 September 2013
is using the float data type in this scenario really necessary
is using the float data type in this scenario really necessary
I am going through a circular custom view implementation(android) and I
see the developer making alot of uses of the float data type. I for one
has never used this because I haven't seen the need to. I am not sure why
he's using it so I am wondering if there are any advantages to using it
especially in this scenario where mainly coordinates are being stored and
calculating will be done using them.
/** The radius of the inner circle */
private float innerRadius;
/** The radius of the outer circle */
private float outerRadius;
/** The circle's center X coordinate */
private float cx;
/** The circle's center Y coordinate */
private float cy;
/** The left bound for the circle RectF */
private float left;
/** The right bound for the circle RectF */
private float right;
/** The top bound for the circle RectF */
private float top;
/** The bottom bound for the circle RectF */
private float bottom;
/** The X coordinate for the top left corner of the marking drawable */
private float dx;
/** The Y coordinate for the top left corner of the marking drawable */
private float dy;
I am going through a circular custom view implementation(android) and I
see the developer making alot of uses of the float data type. I for one
has never used this because I haven't seen the need to. I am not sure why
he's using it so I am wondering if there are any advantages to using it
especially in this scenario where mainly coordinates are being stored and
calculating will be done using them.
/** The radius of the inner circle */
private float innerRadius;
/** The radius of the outer circle */
private float outerRadius;
/** The circle's center X coordinate */
private float cx;
/** The circle's center Y coordinate */
private float cy;
/** The left bound for the circle RectF */
private float left;
/** The right bound for the circle RectF */
private float right;
/** The top bound for the circle RectF */
private float top;
/** The bottom bound for the circle RectF */
private float bottom;
/** The X coordinate for the top left corner of the marking drawable */
private float dx;
/** The Y coordinate for the top left corner of the marking drawable */
private float dy;
ios activity indicator is visible once, and then will not show until I try again a minute later
ios activity indicator is visible once, and then will not show until I try
again a minute later
Ok, so I have this piece of code:
- (void) searchBarSearchButtonClicked:(UISearchBar *)aSearchBar
{
[_activity startAnimating];
[self.searchBar bringSubviewToFront:_activity];
[self.searchBar resignFirstResponder];
if([_activity isAnimating]){
NSLog(@"its animating!");
}
dispatch_queue_t background =
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(background, ^{
[self performSelectorOnMainThread:@selector(filter:)
withObject:aSearchBar.text waitUntilDone:YES];
dispatch_async(dispatch_get_main_queue(), ^{
[_activity stopAnimating];
if(![_activity isAnimating]){
NSLog(@"its not animating anymore!");
}
[self.tableView reloadData];
});
});
}
what i'm trying to do is start an activity indicator which I added as a
subview to the search bar. In this code, I start the animation (logging
for test) on the main thread, then set up a background asynchronous thread
which runs the method that generates the new data set which will reload
the tableview. I wait for this to return, and which point, I stop
animation and reload the tableview on the main thread.
the result is this...when the application runs, I go to the table view,
and I type a word in the search bar. When I hit enter, the activity
indicator shows up, the table loads, and the activity indicator stops.
This is great.
Then, I click on the search bar again, start a new search, only this time,
the activity indicator does not show itself, but the NSLog shows that it
IS animating. The tableview reloads as expected, but no activity indicator
on the UI, but based on the NSLog, it seems to working.
Finally, if I wait about a minute, and search again, it works fine. What
I'm suspecting is that that the background thread is not completing maybe,
and the main thread continues doing what it needs to do.
Honestly, I've been beating my head for two days now, can someone explain
what I'm doing wrong?
again a minute later
Ok, so I have this piece of code:
- (void) searchBarSearchButtonClicked:(UISearchBar *)aSearchBar
{
[_activity startAnimating];
[self.searchBar bringSubviewToFront:_activity];
[self.searchBar resignFirstResponder];
if([_activity isAnimating]){
NSLog(@"its animating!");
}
dispatch_queue_t background =
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(background, ^{
[self performSelectorOnMainThread:@selector(filter:)
withObject:aSearchBar.text waitUntilDone:YES];
dispatch_async(dispatch_get_main_queue(), ^{
[_activity stopAnimating];
if(![_activity isAnimating]){
NSLog(@"its not animating anymore!");
}
[self.tableView reloadData];
});
});
}
what i'm trying to do is start an activity indicator which I added as a
subview to the search bar. In this code, I start the animation (logging
for test) on the main thread, then set up a background asynchronous thread
which runs the method that generates the new data set which will reload
the tableview. I wait for this to return, and which point, I stop
animation and reload the tableview on the main thread.
the result is this...when the application runs, I go to the table view,
and I type a word in the search bar. When I hit enter, the activity
indicator shows up, the table loads, and the activity indicator stops.
This is great.
Then, I click on the search bar again, start a new search, only this time,
the activity indicator does not show itself, but the NSLog shows that it
IS animating. The tableview reloads as expected, but no activity indicator
on the UI, but based on the NSLog, it seems to working.
Finally, if I wait about a minute, and search again, it works fine. What
I'm suspecting is that that the background thread is not completing maybe,
and the main thread continues doing what it needs to do.
Honestly, I've been beating my head for two days now, can someone explain
what I'm doing wrong?
jQuery append in loop - DOM does not update until the end
jQuery append in loop - DOM does not update until the end
When looping over a large collection and appending it to the DOM, the DOM
only refreshes after all items have been appended. Why doesn't the DOM
update after each append() call? Can I force the DOM to refresh after each
append (or maybe after each n number of appends)?
var i = 0;
for (i=0; i<5000; i++) {
$('#collection').append('<li>Line Item</li>');
}
Link to jsfiddle
NOTE: I understand that better performance (avoiding DOM reflow) can be
achieved by appending all elements to a local variable, and then appending
that variable to the DOM. But I want the first n elements to render on the
screen, then the next n, etc. until all elements are rendered.
When looping over a large collection and appending it to the DOM, the DOM
only refreshes after all items have been appended. Why doesn't the DOM
update after each append() call? Can I force the DOM to refresh after each
append (or maybe after each n number of appends)?
var i = 0;
for (i=0; i<5000; i++) {
$('#collection').append('<li>Line Item</li>');
}
Link to jsfiddle
NOTE: I understand that better performance (avoiding DOM reflow) can be
achieved by appending all elements to a local variable, and then appending
that variable to the DOM. But I want the first n elements to render on the
screen, then the next n, etc. until all elements are rendered.
Share the same object between two windows in WPF
Share the same object between two windows in WPF
I have class representing my AppSettings I have Main window and Settings
window.
Each window contains instance of object AppSettings
So these are two objects are different. If object AppSettings in Settings
window gets changed the changes not reflected in the AppSettings of the
Main window.
IS there any way i can share AppSettings object between windows so i have
only one instance?
I have class representing my AppSettings I have Main window and Settings
window.
Each window contains instance of object AppSettings
So these are two objects are different. If object AppSettings in Settings
window gets changed the changes not reflected in the AppSettings of the
Main window.
IS there any way i can share AppSettings object between windows so i have
only one instance?
Composition of objects vs functions: Should I use one method interfaces or delegates?
Composition of objects vs functions: Should I use one method interfaces or
delegates?
C# is a multi paradigm language. With nesting interfaces and classes one
can get a composition of objects. This way a certain problem can be broken
down to a number of simple ones giving each component its own piece of the
puzzle to solve. The same trick can be done in a slightly different
manner, one can make a composition of functions each of which is
responsible of solving its own little task while all combined and
interconnected they give the answer to the main problem.
Following SOLID principles I found myself in a situation where 95% of my
interfaces carry just one method named do-something and the name of the
interface is something-doer. The class that implements such interfaces is
DI'ed with the a few components required to fulfill whatever that method
is supposed to do. Such approach is basically making a closure over a
function by hands. If so, why wouldn't I just go with delegates that do it
naturally and for free (no typing necessary)? If I go all the way
converting single method interfaces to delegates I will eliminate 95% of
them from my code making it look like written in functional language. But
this seems like a right thing to do unless there is some bold reason to
stick with interfaces. Is there?
delegates?
C# is a multi paradigm language. With nesting interfaces and classes one
can get a composition of objects. This way a certain problem can be broken
down to a number of simple ones giving each component its own piece of the
puzzle to solve. The same trick can be done in a slightly different
manner, one can make a composition of functions each of which is
responsible of solving its own little task while all combined and
interconnected they give the answer to the main problem.
Following SOLID principles I found myself in a situation where 95% of my
interfaces carry just one method named do-something and the name of the
interface is something-doer. The class that implements such interfaces is
DI'ed with the a few components required to fulfill whatever that method
is supposed to do. Such approach is basically making a closure over a
function by hands. If so, why wouldn't I just go with delegates that do it
naturally and for free (no typing necessary)? If I go all the way
converting single method interfaces to delegates I will eliminate 95% of
them from my code making it look like written in functional language. But
this seems like a right thing to do unless there is some bold reason to
stick with interfaces. Is there?
replace first and last character in php
replace first and last character in php
A question about php.
If I have variable named $string that contains the word "Testing" I would
like the php code to delete the first and last character. (So the output
would be "esting"). I've tried multiple functions for example str_replace
and substr but so far I've only managed to delete only the first or only
the last character.
I don't know how to delete both the first and last character.
A question about php.
If I have variable named $string that contains the word "Testing" I would
like the php code to delete the first and last character. (So the output
would be "esting"). I've tried multiple functions for example str_replace
and substr but so far I've only managed to delete only the first or only
the last character.
I don't know how to delete both the first and last character.
comparing the two times is greater or lesser in java
comparing the two times is greater or lesser in java
Date date1= new java.util.Date();
java.sql.Date Sqldob = new java.sql.Date(date1.getTime());
System.out.println("date" +Sqldob);
java.sql.Time Sqldob1 = new java.sql.Time(date1.getTime());
System.out.println("date" +Sqldob1);
String Time="9:30:00";
SimpleDateFormat ra = new SimpleDateFormat("HHH:mm:ss");
Date s = ra.parse(Time);
java.sql.Time sqlTime3 = new java.sql.Time(s.getTime());
int compare= sqlTime3.compareTo(Sqldob1);
System.out.println("compare="+compare);
if(compare==1||compare==0){
System.out.println("inside if loop");
Sqldob1= sqlTime3;
}
Hi This is my java code,here am going to compare two time variables is
greater are equal but it is giving me the same value -1 for all the types
of input can anyone plz assist me in it .. thnk u in advance
Date date1= new java.util.Date();
java.sql.Date Sqldob = new java.sql.Date(date1.getTime());
System.out.println("date" +Sqldob);
java.sql.Time Sqldob1 = new java.sql.Time(date1.getTime());
System.out.println("date" +Sqldob1);
String Time="9:30:00";
SimpleDateFormat ra = new SimpleDateFormat("HHH:mm:ss");
Date s = ra.parse(Time);
java.sql.Time sqlTime3 = new java.sql.Time(s.getTime());
int compare= sqlTime3.compareTo(Sqldob1);
System.out.println("compare="+compare);
if(compare==1||compare==0){
System.out.println("inside if loop");
Sqldob1= sqlTime3;
}
Hi This is my java code,here am going to compare two time variables is
greater are equal but it is giving me the same value -1 for all the types
of input can anyone plz assist me in it .. thnk u in advance
Thursday, 26 September 2013
How to send the cmake build report to a mail?
How to send the cmake build report to a mail?
I am trying to build my project with cmake.After build the project i need
to send the success or failure build report to a mail automatically. Is
there any way to do this?.
Thanks in advance.
I am trying to build my project with cmake.After build the project i need
to send the success or failure build report to a mail automatically. Is
there any way to do this?.
Thanks in advance.
Wednesday, 25 September 2013
Java: Try/Catch Statements: While exception is caught, repeat try statements?
Java: Try/Catch Statements: While exception is caught, repeat try statements?
Is there any way to do this?
//Example function taking in first and last name and returning the last name.
public void lastNameGenerator(){
try {
String fullName = JOptionPane.showInputDialog("Enter your full
name");
String lastName = fullname.split("\\s+")[1];
catch (IOException e) {
System.out.println("Sorry, please enter your full name separated
by a space.")
//Repeat try statement. ie. Ask user for a new string?
}
System.out.println(lastName);
I think I can use scanner for this instead, but I was just curious about
if there was a way to repeat the try statement after catching an
exception.
Is there any way to do this?
//Example function taking in first and last name and returning the last name.
public void lastNameGenerator(){
try {
String fullName = JOptionPane.showInputDialog("Enter your full
name");
String lastName = fullname.split("\\s+")[1];
catch (IOException e) {
System.out.println("Sorry, please enter your full name separated
by a space.")
//Repeat try statement. ie. Ask user for a new string?
}
System.out.println(lastName);
I think I can use scanner for this instead, but I was just curious about
if there was a way to repeat the try statement after catching an
exception.
Thursday, 19 September 2013
why no parseInt for if statements
why no parseInt for if statements
var a = $('.box').width();
var b = $(document).height();
So far I have done this through trial and error, but now I'm curious to
understand why in jquery we use if (b < 20) , however we need parseInt to
calculate var c = a + b
var a = $('.box').width();
var b = $(document).height();
So far I have done this through trial and error, but now I'm curious to
understand why in jquery we use if (b < 20) , however we need parseInt to
calculate var c = a + b
spring data neo4j DynamicProperties
spring data neo4j DynamicProperties
I have a NodeEntity with dynamic properties that looks like:
@NodeEntity
public class MyObject {
@GraphId
private Long id;
@Indexed
private String name;
DynamicProperties props = new DynamicPropertiesContainer();
public MyObject(String name) {
this.name = name;
}
// getters and setters for name
}
And then I try setting some dynamic properties like:
MyObject m = new MyObject("Jeff");
myRepo.save(m); // myRepo just extends GraphRepository
// I have also tried setting the dynamic property before saving it
m.props.setProperty("mydynamicproperty","somevalue");
MyObject persisted = myRepo.getAllObjects().iterator().next();
System.out.println(persisted.props.asMap()); // THIS IS EMPTY
name is set, but the properties are empty. According to the docs, I think
this should work? Any idea why it doesn't?
I have a NodeEntity with dynamic properties that looks like:
@NodeEntity
public class MyObject {
@GraphId
private Long id;
@Indexed
private String name;
DynamicProperties props = new DynamicPropertiesContainer();
public MyObject(String name) {
this.name = name;
}
// getters and setters for name
}
And then I try setting some dynamic properties like:
MyObject m = new MyObject("Jeff");
myRepo.save(m); // myRepo just extends GraphRepository
// I have also tried setting the dynamic property before saving it
m.props.setProperty("mydynamicproperty","somevalue");
MyObject persisted = myRepo.getAllObjects().iterator().next();
System.out.println(persisted.props.asMap()); // THIS IS EMPTY
name is set, but the properties are empty. According to the docs, I think
this should work? Any idea why it doesn't?
How to resolve properties from property file in PreAuthorize?
How to resolve properties from property file in PreAuthorize?
In my test.properties file I have a key named devmode. Doing ${devmode}
inside @PreAuthorize fails.
@PreAuthorize("${devmode}")
How can I get the values of my properties inside a PreAuthorize?
I am loading the properties file like this:
<context:property-placeholder location="/WEB-INF/test.properties" />
Using the value inside <security:http use-expressions="true"> like this
works: <security:intercept-url pattern="/api/dev/**" access="${devmode}"
/>
This also works:
@Value(${devmode}) String myVar;
So I can't really see why it shouldn't work.
In my test.properties file I have a key named devmode. Doing ${devmode}
inside @PreAuthorize fails.
@PreAuthorize("${devmode}")
How can I get the values of my properties inside a PreAuthorize?
I am loading the properties file like this:
<context:property-placeholder location="/WEB-INF/test.properties" />
Using the value inside <security:http use-expressions="true"> like this
works: <security:intercept-url pattern="/api/dev/**" access="${devmode}"
/>
This also works:
@Value(${devmode}) String myVar;
So I can't really see why it shouldn't work.
RewriteRule not working in subfolder
RewriteRule not working in subfolder
I have written a rewrite rule so my website does not require URL to have
.php in which looks like this:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
But when I created a mobile version of the site and put files in a
subfolder called "m" the rewriteRule doesn't work for the subfolder.
Any help will be appreciated.
I have written a rewrite rule so my website does not require URL to have
.php in which looks like this:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
But when I created a mobile version of the site and put files in a
subfolder called "m" the rewriteRule doesn't work for the subfolder.
Any help will be appreciated.
How to "port" a large config file to an automated telnet script?
How to "port" a large config file to an automated telnet script?
Im trying to make a script to automatically put the configs in to factory
default Dlink 3200 switches. (ssh is no option it's disabled by default)
After trying with the"expect" function I switched to "echo" because I
couldn't get expect to work.
I can now automatically log in:
( echo open 10.90.90.90 sleep 2 echo "admin" sleep 1 echo "admin" sleep 1
) | telnet
But here is my problem; the config file that needs to be included is 900
lines long, so I am looking for a way to execute the commands in the
config file, without having to copy/paste echo & sleep for each line...
Do you guys know a way to help me out?
Thanks in advance,
Michel
Im trying to make a script to automatically put the configs in to factory
default Dlink 3200 switches. (ssh is no option it's disabled by default)
After trying with the"expect" function I switched to "echo" because I
couldn't get expect to work.
I can now automatically log in:
( echo open 10.90.90.90 sleep 2 echo "admin" sleep 1 echo "admin" sleep 1
) | telnet
But here is my problem; the config file that needs to be included is 900
lines long, so I am looking for a way to execute the commands in the
config file, without having to copy/paste echo & sleep for each line...
Do you guys know a way to help me out?
Thanks in advance,
Michel
Using conditionals to compare integers?
Using conditionals to compare integers?
I'm writing a method that returns a String. The String is the name of the
location that the person using the App is more likely to be in.
Ie. There are two locations, A and B. If the person is in location A the
time to reach location A should be less than location B. In this case the
String returned would be "A".
These are the steps I have came up with to write the method:
calculate distances between 2 locations
Compare these distances using conditional statements
Find the smallest value and represent this with a name in the form of a
string
I've already done #1. I'm very lost on as to how I can use conditional
statement to compare the integer values.. The scope of the assignment is
to use algorithm to write most of the method.. Can anyone tell me as to
how I can start on the algorithm part? (there's also a total of 7
locations I have to take into account)
I'm writing a method that returns a String. The String is the name of the
location that the person using the App is more likely to be in.
Ie. There are two locations, A and B. If the person is in location A the
time to reach location A should be less than location B. In this case the
String returned would be "A".
These are the steps I have came up with to write the method:
calculate distances between 2 locations
Compare these distances using conditional statements
Find the smallest value and represent this with a name in the form of a
string
I've already done #1. I'm very lost on as to how I can use conditional
statement to compare the integer values.. The scope of the assignment is
to use algorithm to write most of the method.. Can anyone tell me as to
how I can start on the algorithm part? (there's also a total of 7
locations I have to take into account)
Wednesday, 18 September 2013
How to create a custom Ubuntu image
How to create a custom Ubuntu image
It'd be very useful for my team to have an Ubuntu image (.iso) with some
softwares and repositories already added in.
For example we would need MongoDB already installed (http://bit.ly/OWklPQ)
as well as Sublime Text and Elasticsearch.
I'm wondering if there is an easy way to just do it manually once and then
have it ready next time we need a new machine.
It'd be very useful for my team to have an Ubuntu image (.iso) with some
softwares and repositories already added in.
For example we would need MongoDB already installed (http://bit.ly/OWklPQ)
as well as Sublime Text and Elasticsearch.
I'm wondering if there is an easy way to just do it manually once and then
have it ready next time we need a new machine.
How to Assign an array value to session variable in zend framework
How to Assign an array value to session variable in zend framework
I am trying to create a session variable and assign values in an array to
this session variable. how can i do that. i am creating like below but i
cannot get to it is functioning at all.
$post = Zend_Controller_Front::getInstance()->getRequest()->getParam('key');
$searches = new Zend_Session_Namespace('searches');
$parthis= $searches->partssearched;
if(is_array($parthis)){
$parthis->toArray();
} else {
$count= sizeof($parthis)."<br>";
if ($this->rows ) {
if ($count==0) {$parthis[0]=$post;}
//$searches[$count]=$this->rows;
echo $parthis[0]."HERE";
} else {
$parthis[$count]=$post;
foreach($parthis as $hist) {
echo $hist;
}
}
}
$this->rows are coming from the controller and it is carrying database
query results.
What i am trying to do here is i want to store the Get value into a
session variable carrying it as an array.
Should be like $parthis= array (value1, value2, value3); and every time
user pass a value in url, it should add upto it.
Thank you
I am trying to create a session variable and assign values in an array to
this session variable. how can i do that. i am creating like below but i
cannot get to it is functioning at all.
$post = Zend_Controller_Front::getInstance()->getRequest()->getParam('key');
$searches = new Zend_Session_Namespace('searches');
$parthis= $searches->partssearched;
if(is_array($parthis)){
$parthis->toArray();
} else {
$count= sizeof($parthis)."<br>";
if ($this->rows ) {
if ($count==0) {$parthis[0]=$post;}
//$searches[$count]=$this->rows;
echo $parthis[0]."HERE";
} else {
$parthis[$count]=$post;
foreach($parthis as $hist) {
echo $hist;
}
}
}
$this->rows are coming from the controller and it is carrying database
query results.
What i am trying to do here is i want to store the Get value into a
session variable carrying it as an array.
Should be like $parthis= array (value1, value2, value3); and every time
user pass a value in url, it should add upto it.
Thank you
Get variable value from another function
Get variable value from another function
I have this function
public void Search(object sender, EventArgs e)
{
//I get the value form a query..
int MachineNo=Convert.ToInt16(cmd2.ExecuteScalar());
}
i want to get the MachineNo from that function to this
public void Edit(object sender, EventArgs e)
{
bool edit=modify(MachineNo,UserName)
}
I have this function
public void Search(object sender, EventArgs e)
{
//I get the value form a query..
int MachineNo=Convert.ToInt16(cmd2.ExecuteScalar());
}
i want to get the MachineNo from that function to this
public void Edit(object sender, EventArgs e)
{
bool edit=modify(MachineNo,UserName)
}
Raising events on separate thread
Raising events on separate thread
I am developing a component which needs to process the live feed and
broadcast the data to the listeners in pretty fast manner ( with about 100
nano second level accuracy, even less than that if I can do that)
Currently I am raising an event from my code which subscriber can
subscribe to. However because in C# event handlers run on the same thread
which raises the event, my thread which raises the event will be blocked
until all subscribers finish processing the event. I do not have control
on subscribers' code, so they can possibly do any time consuming
operations in event handler, which may block the thread which is
broadcasting.
What can I do so that I can broadcast the data to other subscribers but
can still broadcast the stuff quite fast??
I am developing a component which needs to process the live feed and
broadcast the data to the listeners in pretty fast manner ( with about 100
nano second level accuracy, even less than that if I can do that)
Currently I am raising an event from my code which subscriber can
subscribe to. However because in C# event handlers run on the same thread
which raises the event, my thread which raises the event will be blocked
until all subscribers finish processing the event. I do not have control
on subscribers' code, so they can possibly do any time consuming
operations in event handler, which may block the thread which is
broadcasting.
What can I do so that I can broadcast the data to other subscribers but
can still broadcast the stuff quite fast??
Get all the urls under domain (YQL?)
Get all the urls under domain (YQL?)
I want to get all the urls under a domain.
When I looked at their robots.txt. It clearly states that some of the
folders are not for robots but I am wondering is there a way to get the
all the urls that are open to robots. There is no sitemap on the
robots.txt.
Any idea would be helpful and I am also curious will there be a Yahoo
Query Language(YQL) solution for this purpose because this work has
probably already been done by Yahoo.
Thanks !
I want to get all the urls under a domain.
When I looked at their robots.txt. It clearly states that some of the
folders are not for robots but I am wondering is there a way to get the
all the urls that are open to robots. There is no sitemap on the
robots.txt.
Any idea would be helpful and I am also curious will there be a Yahoo
Query Language(YQL) solution for this purpose because this work has
probably already been done by Yahoo.
Thanks !
PayPal's tracking id
PayPal's tracking id
Sometimes PayPal breaks, and it doesn't return a tracking_id. At the same
time, it completes the payment on it's own servers. This is a problem for
me, because even thought the payment was successful, my server ends up
with a blank tracking_id column in the database table, which causes me
lots of issues
If this were to happen again, will the following if statement be enough to
capture such an event?
if( !isset($trackingId) || empty($trackingId) || $trackingId == null ||
$trackingId == "" ) {
// something is wrong
} else {
// continue as normal
}
Sometimes PayPal breaks, and it doesn't return a tracking_id. At the same
time, it completes the payment on it's own servers. This is a problem for
me, because even thought the payment was successful, my server ends up
with a blank tracking_id column in the database table, which causes me
lots of issues
If this were to happen again, will the following if statement be enough to
capture such an event?
if( !isset($trackingId) || empty($trackingId) || $trackingId == null ||
$trackingId == "" ) {
// something is wrong
} else {
// continue as normal
}
How to use Log4Cplus in DLL
How to use Log4Cplus in DLL
What is the best practice to use Log4Cplus in a DLL ?
I want to use a FileAppender.
I have a win32 DLL, that has DLLMain, and 3 exported Function.
Where do I define the Appender and Layout object ? Where to set their
properties ? Where do I link them to a logger ?
I want to use the logger in all classes inside the dll I guess by just
calling: Logger myLogger= Logger::getInstance("myLoggerName"); where
should I put the code so I can have the log4cplus macros enabled and
working in all my functions inside the dll ?
In a normal program I will use global variables, use main or some ctor to
set them up and then everything can see them. What do I do inside a dll ?
What is the best practice to use Log4Cplus in a DLL ?
I want to use a FileAppender.
I have a win32 DLL, that has DLLMain, and 3 exported Function.
Where do I define the Appender and Layout object ? Where to set their
properties ? Where do I link them to a logger ?
I want to use the logger in all classes inside the dll I guess by just
calling: Logger myLogger= Logger::getInstance("myLoggerName"); where
should I put the code so I can have the log4cplus macros enabled and
working in all my functions inside the dll ?
In a normal program I will use global variables, use main or some ctor to
set them up and then everything can see them. What do I do inside a dll ?
Tuesday, 17 September 2013
ListBox is Not Automatically Expanding with Dynamic Data Adding through 'PhoneTextBox' wp7
ListBox is Not Automatically Expanding with Dynamic Data Adding through
'PhoneTextBox' wp7
I would like to perform something's like fb comment Layout.
and I am Using Following Code To perform this task :
// Constructor
string []content;
public MainPage()
{
InitializeComponent();
content = new string[11] { "Great stories produce the ideas which
help children to know how the cleverness and wise decisions take
the people out of the dangerous and most tricky situations.",
"No virtue is as noble as kindness. The
stories "Prince Frog", "Dove and the
ant" and others teaches them the
importance of being kind to even to the
small god made creatures of this
earth.",
"Honesty is a key to success and honest
people are duly rewarded. These stories
show honesty is a most beautiful
quality to be possessed, liked and
appreciated.",
"Humbleness makes us kind hearted and
soft spoken- the virtues which will
always be deemed and valued in the eyes
of the others.",
"Realize the importance of hard work
through these evergreen stories. These
popular stories are the inroads to the
very roots of the concept "Hard work is
a road to success.",
"If you speak the truth, your children
will speak too. This would help them
built the trust and reputation in their
society and around them.",
"Courageous child can easily cross each
milestones of life with ease, then why
not we too help our children to be
strong for the others too to follow.",
"True Friendship is a God's precious
gift and a commitment for togetherness,
and sharing and caring.",
"Understand the value of being united,
to overcome any difficult situation and
understand the meaning of working in a
team and grow as a virtuous and a
strong human being.",
"Obeying the elders will ultimately be
good for you. Stories like \"Three
goats and the Wolf\" can help your
children understand the value of being
obedient.",
"Greediness leads to destruction. It
causes obsession which is more harmful.
Let us know how through these great
stories." };
populate_list();
}
private void populate_list()
{
for (int i = 0; i < content.Length; i++)
{
//mainlist.Items.Add(content[i]);
var maintext = new TextBlock();
maintext.Text = content[i];
maintext.TextWrapping = TextWrapping.Wrap;
StackPanel stkpanel = new StackPanel();
stkpanel.Width = 480;
stkpanel.Height = 124;
stkpanel.Children.Add(maintext);
var expander = new ExpanderView();
var phonetextbox = new PhoneTextBox();
phonetextbox.Hint = "Add a Comment";
phonetextbox.ActionIcon = new
System.Windows.Media.Imaging.BitmapImage(new
Uri("/search.png", UriKind.RelativeOrAbsolute));
StackPanel stkpanel_new = new StackPanel();
stkpanel_new.Width = 480;
phonetextbox.ActionIconTapped += (s, e) =>
{
if (!string.IsNullOrEmpty(phonetextbox.Text))
{
expander.Items.Add(phonetextbox.Text);
expander.IsExpanded = true;
//stkpanel_new.Height = stkpanel_new.Height + 20;
}
};
stkpanel_new.Children.Add(phonetextbox);
stkpanel_new.Children.Add(expander);
mainlist.Items.Add(stkpanel);
mainlist.Items.Add(stkpanel_new);
}
}
But i Got problem on Dynamic Comment insertion when user entered text in
phonetextbox and press on its Icon the comment just added behind the
listbox 2nd element (means ExpanderView will be expanded but listbox
further elements are not adjusting it dynamically ).
Am i Doing Something wrong or it is a Framework limitation ?? Help .
Regards
Pardeep Sharma
'PhoneTextBox' wp7
I would like to perform something's like fb comment Layout.
and I am Using Following Code To perform this task :
// Constructor
string []content;
public MainPage()
{
InitializeComponent();
content = new string[11] { "Great stories produce the ideas which
help children to know how the cleverness and wise decisions take
the people out of the dangerous and most tricky situations.",
"No virtue is as noble as kindness. The
stories "Prince Frog", "Dove and the
ant" and others teaches them the
importance of being kind to even to the
small god made creatures of this
earth.",
"Honesty is a key to success and honest
people are duly rewarded. These stories
show honesty is a most beautiful
quality to be possessed, liked and
appreciated.",
"Humbleness makes us kind hearted and
soft spoken- the virtues which will
always be deemed and valued in the eyes
of the others.",
"Realize the importance of hard work
through these evergreen stories. These
popular stories are the inroads to the
very roots of the concept "Hard work is
a road to success.",
"If you speak the truth, your children
will speak too. This would help them
built the trust and reputation in their
society and around them.",
"Courageous child can easily cross each
milestones of life with ease, then why
not we too help our children to be
strong for the others too to follow.",
"True Friendship is a God's precious
gift and a commitment for togetherness,
and sharing and caring.",
"Understand the value of being united,
to overcome any difficult situation and
understand the meaning of working in a
team and grow as a virtuous and a
strong human being.",
"Obeying the elders will ultimately be
good for you. Stories like \"Three
goats and the Wolf\" can help your
children understand the value of being
obedient.",
"Greediness leads to destruction. It
causes obsession which is more harmful.
Let us know how through these great
stories." };
populate_list();
}
private void populate_list()
{
for (int i = 0; i < content.Length; i++)
{
//mainlist.Items.Add(content[i]);
var maintext = new TextBlock();
maintext.Text = content[i];
maintext.TextWrapping = TextWrapping.Wrap;
StackPanel stkpanel = new StackPanel();
stkpanel.Width = 480;
stkpanel.Height = 124;
stkpanel.Children.Add(maintext);
var expander = new ExpanderView();
var phonetextbox = new PhoneTextBox();
phonetextbox.Hint = "Add a Comment";
phonetextbox.ActionIcon = new
System.Windows.Media.Imaging.BitmapImage(new
Uri("/search.png", UriKind.RelativeOrAbsolute));
StackPanel stkpanel_new = new StackPanel();
stkpanel_new.Width = 480;
phonetextbox.ActionIconTapped += (s, e) =>
{
if (!string.IsNullOrEmpty(phonetextbox.Text))
{
expander.Items.Add(phonetextbox.Text);
expander.IsExpanded = true;
//stkpanel_new.Height = stkpanel_new.Height + 20;
}
};
stkpanel_new.Children.Add(phonetextbox);
stkpanel_new.Children.Add(expander);
mainlist.Items.Add(stkpanel);
mainlist.Items.Add(stkpanel_new);
}
}
But i Got problem on Dynamic Comment insertion when user entered text in
phonetextbox and press on its Icon the comment just added behind the
listbox 2nd element (means ExpanderView will be expanded but listbox
further elements are not adjusting it dynamically ).
Am i Doing Something wrong or it is a Framework limitation ?? Help .
Regards
Pardeep Sharma
Uploadify - HTML5 version File extenstions not working?
Uploadify - HTML5 version File extenstions not working?
I am using uploadify HTML5 version (just brought and downloaded the
latest). However my problem is to show only selected given fileextenstions
in the popup dialog box is not working as expected, it shows all files. As
far as i am concern my coding below is exactly like the demo in the
website. It works fine with all the other functionality like uploading,
buttontext...etc only issue is i want to show only files of given type in
the popup dialog box.
<div id="logoqueue"></div>
<form>
<input id="logo" name="logo" type="file">
<span style="font-size:9px">* JPG,PNG,GIF files only </span>
<script type="text/javascript">
$(function() {
$('#logo').uploadifive({
'auto' : true,
'method' : 'post',
'fileTypeDesc' : 'Image Files',
'fileTypeExts' : '*.jpg;*.png;*.gif;*.jpeg;',
'fileSizeLimit' : '5MB',
'formData' : {'uniqID':'67867868'},
'queueID' : 'logoqueue',
'uploadScript' : '/ajax/uploadlogo.php',
'fileTypeDesc': 'Select Image',
'onUploadComplete' : function(file, data) {
//console.log(data);
}
});
});
</script>
Does anyone feel anything fishy here ? please note i am using the HTML 5
version not the free flash version.
I am using uploadify HTML5 version (just brought and downloaded the
latest). However my problem is to show only selected given fileextenstions
in the popup dialog box is not working as expected, it shows all files. As
far as i am concern my coding below is exactly like the demo in the
website. It works fine with all the other functionality like uploading,
buttontext...etc only issue is i want to show only files of given type in
the popup dialog box.
<div id="logoqueue"></div>
<form>
<input id="logo" name="logo" type="file">
<span style="font-size:9px">* JPG,PNG,GIF files only </span>
<script type="text/javascript">
$(function() {
$('#logo').uploadifive({
'auto' : true,
'method' : 'post',
'fileTypeDesc' : 'Image Files',
'fileTypeExts' : '*.jpg;*.png;*.gif;*.jpeg;',
'fileSizeLimit' : '5MB',
'formData' : {'uniqID':'67867868'},
'queueID' : 'logoqueue',
'uploadScript' : '/ajax/uploadlogo.php',
'fileTypeDesc': 'Select Image',
'onUploadComplete' : function(file, data) {
//console.log(data);
}
});
});
</script>
Does anyone feel anything fishy here ? please note i am using the HTML 5
version not the free flash version.
Django create object maximum fields
Django create object maximum fields
I'm studying Django. This is a follow up to my previous answered inquiry.
My previous question is working in a model with not more than 100 fields.
Now I'm testing the method to a new model with 327 fields.
I'm wondering if there's a maximum fields when creating a record or
writing a fields within objects.create().
My object is not saving if I'm using where rec_fields[field_name[i]] = value
LatestRsl.objects.create(logbook=log_instance, **rec_fields)
But when I try to test a small piece of fields like below I can see the
new created record.
`LatestRsl.objects.create(logbook=log_instance,
status=rec_fields[header_name[0]], rslno=rec_fields[header_name[1]])`
Any hint or guide is really appreciated. Thanks.
I'm studying Django. This is a follow up to my previous answered inquiry.
My previous question is working in a model with not more than 100 fields.
Now I'm testing the method to a new model with 327 fields.
I'm wondering if there's a maximum fields when creating a record or
writing a fields within objects.create().
My object is not saving if I'm using where rec_fields[field_name[i]] = value
LatestRsl.objects.create(logbook=log_instance, **rec_fields)
But when I try to test a small piece of fields like below I can see the
new created record.
`LatestRsl.objects.create(logbook=log_instance,
status=rec_fields[header_name[0]], rslno=rec_fields[header_name[1]])`
Any hint or guide is really appreciated. Thanks.
Removing a specific jquery effect
Removing a specific jquery effect
I have searched all over the site, but due to my low knowledge I was
unable to find the right words. I am working my website and the script I
was using had a previous theme.
I did a lot of changes so far and I am totally satisfied with it.
However there is a effect which I think from jquery whom sometimes brake
my design. I want to remove this effect but couldnt find how. The effect
is, when your cursor comes on certain links and buttons, they get bigger
and kinda zoomed.
Here is the example of it, http://www.uluyemek.com/demo/
If you look on the left sidebar and get your mouse on the "Giriº Yap"
which means log in, the image gets bigger, I would really like to delete
this since its causing problems on other pages, to me.
Please help me find where the jquery hide itself.
I have searched all over the site, but due to my low knowledge I was
unable to find the right words. I am working my website and the script I
was using had a previous theme.
I did a lot of changes so far and I am totally satisfied with it.
However there is a effect which I think from jquery whom sometimes brake
my design. I want to remove this effect but couldnt find how. The effect
is, when your cursor comes on certain links and buttons, they get bigger
and kinda zoomed.
Here is the example of it, http://www.uluyemek.com/demo/
If you look on the left sidebar and get your mouse on the "Giriº Yap"
which means log in, the image gets bigger, I would really like to delete
this since its causing problems on other pages, to me.
Please help me find where the jquery hide itself.
without using if statement, how to generate a username in java
without using if statement, how to generate a username in java
Okay, my class assignment is to write a code to generate a username. But,
it can be no more than 7 letters of the last name. if there are fewer than
7 letters in the last name, then all the letters would be used. BUT the
prof says no if statements. Any ideas? The one I wrote works fine for
names 7 or more letters but sends an error for short last names. Here it
is:
//find first initial of firstName
char firstInitial = firstName.charAt(0);
//limit last name in userName to 7 characters
String shortLastName = lastName.substring(0, 7);
//create a username using the first letter of firstName and lastName
(but no more than 7 letters)
String userName = (firstInitial + shortLastName);
//print username in lowercase
System.out.println((firstName + " " + lastName + "'s standard username
is:" + userName).toLowerCase())
Really just need an idea of how to proceed. Possibly an example to look
at. I've about given up....
Okay, my class assignment is to write a code to generate a username. But,
it can be no more than 7 letters of the last name. if there are fewer than
7 letters in the last name, then all the letters would be used. BUT the
prof says no if statements. Any ideas? The one I wrote works fine for
names 7 or more letters but sends an error for short last names. Here it
is:
//find first initial of firstName
char firstInitial = firstName.charAt(0);
//limit last name in userName to 7 characters
String shortLastName = lastName.substring(0, 7);
//create a username using the first letter of firstName and lastName
(but no more than 7 letters)
String userName = (firstInitial + shortLastName);
//print username in lowercase
System.out.println((firstName + " " + lastName + "'s standard username
is:" + userName).toLowerCase())
Really just need an idea of how to proceed. Possibly an example to look
at. I've about given up....
Sunday, 15 September 2013
Organizational Browser webpart in SharePoint 2013
Organizational Browser webpart in SharePoint 2013
I have couple of questions regarding Organizational webpart in SharePoint
2013.
We are using SharePoint 2013 Organizational Browser webpart in our
application. It is showing the data in collapsed mode by default in HTML
View. Can we show this data in expanded mode by default?
Can we build this webpart using ecma script/sandbox solution?
Can we print Organizational browser wepart data into pdf/word using
script/sandbox solution?
I have couple of questions regarding Organizational webpart in SharePoint
2013.
We are using SharePoint 2013 Organizational Browser webpart in our
application. It is showing the data in collapsed mode by default in HTML
View. Can we show this data in expanded mode by default?
Can we build this webpart using ecma script/sandbox solution?
Can we print Organizational browser wepart data into pdf/word using
script/sandbox solution?
MySQL with PHP calculation
MySQL with PHP calculation
I have a question regards of my database and PHP programming.
I have a MySQL database and a table with more than 5 million data on it.
I need to get the data from this table and do the calculation on it.
I have created the index on the database but the process is slow.
First I want to use the data show in data.
for example: product code week1 sales, week2 sales, week3 sales, calculate
avg.
In this table. there are may same product code between different week.
First i'm using the select distinct product from table to get the product
code from table using the php script, while row=mysqli_fetch_array and
then I need to run another sql to get the sales data which is equal to the
product code and run by week and calculate the avg.
Therefore, it takes more than half an hour to run the above query in with
php script. Is there any good suggestion for this situation.
Sorry for my english
I have a question regards of my database and PHP programming.
I have a MySQL database and a table with more than 5 million data on it.
I need to get the data from this table and do the calculation on it.
I have created the index on the database but the process is slow.
First I want to use the data show in data.
for example: product code week1 sales, week2 sales, week3 sales, calculate
avg.
In this table. there are may same product code between different week.
First i'm using the select distinct product from table to get the product
code from table using the php script, while row=mysqli_fetch_array and
then I need to run another sql to get the sales data which is equal to the
product code and run by week and calculate the avg.
Therefore, it takes more than half an hour to run the above query in with
php script. Is there any good suggestion for this situation.
Sorry for my english
Google App Engine Boilerplate - Contact template
Google App Engine Boilerplate - Contact template
Okay, I'm getting frustrated with the lack of resources for GAE
boilerplate especially since it's a wee bit complex as far as directory
structure, so I'm coming here.
Anyways, I have this contact form which I adapted from the contact.html
template provided with the boilerplate. I'm not interested in making user
registration available to the visitor, I just want a very simple contact
form with Full name, Email address, and Message. As far as I can tell, the
form itself is working, as I did not change any code from the boilerplate:
<form id="form_contact" action="{{ url|safe }}" method="post"
class="well form-horizontal">
<fieldset>
<input type="hidden" name="exception" value="{{ exception|e }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token()
}}">
{{ macros.field(form.name, label=_("Name"),
placeholder=_("Enter your")+" "+_("Name"), class="input-xlarge
focused required") }}
{{ macros.field(form.email, label=_("Email"),
placeholder=_("Enter your")+" "+_("Email"),
class="input-xlarge focused required email", type="email") }}
{{ macros.field(form.message, label=_("Message"),
class="input-xlarge required", cols="40", rows="8") }}
<div class="form-actions">
<button type="submit" class="btn btn-primary">{% trans
%}Send Message{% endtrans %}</button>
</div>
</fieldset>
</form>
The problem I'm having is I can't get it to send the email to the email
address I'm wanting it to. The only file I can tell to change so I can
achieve sending it to d*******@gmail.com is the config.py file, and I
tried changing this:
# contact page email settings
'contact_sender': "l*******@gmail.com",
'contact_recipient': "d*******@gmail.com",
Starting at line 24 ending at line 26 but no luck. Is there another
configuration file I'm supposed to change? Btw, the exact directory of the
config.py file I changed is
C:\Users\*****\Desktop\Projects\******\boilerplate.py
Okay, I'm getting frustrated with the lack of resources for GAE
boilerplate especially since it's a wee bit complex as far as directory
structure, so I'm coming here.
Anyways, I have this contact form which I adapted from the contact.html
template provided with the boilerplate. I'm not interested in making user
registration available to the visitor, I just want a very simple contact
form with Full name, Email address, and Message. As far as I can tell, the
form itself is working, as I did not change any code from the boilerplate:
<form id="form_contact" action="{{ url|safe }}" method="post"
class="well form-horizontal">
<fieldset>
<input type="hidden" name="exception" value="{{ exception|e }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token()
}}">
{{ macros.field(form.name, label=_("Name"),
placeholder=_("Enter your")+" "+_("Name"), class="input-xlarge
focused required") }}
{{ macros.field(form.email, label=_("Email"),
placeholder=_("Enter your")+" "+_("Email"),
class="input-xlarge focused required email", type="email") }}
{{ macros.field(form.message, label=_("Message"),
class="input-xlarge required", cols="40", rows="8") }}
<div class="form-actions">
<button type="submit" class="btn btn-primary">{% trans
%}Send Message{% endtrans %}</button>
</div>
</fieldset>
</form>
The problem I'm having is I can't get it to send the email to the email
address I'm wanting it to. The only file I can tell to change so I can
achieve sending it to d*******@gmail.com is the config.py file, and I
tried changing this:
# contact page email settings
'contact_sender': "l*******@gmail.com",
'contact_recipient': "d*******@gmail.com",
Starting at line 24 ending at line 26 but no luck. Is there another
configuration file I'm supposed to change? Btw, the exact directory of the
config.py file I changed is
C:\Users\*****\Desktop\Projects\******\boilerplate.py
Can I use express.js uploaded file names as an IDs?
Can I use express.js uploaded file names as an IDs?
Once a file is uploaded when using express.js it gets a new name (I guess
a hash or something) So is that hash unique? Can I use it as a file ID,
say in a dababase?
Once a file is uploaded when using express.js it gets a new name (I guess
a hash or something) So is that hash unique? Can I use it as a file ID,
say in a dababase?
nested Angular views with IE8
nested Angular views with IE8
http://plnkr.co/edit/NeUWHh?p=preview
seems very simple, works on any webkit browser and also on IE above 9, but
breaks on IE8 and displaying the uc-compiled form of the inner view(with
curly braces and field names).
http://plnkr.co/edit/NeUWHh?p=preview
seems very simple, works on any webkit browser and also on IE above 9, but
breaks on IE8 and displaying the uc-compiled form of the inner view(with
curly braces and field names).
Array of points to one point in middle
Array of points to one point in middle
I got array of points:
array(
array('x' => ...,'y' => ...),
array('x' => ...,'y' => ...)
...
)
What is the best way to make those points one, that is in "avarge"
position? Is pairing and then pairing and then pairing... a good
algorithm?
I got array of points:
array(
array('x' => ...,'y' => ...),
array('x' => ...,'y' => ...)
...
)
What is the best way to make those points one, that is in "avarge"
position? Is pairing and then pairing and then pairing... a good
algorithm?
Sublime text find and replace with special characters
Sublime text find and replace with special characters
I suck at regular expressions and what to do a simple find and replace of
'}' to '} /n' notepad++ can recongise what I'm after as it has the 3
options of normal find and replace, special chars and full regex. I
however only ever used to option two. How can I enable special characters
in my search using sublime text 2.
Cheers
I suck at regular expressions and what to do a simple find and replace of
'}' to '} /n' notepad++ can recongise what I'm after as it has the 3
options of normal find and replace, special chars and full regex. I
however only ever used to option two. How can I enable special characters
in my search using sublime text 2.
Cheers
Saturday, 14 September 2013
KnockoutJS arrayFilter doesn't update
KnockoutJS arrayFilter doesn't update
A Knockout newbie here. I've tried to use ko.utils.arrayFilter but it
doesn't seem to update when I use it. I'm using the same method I used
with arrayForEach so I'm not sure what's wrong here. How can I get this
the list to update when using arrayFilter?
JS:
function entry(name, category) {
this.name = ko.observable(name);
this.category = ko.observable(category);
}
function entriesModel() {
this.entries = ko.observableArray([]);
this.filter = function () {
ko.utils.arrayFilter(this.entries(), function (item) {
return item.category == 'SciFi';
});
};
this.sort = function () {
this.entries.sort(function (a, b) {
return a.category < b.category ? -1 : 1;
});
};
}
$(document).ready(function () {
$.getJSON("entries.php", function (data) {
entries(data);
});
ko.applyBindings(entriesModel());
});
HTML:
<ul data-bind="foreach: entries">
<li>
<p data-bind="text: name"></p>
<p data-bind="text: category"></p>
</li>
<button data-bind="click: filter">Filter</button>
<button data-bind="click: sort">Sort</button>
A Knockout newbie here. I've tried to use ko.utils.arrayFilter but it
doesn't seem to update when I use it. I'm using the same method I used
with arrayForEach so I'm not sure what's wrong here. How can I get this
the list to update when using arrayFilter?
JS:
function entry(name, category) {
this.name = ko.observable(name);
this.category = ko.observable(category);
}
function entriesModel() {
this.entries = ko.observableArray([]);
this.filter = function () {
ko.utils.arrayFilter(this.entries(), function (item) {
return item.category == 'SciFi';
});
};
this.sort = function () {
this.entries.sort(function (a, b) {
return a.category < b.category ? -1 : 1;
});
};
}
$(document).ready(function () {
$.getJSON("entries.php", function (data) {
entries(data);
});
ko.applyBindings(entriesModel());
});
HTML:
<ul data-bind="foreach: entries">
<li>
<p data-bind="text: name"></p>
<p data-bind="text: category"></p>
</li>
<button data-bind="click: filter">Filter</button>
<button data-bind="click: sort">Sort</button>
C/C++: What are your favorite clever/brilliant/useful/elegant examples of preprocessor macros?
C/C++: What are your favorite clever/brilliant/useful/elegant examples of
preprocessor macros?
I'm a new C++ programmer coming from Java and I'm already in love with
macros - they make coding so simple and elegant. I've been using them for
basic things like debugging and a loop which iterates over two integers
(that is, two for loops compressed into one line). I'd like to hear more
clever tricks that can be done!
(Yes, I'm aware that macros can be dangerous, but I think I'm willing to
take that risk. My IDE makes it very easy to see what the macros expand
out to so I don't think it's a huge problem.)
preprocessor macros?
I'm a new C++ programmer coming from Java and I'm already in love with
macros - they make coding so simple and elegant. I've been using them for
basic things like debugging and a loop which iterates over two integers
(that is, two for loops compressed into one line). I'd like to hear more
clever tricks that can be done!
(Yes, I'm aware that macros can be dangerous, but I think I'm willing to
take that risk. My IDE makes it very easy to see what the macros expand
out to so I don't think it's a huge problem.)
How to do unlimited maximum scale zoom level on webview in android
How to do unlimited maximum scale zoom level on webview in android
Is it possible to have an unlimited maximum scale zoom level on webview
for android?
Is it possible to have an unlimited maximum scale zoom level on webview
for android?
Segmentation fault (core dumped) issue
Segmentation fault (core dumped) issue
I am trying to read in input from a user, and then tokenize each word and
put each word into an array of strings. At the end, the contents of the
array are printed out for debugging. My code is below.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int MAX_INPUT_SIZE = 200;
volatile int running = 1;
while(running) {
char input[MAX_INPUT_SIZE];
char tokens[100];
printf("shell> ");
fgets(input, MAX_INPUT_SIZE, stdin);
//tokenize input string, put each token into an array
char *space;
space = strtok(input, " ");
tokens[0] = space;
int i = 1;
while (space != NULL) {
space = strtok(NULL, " ");
tokens[i] = space;
++i;
}
for(i = 0; tokens[i] != NULL; i++) {
printf(tokens[i]);
printf("\n");
}
printf("\n"); //clear any extra spaces
//return (EXIT_SUCCESS);
}
}
After I type in my input at the "shell> " prompt, gcc gives me the
following error:
Segmentation fault (core dumped)
Any idea as to why this error is happening? Thanks in advance for your help!
I am trying to read in input from a user, and then tokenize each word and
put each word into an array of strings. At the end, the contents of the
array are printed out for debugging. My code is below.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int MAX_INPUT_SIZE = 200;
volatile int running = 1;
while(running) {
char input[MAX_INPUT_SIZE];
char tokens[100];
printf("shell> ");
fgets(input, MAX_INPUT_SIZE, stdin);
//tokenize input string, put each token into an array
char *space;
space = strtok(input, " ");
tokens[0] = space;
int i = 1;
while (space != NULL) {
space = strtok(NULL, " ");
tokens[i] = space;
++i;
}
for(i = 0; tokens[i] != NULL; i++) {
printf(tokens[i]);
printf("\n");
}
printf("\n"); //clear any extra spaces
//return (EXIT_SUCCESS);
}
}
After I type in my input at the "shell> " prompt, gcc gives me the
following error:
Segmentation fault (core dumped)
Any idea as to why this error is happening? Thanks in advance for your help!
C# - DataGridView's method UserDeletingRow occurs two times
C# - DataGridView's method UserDeletingRow occurs two times
this is a windows form application and it has a DataGridView control. The
problem is that method DataGridView1_UserDeletingRow occurs two times when
I run the application, and I don't understand why.
public partial class ShowAllTransactions : UserControl
{
public ShowAllTransactions()
{
InitializeComponent();
}
private void DataGridView1_UserDeletingRow(object sender,
DataGridViewRowsRemovedEventArgs e)
{
MessageBox.Show(sender.ToString());
}
private void ShowAllTransactions_Load(object sender, EventArgs e)
{
dataGridView1.RowsRemoved += new
DataGridViewRowsRemovedEventHandler(DataGridView1_UserDeletingRow);
}
}
Thank you
this is a windows form application and it has a DataGridView control. The
problem is that method DataGridView1_UserDeletingRow occurs two times when
I run the application, and I don't understand why.
public partial class ShowAllTransactions : UserControl
{
public ShowAllTransactions()
{
InitializeComponent();
}
private void DataGridView1_UserDeletingRow(object sender,
DataGridViewRowsRemovedEventArgs e)
{
MessageBox.Show(sender.ToString());
}
private void ShowAllTransactions_Load(object sender, EventArgs e)
{
dataGridView1.RowsRemoved += new
DataGridViewRowsRemovedEventHandler(DataGridView1_UserDeletingRow);
}
}
Thank you
setw not found in MSVC 2013 or NetBeans
setw not found in MSVC 2013 or NetBeans
I'm trying to write some simple code to learn cout formatting, and both
the IDEs listed in the title complain that they can't find/resolve the
identifier setw(). Here is my code:
#include <cstdlib>
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;
int main() {
cout << setw(10) << "Hello";
return 0;
}
I'm trying to write some simple code to learn cout formatting, and both
the IDEs listed in the title complain that they can't find/resolve the
identifier setw(). Here is my code:
#include <cstdlib>
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;
int main() {
cout << setw(10) << "Hello";
return 0;
}
How to authorize Elmah Logs Without MemberShip in MVC 4
How to authorize Elmah Logs Without MemberShip in MVC 4
I am searching easy way to access elmah.axd only admin. I saw the
authorize with membership role models. How to implement Elmah to Admin
areas.My controllers inheriting a BaseController Is it possible if rooute
value elmah.axd check who is displaying that page ?. I tried this issue
http://beletsky.net/2011/03/integrating-elmah-to-aspnet-mvc-in.html with
no success. Summary i wanna elmah in admin area.
I am searching easy way to access elmah.axd only admin. I saw the
authorize with membership role models. How to implement Elmah to Admin
areas.My controllers inheriting a BaseController Is it possible if rooute
value elmah.axd check who is displaying that page ?. I tried this issue
http://beletsky.net/2011/03/integrating-elmah-to-aspnet-mvc-in.html with
no success. Summary i wanna elmah in admin area.
MVC 4 View reload with change in data
MVC 4 View reload with change in data
**I have a simple controller and view.
I just want the Index.cshtml view page to be reloaded with new data.I have
debugged the code thoroughly. Infact, clicking on the "ul" when the
control goes to the Index(string value) method the model object is
populated with new data and even in the cshtml page the Model is showing
the new list in the debugger, but the view is NOT getting refreshed. I
really don't know why.. Can anyone help me plz? If I have gone wrong
horribly somewhere plz excuse my ignorance as I am new to MVC. Thanks in
advance... Controller:**
namespace MVCTestApp1.Controllers
{
public class TestController : Controller
{
//
// GET: /Test/
public ActionResult Index()
{
ModelState.Clear();
List<string> ll = new List<string>();
ll.Add("qq");
ll.Add("aa");
ll.Add("zz");
return View(ll);
}
[HttpPost]
public ActionResult Index(string value)
{
ModelState.Clear();
List<string> ll = new List<string>();
ll.Add("kkk");
ll.Add("qq");
ll.Add("aa");
ll.Add("zz");
return View(ll);
}
}
}
View:
@model IEnumerable<string>
@{
ViewBag.Title = "Index";
}
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<h2>Index</h2>
<ul id="bb">
@foreach (var i in Model)
{
<li>@Html.DisplayFor(ir=>i)</li>
}
</ul>
}
**I have a simple controller and view.
I just want the Index.cshtml view page to be reloaded with new data.I have
debugged the code thoroughly. Infact, clicking on the "ul" when the
control goes to the Index(string value) method the model object is
populated with new data and even in the cshtml page the Model is showing
the new list in the debugger, but the view is NOT getting refreshed. I
really don't know why.. Can anyone help me plz? If I have gone wrong
horribly somewhere plz excuse my ignorance as I am new to MVC. Thanks in
advance... Controller:**
namespace MVCTestApp1.Controllers
{
public class TestController : Controller
{
//
// GET: /Test/
public ActionResult Index()
{
ModelState.Clear();
List<string> ll = new List<string>();
ll.Add("qq");
ll.Add("aa");
ll.Add("zz");
return View(ll);
}
[HttpPost]
public ActionResult Index(string value)
{
ModelState.Clear();
List<string> ll = new List<string>();
ll.Add("kkk");
ll.Add("qq");
ll.Add("aa");
ll.Add("zz");
return View(ll);
}
}
}
View:
@model IEnumerable<string>
@{
ViewBag.Title = "Index";
}
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<h2>Index</h2>
<ul id="bb">
@foreach (var i in Model)
{
<li>@Html.DisplayFor(ir=>i)</li>
}
</ul>
}
Friday, 13 September 2013
Hiding a UINavigationController on start page
Hiding a UINavigationController on start page
Hi I have a navigationController that starts with a view controller in
which in viewDidLoad has:
self.navigationController.navigationBarHidden = YES;
I click a button on that page and it transitions to a second view
controller in which I put:
self.navigationController.navigationBarHidden = NO;
This works fine until I click the Back button in the navigation bar. How
do I keep the navigation bar permanently off the start page but not the
transitioned one?
Hi I have a navigationController that starts with a view controller in
which in viewDidLoad has:
self.navigationController.navigationBarHidden = YES;
I click a button on that page and it transitions to a second view
controller in which I put:
self.navigationController.navigationBarHidden = NO;
This works fine until I click the Back button in the navigation bar. How
do I keep the navigation bar permanently off the start page but not the
transitioned one?
Jquery: Show Div (animated) on Click, Only Close When Different Link Clicked + Only One DIV at a Time
Jquery: Show Div (animated) on Click, Only Close When Different Link
Clicked + Only One DIV at a Time
I have been searching for a jquery script that I sure must be basic, but I
keep coming up empty.
I am creating a portfolio type website and I need an effect similar to the
one seen here when you click on any item in the "Recent Work" section:
http://themes.zenthemes.net/cleanr/
Essentially this is the functionality:
Click a link on an item (multiple items will have a link to different
content)
On click, a div will animate and open with new content (in a pre-defined
location)
The div that opens will have a close button. If the close button is
clicked, the DIV will animate and close.
Only ONE of these divs with new content can be displayed at a time. So, if
a second link is clicked, the first div should close quickly and the
second div should open.
I hope between the link and the above description that makes sense.
Please let me know if you need further clarification.
Many thanks in advance! You are saving me hours of banging my head against
the keyboard. =)
Clicked + Only One DIV at a Time
I have been searching for a jquery script that I sure must be basic, but I
keep coming up empty.
I am creating a portfolio type website and I need an effect similar to the
one seen here when you click on any item in the "Recent Work" section:
http://themes.zenthemes.net/cleanr/
Essentially this is the functionality:
Click a link on an item (multiple items will have a link to different
content)
On click, a div will animate and open with new content (in a pre-defined
location)
The div that opens will have a close button. If the close button is
clicked, the DIV will animate and close.
Only ONE of these divs with new content can be displayed at a time. So, if
a second link is clicked, the first div should close quickly and the
second div should open.
I hope between the link and the above description that makes sense.
Please let me know if you need further clarification.
Many thanks in advance! You are saving me hours of banging my head against
the keyboard. =)
Create remote git repository without access to remote shell
Create remote git repository without access to remote shell
Is there any way to create a remote repository using git commands without
having shell access to the remote user directory?
Im looking for something that could be written like
git remote init ssh://user@host:/home/gituser/mynewrepository.git
For security reasons the normal shell was disabled for the user who owns
our central git repository (using: usermod -s /usr/bin/git-shell git) . So
there is no login shell available for this user and it is not possible to
initialize a repository on the central server. I have a personal user
login shell and I'm aware of multiple workarounds (sudo, write access to
/home/gituser/, ...)
Is there any way to create a remote repository using git commands without
having shell access to the remote user directory?
Im looking for something that could be written like
git remote init ssh://user@host:/home/gituser/mynewrepository.git
For security reasons the normal shell was disabled for the user who owns
our central git repository (using: usermod -s /usr/bin/git-shell git) . So
there is no login shell available for this user and it is not possible to
initialize a repository on the central server. I have a personal user
login shell and I'm aware of multiple workarounds (sudo, write access to
/home/gituser/, ...)
Changing the data of a object and the value of a parameter inside the embed from twitch
Changing the data of a object and the value of a parameter inside the
embed from twitch
Hello I am trying to change the data of a object and the value of a
parameter inside the embedding code from twitch.
I am not that good on javascript and could use some help.
I have done my research with no luck.
all help is appreciated :)
the embedding code that i want to change (this is a fresh embedding code,
no edits)
<object type="application/x-shockwave-flash" height="378" width="620"
id="live_embed_player_flash"
data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=thelifeisyours"
bgcolor="#000000">
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="allowNetworking" value="all" />
<param name="movie"
value="http://www.twitch.tv/widgets/live_embed_player.swf" />
<param name="flashvars"
value="hostname=www.twitch.tv&channel=thelifeisyours&auto_play=true&start_volume=25"
/>
</object>
here is the js i got so far and it doesn't work :P (remember i am a noob
in js)
function changestream1(){
var streamIn = document.getElementById('stream1').value;
var object = document.getElementById('live_embed_player_flash');
var param = document.getElementById('param');
object.setAttribute("data",
"http://www.twitch.tv/widgets/live_embed_player.swf?channel=" +
streamIn);
param.setAttribute("value", "hostname=www.twitch.tv&channel=" +
streamIn "&auto_play=true&start_volume=25" + streamIn);
}
the idea is that the js will create the data in the object and the value
in the parameter.
if you need a visual of how i am thinking this out press Link :D
JsFiddle
link to the website where this is going to be used
twitchgrabber
embed from twitch
Hello I am trying to change the data of a object and the value of a
parameter inside the embedding code from twitch.
I am not that good on javascript and could use some help.
I have done my research with no luck.
all help is appreciated :)
the embedding code that i want to change (this is a fresh embedding code,
no edits)
<object type="application/x-shockwave-flash" height="378" width="620"
id="live_embed_player_flash"
data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=thelifeisyours"
bgcolor="#000000">
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="allowNetworking" value="all" />
<param name="movie"
value="http://www.twitch.tv/widgets/live_embed_player.swf" />
<param name="flashvars"
value="hostname=www.twitch.tv&channel=thelifeisyours&auto_play=true&start_volume=25"
/>
</object>
here is the js i got so far and it doesn't work :P (remember i am a noob
in js)
function changestream1(){
var streamIn = document.getElementById('stream1').value;
var object = document.getElementById('live_embed_player_flash');
var param = document.getElementById('param');
object.setAttribute("data",
"http://www.twitch.tv/widgets/live_embed_player.swf?channel=" +
streamIn);
param.setAttribute("value", "hostname=www.twitch.tv&channel=" +
streamIn "&auto_play=true&start_volume=25" + streamIn);
}
the idea is that the js will create the data in the object and the value
in the parameter.
if you need a visual of how i am thinking this out press Link :D
JsFiddle
link to the website where this is going to be used
twitchgrabber
breezejs : passing 64-bit filters in the ODATA url
breezejs : passing 64-bit filters in the ODATA url
I've got a 64-bit (long) property in my model. The metadata are correct
and breezejs knows it is a 64-bit property.
Yet, when querying the data, the ODATA URL does not contain 'L' after the
value and therefore I get an exception on the server as it thinks I'm
trying to query against an int32.
So I've had to manually add the 'L' at the end of the filter.
Should this not be done automatically by breezejs ?
I've got a 64-bit (long) property in my model. The metadata are correct
and breezejs knows it is a 64-bit property.
Yet, when querying the data, the ODATA URL does not contain 'L' after the
value and therefore I get an exception on the server as it thinks I'm
trying to query against an int32.
So I've had to manually add the 'L' at the end of the filter.
Should this not be done automatically by breezejs ?
Thursday, 12 September 2013
multiprocessing.Pool with a global variable
multiprocessing.Pool with a global variable
I am using the Pool class from python's multiprocessing library to do some
shared memory processing on an HPC cluster.
Here is an abstraction of what I am trying to do:
poolVar = Pool(processes=numThreads)
argsArray = [ARGS ARRAY GOES HERE]
output = poolVar.map(myFunction, argsArray)
def myFunction(x):
# the object is a global variable in this case
return myFunction2(x,object)
def myFunction2(x,object):
return object.f(x)
The problem I am having is that the value of the output variable is
different each time I run my program (even though the function object.f()
is a deterministic function). (If numThreads = 1 then the output variable
is the same each time I run the program. In addition, the output variable
is not drastically different between runs when numThreads > 1.)
I have tried creating the object rather than storing it as a global variable:
def myFunction(x):
object = createObject()
return myFunction2(x,object)
However, in my program the object creation is expensive. Thus, I would
like to not have to create the object each time.
Do you have any tips? I am very new to parallel programming so I could be
going about this all wrong. I decided to use the Pool class since I wanted
to start with something simple. But I am willing to try a better way of
doing it.
I am using the Pool class from python's multiprocessing library to do some
shared memory processing on an HPC cluster.
Here is an abstraction of what I am trying to do:
poolVar = Pool(processes=numThreads)
argsArray = [ARGS ARRAY GOES HERE]
output = poolVar.map(myFunction, argsArray)
def myFunction(x):
# the object is a global variable in this case
return myFunction2(x,object)
def myFunction2(x,object):
return object.f(x)
The problem I am having is that the value of the output variable is
different each time I run my program (even though the function object.f()
is a deterministic function). (If numThreads = 1 then the output variable
is the same each time I run the program. In addition, the output variable
is not drastically different between runs when numThreads > 1.)
I have tried creating the object rather than storing it as a global variable:
def myFunction(x):
object = createObject()
return myFunction2(x,object)
However, in my program the object creation is expensive. Thus, I would
like to not have to create the object each time.
Do you have any tips? I am very new to parallel programming so I could be
going about this all wrong. I decided to use the Pool class since I wanted
to start with something simple. But I am willing to try a better way of
doing it.
I can't access native iOS from javascript in phonegap 2.7.0 using CDVPlugin?
I can't access native iOS from javascript in phonegap 2.7.0 using CDVPlugin?
I'm doing phonegap 2.7.0 web application in xcode 4.5.2 for iOS 6. In my
web application contains video recording option with six seconds duration.
So I done this process from "https://github.com/piemonte/PBJVision".
Now I'm trying to hybrid native iOS with Phonegap by using CDVPlugin.
Because I have an image(camera icon) in homescreen.html, when I click the
image, the image tag onclick() fire and call the -(void) _setup() method
in PBJViewController.m file. So the mainscreen.html was hide and show the
camera option with some custom design's.
So, I put PBJViewController.h & PBJViewController.m, PBJStrobeView.h &
PBJStrobeView.m, PBJVisionUtilities.h & PBJVisionUtilities.m, and last
PBJVision.h & PBJVison.m files in plugins folder.
Then I create a JavaScript files and named as PBJViewController.js and add
into the www folder.
PBJViewController.js
function PBJViewController()
{
}
loadingalert.prototype._setup = function()
{
//this.resultCallback(res);
cordova.exec("PBJViewController._setup");
}
cordova.addConstructor(function() {
if(!window.plugins)
{
window.plugins = {};
}
//window.plugins.loadingalert = new
PBJViewController();
window.loadingalert = new PBJViewController();
});
And then I wrote calling code in function video() at homescreen.html file.
homescreen.html
function video()
{
alert("video function");
$('#loader').hide();
$('#divcontroller').hide();
$('#menuid').hide();
$('#home_feeds').hide();
loadingalert._setup();
//window.plugins.loadingalert._setup();
//objloading._setup();
//window.location = "js-call:myObjectiveCFunction";
//window.location.href='video.html?user_id='+userid+'&fb_token='+getValue("fb_token");
}
And I made some changes in PBJViewController.h file
PBJViewController.h
#import <UIKit/UIKit.h>
#import <Cordova/CDVPlugin.h>
@interface PBJViewController : CDVPlugin <UIWebViewDelegate>
{
IBOutlet UIWebView *webView;
}
-(void)_setup:(NSMutableArray*)paramArray
withDict:(NSMutableDictionary*)options;
@end
And In PBJViewcontroller.m file
#import "PBJViewController.h"
#import "PBJVision.h"
#import "PBJStrobeView.h"
#import <Cordova/CDVPlugin.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <MediaPlayer/MediaPlayer.h>
@interface UIButton (ExtendedHit)
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
@end
@implementation UIButton (ExtendedHit)
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
CGRect relativeFrame = self.bounds;
UIEdgeInsets hitTestEdgeInsets = UIEdgeInsetsMake(-35, -35, -35, -35);
CGRect hitFrame = UIEdgeInsetsInsetRect(relativeFrame,
hitTestEdgeInsets);
return CGRectContainsPoint(hitFrame, point);
}
@end
@interface PBJViewController () <
UIGestureRecognizerDelegate,
PBJVisionDelegate,
UIAlertViewDelegate>
{
UIView *view;
PBJStrobeView *_strobeView;
UIButton *_doneButton;
UIButton *_flipButton;
UIView *_previewView;
AVCaptureVideoPreviewLayer *_previewLayer;
MPMoviePlayerViewController *playerController;
MPMoviePlayerController *moviePlayer;
UILabel *_instructionLabel;
UILabel *ticker;
NSTimer *timer;
//NSDate *startDate;
NSTimeInterval startDate;
int hours, minutes, seconds;
int secondsLeft;
int counter;
int timeRemaining;
int i;
NSTimeInterval elapsedTime;
UILongPressGestureRecognizer *_longPressGestureRecognizer;
BOOL _recording;
BOOL running;
ALAssetsLibrary *_assetLibrary;
__block NSDictionary *_currentVideo;
//NSTimeInterval coding..
int currMinute;
int currSecond;
int currHour;
int mins;
NSTimeInterval secondsAlreadyRun;
NSTimeInterval startTime;
NSDate *startDate1;
}
//@property (nonatomic, retain) IBOutlet UIView *containerView;
@property (strong, nonatomic) MPMoviePlayerController *moviePlayerController;
@property (nonatomic, strong) NSString *videoPath;
@end
@implementation PBJViewController
//@synthesize containerView;
@synthesize moviePlayerController;
@synthesize videoPath;
#pragma mark - init
/*- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle
*)nibBundleOrNil
{
//counter = 0;
//ticker.text = [NSString stringWithFormat:@"%d", counter];
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
_assetLibrary = [[ALAssetsLibrary alloc] init];
//[self _setup];
}
return self;
}*/
- (CDVPlugin *)initWithWebView:(UIWebView *)theWebView
{
self = (PBJViewController *)[super initWithWebView:theWebView];
if (self) {
_assetLibrary = [[ALAssetsLibrary alloc] init];
}
return self;
}
/*-(void) viewDidLoad
{
webView = [[UIWebView alloc] init];
// Register the UIWebViewDelegate in order to
shouldStartLoadWithRequest to be called (next function)
webView.delegate = self;
}*/
- (void)dealloc
{
[UIApplication sharedApplication].idleTimerDisabled = NO;
_longPressGestureRecognizer.delegate = nil;
[super dealloc];
}
//- (void)_setup
-(void)_setup:(NSMutableArray*)paramArray
withDict:(NSMutableDictionary*)options;
{
NSLog(@"Yes inheriting from homescreen btn click");
running = false;
secondsLeft = 67;
view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
view.backgroundColor = [UIColor blackColor];
view.autoresizingMask = UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight;
CGFloat viewWidth = CGRectGetWidth(view.frame);
// done button
_doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
_doneButton.frame = CGRectMake(viewWidth - 20.0f - 20.0f, 20.0f,
20.0f, 20.0f);
UIImage *buttonImage = [UIImage imageNamed:@"capture_yep"];
[_doneButton setImage:buttonImage forState:UIControlStateNormal];
[_doneButton addTarget:self action:@selector(_handleDoneButton:)
forControlEvents:UIControlEventTouchUpInside];
[view addSubview:_doneButton];
// elapsed time and red dot
_strobeView = [[PBJStrobeView alloc] initWithFrame:CGRectZero];
CGRect strobeFrame = _strobeView.frame;
strobeFrame.origin = CGPointMake(15.0f, 15.0f);
_strobeView.frame = strobeFrame;
[view addSubview:_strobeView];
// preview
_previewView = [[UIView alloc] initWithFrame:CGRectZero];
_previewView.backgroundColor = [UIColor blackColor];
CGRect previewFrame = CGRectZero;
previewFrame.origin = CGPointMake(0, 60.0f);
CGFloat previewWidth = view.frame.size.width;
previewFrame.size = CGSizeMake(previewWidth, previewWidth);
_previewView.frame = previewFrame;
// add AV layer
_previewLayer = [[PBJVision sharedInstance] previewLayer];
CGRect previewBounds = _previewView.layer.bounds;
_previewLayer.bounds = previewBounds;
_previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
_previewLayer.position = CGPointMake(CGRectGetMidX(previewBounds),
CGRectGetMidY(previewBounds));
[_previewView.layer addSublayer:_previewLayer];
[view addSubview:_previewView];
// instruction label
_instructionLabel = [[UILabel alloc] initWithFrame:view.bounds];
_instructionLabel.textAlignment = NSTextAlignmentCenter;
_instructionLabel.font = [UIFont fontWithName:@"HelveticaNeue"
size:15.0f];
_instructionLabel.textColor = [UIColor whiteColor];
_instructionLabel.backgroundColor = [UIColor blackColor];
_instructionLabel.text = NSLocalizedString(@"Touch and hold to
record", @"Instruction message for capturing video.");
[_instructionLabel sizeToFit];
CGPoint labelCenter = _previewView.center;
labelCenter.y += ((CGRectGetHeight(_previewView.frame) * 0.5f) + 35.0f);
_instructionLabel.center = labelCenter;
[view addSubview:_instructionLabel];
ticker = [[UILabel alloc] initWithFrame:CGRectMake(230, 100, 80, 20)];
ticker.textAlignment = NSTextAlignmentLeft;
ticker.font = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
ticker.textColor = [UIColor whiteColor];
ticker.backgroundColor = [UIColor blackColor];
ticker.text = @"00:00:00";
[_previewView addSubview:ticker];
// press to record gesture
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc]
init];
_longPressGestureRecognizer.delegate = self;
_longPressGestureRecognizer.minimumPressDuration = 0.0f;
_longPressGestureRecognizer.allowableMovement = 10.0f;
[_longPressGestureRecognizer addTarget:self
action:@selector(_handleLongPressGestureRecognizer:)];
// gesture view to record
UIView *gestureView = [[UIView alloc] initWithFrame:CGRectZero];
CGRect gestureFrame = view.bounds;
gestureFrame.origin = CGPointMake(0, 60.0f);
gestureFrame.size.height -= 10.0f;
gestureView.frame = gestureFrame;
[view addSubview:gestureView];
[gestureView addGestureRecognizer:_longPressGestureRecognizer];
// flip button
_flipButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *flipImage = [UIImage imageNamed:@"capture_flip"];
[_flipButton setImage:flipImage forState:UIControlStateNormal];
CGRect flipFrame = _flipButton.frame;
flipFrame.size = CGSizeMake(25.0f, 20.0f);
flipFrame.origin = CGPointMake(10.0f, CGRectGetHeight(view.bounds) -
10.0f);
_flipButton.frame = flipFrame;
[_flipButton addTarget:self action:@selector(_handleFlipButton:)
forControlEvents:UIControlEventTouchUpInside];
[view addSubview:_flipButton];
}
#pragma mark - view lifecycle
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:YES
withAnimation:UIStatusBarAnimationSlide];
[self _resetCapture];
[[PBJVision sharedInstance] startPreview];
}
Here I face the warning message 'CDVPlugin' may not respond to
'viewWillAppear:' because I replace the CDVPlugin for UIViewController
"@interface PBJViewController : CDVPlugin "
And I include the plugins name and value in config.xml file, there is,
config.xml
These are one of my sample code. My problem is till not get the desired
output.
Kindly give some suggestion or result.
I'm doing phonegap 2.7.0 web application in xcode 4.5.2 for iOS 6. In my
web application contains video recording option with six seconds duration.
So I done this process from "https://github.com/piemonte/PBJVision".
Now I'm trying to hybrid native iOS with Phonegap by using CDVPlugin.
Because I have an image(camera icon) in homescreen.html, when I click the
image, the image tag onclick() fire and call the -(void) _setup() method
in PBJViewController.m file. So the mainscreen.html was hide and show the
camera option with some custom design's.
So, I put PBJViewController.h & PBJViewController.m, PBJStrobeView.h &
PBJStrobeView.m, PBJVisionUtilities.h & PBJVisionUtilities.m, and last
PBJVision.h & PBJVison.m files in plugins folder.
Then I create a JavaScript files and named as PBJViewController.js and add
into the www folder.
PBJViewController.js
function PBJViewController()
{
}
loadingalert.prototype._setup = function()
{
//this.resultCallback(res);
cordova.exec("PBJViewController._setup");
}
cordova.addConstructor(function() {
if(!window.plugins)
{
window.plugins = {};
}
//window.plugins.loadingalert = new
PBJViewController();
window.loadingalert = new PBJViewController();
});
And then I wrote calling code in function video() at homescreen.html file.
homescreen.html
function video()
{
alert("video function");
$('#loader').hide();
$('#divcontroller').hide();
$('#menuid').hide();
$('#home_feeds').hide();
loadingalert._setup();
//window.plugins.loadingalert._setup();
//objloading._setup();
//window.location = "js-call:myObjectiveCFunction";
//window.location.href='video.html?user_id='+userid+'&fb_token='+getValue("fb_token");
}
And I made some changes in PBJViewController.h file
PBJViewController.h
#import <UIKit/UIKit.h>
#import <Cordova/CDVPlugin.h>
@interface PBJViewController : CDVPlugin <UIWebViewDelegate>
{
IBOutlet UIWebView *webView;
}
-(void)_setup:(NSMutableArray*)paramArray
withDict:(NSMutableDictionary*)options;
@end
And In PBJViewcontroller.m file
#import "PBJViewController.h"
#import "PBJVision.h"
#import "PBJStrobeView.h"
#import <Cordova/CDVPlugin.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <MediaPlayer/MediaPlayer.h>
@interface UIButton (ExtendedHit)
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
@end
@implementation UIButton (ExtendedHit)
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
CGRect relativeFrame = self.bounds;
UIEdgeInsets hitTestEdgeInsets = UIEdgeInsetsMake(-35, -35, -35, -35);
CGRect hitFrame = UIEdgeInsetsInsetRect(relativeFrame,
hitTestEdgeInsets);
return CGRectContainsPoint(hitFrame, point);
}
@end
@interface PBJViewController () <
UIGestureRecognizerDelegate,
PBJVisionDelegate,
UIAlertViewDelegate>
{
UIView *view;
PBJStrobeView *_strobeView;
UIButton *_doneButton;
UIButton *_flipButton;
UIView *_previewView;
AVCaptureVideoPreviewLayer *_previewLayer;
MPMoviePlayerViewController *playerController;
MPMoviePlayerController *moviePlayer;
UILabel *_instructionLabel;
UILabel *ticker;
NSTimer *timer;
//NSDate *startDate;
NSTimeInterval startDate;
int hours, minutes, seconds;
int secondsLeft;
int counter;
int timeRemaining;
int i;
NSTimeInterval elapsedTime;
UILongPressGestureRecognizer *_longPressGestureRecognizer;
BOOL _recording;
BOOL running;
ALAssetsLibrary *_assetLibrary;
__block NSDictionary *_currentVideo;
//NSTimeInterval coding..
int currMinute;
int currSecond;
int currHour;
int mins;
NSTimeInterval secondsAlreadyRun;
NSTimeInterval startTime;
NSDate *startDate1;
}
//@property (nonatomic, retain) IBOutlet UIView *containerView;
@property (strong, nonatomic) MPMoviePlayerController *moviePlayerController;
@property (nonatomic, strong) NSString *videoPath;
@end
@implementation PBJViewController
//@synthesize containerView;
@synthesize moviePlayerController;
@synthesize videoPath;
#pragma mark - init
/*- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle
*)nibBundleOrNil
{
//counter = 0;
//ticker.text = [NSString stringWithFormat:@"%d", counter];
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
_assetLibrary = [[ALAssetsLibrary alloc] init];
//[self _setup];
}
return self;
}*/
- (CDVPlugin *)initWithWebView:(UIWebView *)theWebView
{
self = (PBJViewController *)[super initWithWebView:theWebView];
if (self) {
_assetLibrary = [[ALAssetsLibrary alloc] init];
}
return self;
}
/*-(void) viewDidLoad
{
webView = [[UIWebView alloc] init];
// Register the UIWebViewDelegate in order to
shouldStartLoadWithRequest to be called (next function)
webView.delegate = self;
}*/
- (void)dealloc
{
[UIApplication sharedApplication].idleTimerDisabled = NO;
_longPressGestureRecognizer.delegate = nil;
[super dealloc];
}
//- (void)_setup
-(void)_setup:(NSMutableArray*)paramArray
withDict:(NSMutableDictionary*)options;
{
NSLog(@"Yes inheriting from homescreen btn click");
running = false;
secondsLeft = 67;
view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
view.backgroundColor = [UIColor blackColor];
view.autoresizingMask = UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight;
CGFloat viewWidth = CGRectGetWidth(view.frame);
// done button
_doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
_doneButton.frame = CGRectMake(viewWidth - 20.0f - 20.0f, 20.0f,
20.0f, 20.0f);
UIImage *buttonImage = [UIImage imageNamed:@"capture_yep"];
[_doneButton setImage:buttonImage forState:UIControlStateNormal];
[_doneButton addTarget:self action:@selector(_handleDoneButton:)
forControlEvents:UIControlEventTouchUpInside];
[view addSubview:_doneButton];
// elapsed time and red dot
_strobeView = [[PBJStrobeView alloc] initWithFrame:CGRectZero];
CGRect strobeFrame = _strobeView.frame;
strobeFrame.origin = CGPointMake(15.0f, 15.0f);
_strobeView.frame = strobeFrame;
[view addSubview:_strobeView];
// preview
_previewView = [[UIView alloc] initWithFrame:CGRectZero];
_previewView.backgroundColor = [UIColor blackColor];
CGRect previewFrame = CGRectZero;
previewFrame.origin = CGPointMake(0, 60.0f);
CGFloat previewWidth = view.frame.size.width;
previewFrame.size = CGSizeMake(previewWidth, previewWidth);
_previewView.frame = previewFrame;
// add AV layer
_previewLayer = [[PBJVision sharedInstance] previewLayer];
CGRect previewBounds = _previewView.layer.bounds;
_previewLayer.bounds = previewBounds;
_previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
_previewLayer.position = CGPointMake(CGRectGetMidX(previewBounds),
CGRectGetMidY(previewBounds));
[_previewView.layer addSublayer:_previewLayer];
[view addSubview:_previewView];
// instruction label
_instructionLabel = [[UILabel alloc] initWithFrame:view.bounds];
_instructionLabel.textAlignment = NSTextAlignmentCenter;
_instructionLabel.font = [UIFont fontWithName:@"HelveticaNeue"
size:15.0f];
_instructionLabel.textColor = [UIColor whiteColor];
_instructionLabel.backgroundColor = [UIColor blackColor];
_instructionLabel.text = NSLocalizedString(@"Touch and hold to
record", @"Instruction message for capturing video.");
[_instructionLabel sizeToFit];
CGPoint labelCenter = _previewView.center;
labelCenter.y += ((CGRectGetHeight(_previewView.frame) * 0.5f) + 35.0f);
_instructionLabel.center = labelCenter;
[view addSubview:_instructionLabel];
ticker = [[UILabel alloc] initWithFrame:CGRectMake(230, 100, 80, 20)];
ticker.textAlignment = NSTextAlignmentLeft;
ticker.font = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
ticker.textColor = [UIColor whiteColor];
ticker.backgroundColor = [UIColor blackColor];
ticker.text = @"00:00:00";
[_previewView addSubview:ticker];
// press to record gesture
_longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc]
init];
_longPressGestureRecognizer.delegate = self;
_longPressGestureRecognizer.minimumPressDuration = 0.0f;
_longPressGestureRecognizer.allowableMovement = 10.0f;
[_longPressGestureRecognizer addTarget:self
action:@selector(_handleLongPressGestureRecognizer:)];
// gesture view to record
UIView *gestureView = [[UIView alloc] initWithFrame:CGRectZero];
CGRect gestureFrame = view.bounds;
gestureFrame.origin = CGPointMake(0, 60.0f);
gestureFrame.size.height -= 10.0f;
gestureView.frame = gestureFrame;
[view addSubview:gestureView];
[gestureView addGestureRecognizer:_longPressGestureRecognizer];
// flip button
_flipButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *flipImage = [UIImage imageNamed:@"capture_flip"];
[_flipButton setImage:flipImage forState:UIControlStateNormal];
CGRect flipFrame = _flipButton.frame;
flipFrame.size = CGSizeMake(25.0f, 20.0f);
flipFrame.origin = CGPointMake(10.0f, CGRectGetHeight(view.bounds) -
10.0f);
_flipButton.frame = flipFrame;
[_flipButton addTarget:self action:@selector(_handleFlipButton:)
forControlEvents:UIControlEventTouchUpInside];
[view addSubview:_flipButton];
}
#pragma mark - view lifecycle
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:YES
withAnimation:UIStatusBarAnimationSlide];
[self _resetCapture];
[[PBJVision sharedInstance] startPreview];
}
Here I face the warning message 'CDVPlugin' may not respond to
'viewWillAppear:' because I replace the CDVPlugin for UIViewController
"@interface PBJViewController : CDVPlugin "
And I include the plugins name and value in config.xml file, there is,
config.xml
These are one of my sample code. My problem is till not get the desired
output.
Kindly give some suggestion or result.
Redirecting to user profile page after creating a student
Redirecting to user profile page after creating a student
I have the following controllers: 1- students_controller.rb
class StudentsController < ApplicationController
def index
@students = Student.all
end
def show
@student = Student.find(params[:id])
end
def new
@student = Student.new
end
def create
@student = Student.new(params[:student])
if @student.save
flash[:notice] = ' Student Record Saved Successfully. Please fill
the Parent Details.'
redirect_to new_student_guardian_path(@student.id)
else
flash[:error] = 'An error occurred please try again!'
render 'new'
end
end
def edit
end
end
2- guardians_controller.rb
class GuardiansController < ApplicationController
before_filter :set_student, only: [:new, :create]
def index
@guardian = Guardian.all
end
def show
@guardian = Guardian.find(params[:id])
end
def new
@guardian = Guardian.new
end
def create
@guardian = Guardian.new(params[:guardian])
if @guardian.save
flash[:notice] = ' Parent Record Saved Successfully. Please fill the
Additional Details.'
redirect_to new_student_previous_detail_path(@student)
else
flash.now[:error] = 'An error occurred please try again!'
render 'new'
end
end
def edit
end
private
def set_student
@student = Student.find(params[:student_id])
end
end
3- previous_details_controller.rb
class PreviousDetailsController < ApplicationController
before_filter :set_student, only: [:new, :create]
def index
@previous_detail = PreviousDetail.all
end
def show
@previous_detail = PreviousDetail.find(params[:id])
end
def new
@previous_detail = PreviousDetail.new
end
def create
@previous_detail = PreviousDetail.new(params[:previous_detail])
if @previous_detail.save
flash[:notice] = 'Record Saved Successfully.'
# redirect_to user profile page
else
flash.now[:error] = 'An error occurred please try again!'
redirect_to '/student/admission1'
end
end
def edit
end
private
def set_student
@student = Student.find(params[:student_id])
end
end
4- student.rb
class Student < ActiveRecord::Base
after_create :add_to_users
belongs_to :user
accepts_nested_attributes_for :guardians
has_one :previous_detail
accepts_nested_attributes_for :previous_detail
def add_to_users
new_user = User.new
new_user.user_name = self.first_name
new_user.first_name = self.first_name
new_user.last_name = self.last_name
new_user.email = self.email
new_user.password = "123456"
new_user.password_confirmation = "123456"
new_user.user_type_id = 3
new_user.save
end
end
This callback is used to create the student in users model.
How can i tell the previous_details_controller.rb to go to the user
profile page(the student who just created and also created in users model
using the after create :add_to_user) ?
I have the following controllers: 1- students_controller.rb
class StudentsController < ApplicationController
def index
@students = Student.all
end
def show
@student = Student.find(params[:id])
end
def new
@student = Student.new
end
def create
@student = Student.new(params[:student])
if @student.save
flash[:notice] = ' Student Record Saved Successfully. Please fill
the Parent Details.'
redirect_to new_student_guardian_path(@student.id)
else
flash[:error] = 'An error occurred please try again!'
render 'new'
end
end
def edit
end
end
2- guardians_controller.rb
class GuardiansController < ApplicationController
before_filter :set_student, only: [:new, :create]
def index
@guardian = Guardian.all
end
def show
@guardian = Guardian.find(params[:id])
end
def new
@guardian = Guardian.new
end
def create
@guardian = Guardian.new(params[:guardian])
if @guardian.save
flash[:notice] = ' Parent Record Saved Successfully. Please fill the
Additional Details.'
redirect_to new_student_previous_detail_path(@student)
else
flash.now[:error] = 'An error occurred please try again!'
render 'new'
end
end
def edit
end
private
def set_student
@student = Student.find(params[:student_id])
end
end
3- previous_details_controller.rb
class PreviousDetailsController < ApplicationController
before_filter :set_student, only: [:new, :create]
def index
@previous_detail = PreviousDetail.all
end
def show
@previous_detail = PreviousDetail.find(params[:id])
end
def new
@previous_detail = PreviousDetail.new
end
def create
@previous_detail = PreviousDetail.new(params[:previous_detail])
if @previous_detail.save
flash[:notice] = 'Record Saved Successfully.'
# redirect_to user profile page
else
flash.now[:error] = 'An error occurred please try again!'
redirect_to '/student/admission1'
end
end
def edit
end
private
def set_student
@student = Student.find(params[:student_id])
end
end
4- student.rb
class Student < ActiveRecord::Base
after_create :add_to_users
belongs_to :user
accepts_nested_attributes_for :guardians
has_one :previous_detail
accepts_nested_attributes_for :previous_detail
def add_to_users
new_user = User.new
new_user.user_name = self.first_name
new_user.first_name = self.first_name
new_user.last_name = self.last_name
new_user.email = self.email
new_user.password = "123456"
new_user.password_confirmation = "123456"
new_user.user_type_id = 3
new_user.save
end
end
This callback is used to create the student in users model.
How can i tell the previous_details_controller.rb to go to the user
profile page(the student who just created and also created in users model
using the after create :add_to_user) ?
How to launch epub from AIR andoird app
How to launch epub from AIR andoird app
I have an air app and would like to associate any epub files through
android and read the content.
Basically I would like to use my air app to open the epub file. Thus, I
tried to register the epub file and launch it with the app. I only get it
successful when I have this.
<action android:name="android.intent.action.VIEW" />
<action
android:name="android.intent.action.GET_CONTENT"/>
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content"
android:mimeType="application/epub+zip"
android:pathPattern=".*\\.epub" />
</intent-filter>
This way when I get into the AS code, the event.arguemtns[0] is
content://media/external/file/26253 which cannot be converted in a file
successful.
I tried adding this to find the file instead of the content
but this doesn't register my epub files.
I just downloaded those sample epub files off internet. Any idea what I'm
doing wrong?
I have an air app and would like to associate any epub files through
android and read the content.
Basically I would like to use my air app to open the epub file. Thus, I
tried to register the epub file and launch it with the app. I only get it
successful when I have this.
<action android:name="android.intent.action.VIEW" />
<action
android:name="android.intent.action.GET_CONTENT"/>
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content"
android:mimeType="application/epub+zip"
android:pathPattern=".*\\.epub" />
</intent-filter>
This way when I get into the AS code, the event.arguemtns[0] is
content://media/external/file/26253 which cannot be converted in a file
successful.
I tried adding this to find the file instead of the content
but this doesn't register my epub files.
I just downloaded those sample epub files off internet. Any idea what I'm
doing wrong?
Disable/hide "End tour" button in Bootstrap Tour
Disable/hide "End tour" button in Bootstrap Tour
Using the bootstrap-tour plug-in (http://bootstraptour.com/), I want to
disable or hide the default 'End Tour' button on each step except for the
very last step.
I tried modifying the step template to get rid of End Tour button
completely, but how do I activate it on the very last step?
Using the bootstrap-tour plug-in (http://bootstraptour.com/), I want to
disable or hide the default 'End Tour' button on each step except for the
very last step.
I tried modifying the step template to get rid of End Tour button
completely, but how do I activate it on the very last step?
MySQL not using multiple column index for some queries
MySQL not using multiple column index for some queries
I have a table with several million records on MySQL in an MyISAM table.
Very simplified, it's like this:
CREATE TABLE `test` (
`text` varchar(5) DEFAULT NULL,
`number` int(5) DEFAULT NULL,
KEY `number` (`number`) USING BTREE,
KEY `text_number` (`text`,`number`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
It's populated with this data:
INSERT INTO `test` VALUES ('abcd', '1');
INSERT INTO `test` VALUES ('abcd', '2');
INSERT INTO `test` VALUES ('abcd', '3');
INSERT INTO `test` VALUES ('abcd', '4');
INSERT INTO `test` VALUES ('bbbb', '1');
INSERT INTO `test` VALUES ('bbbb', '2');
INSERT INTO `test` VALUES ('bbbb', '3');
When I run the following query:
EXPLAIN SELECT * FROM `test` WHERE (`text` = 'bbbb' AND `number` = 2)
It returns 'number' as the key to use. But the following query:
EXPLAIN SELECT * FROM `test` WHERE (`text` = 'bbbb' AND `number` = 1)
Returns 'text_number' as key to use, which would make more sense to me as
this combined key matches exactly with the 2 columns in the WHERE. On
these amount of records the performance isn't an issue, but on several
million records the query which uses the 'text' index takes 4 seconds, and
the one that uses 'text_number' index is finished in several milliseconds.
Is there a logical explaination for this? How can I change the index that
MySQL uses the index? I know I can use USE INDEX but I want MySQL to be
able to find the best plan to execute the query. This is on MySQL 5.1 and
5.5, same results.
I have a table with several million records on MySQL in an MyISAM table.
Very simplified, it's like this:
CREATE TABLE `test` (
`text` varchar(5) DEFAULT NULL,
`number` int(5) DEFAULT NULL,
KEY `number` (`number`) USING BTREE,
KEY `text_number` (`text`,`number`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
It's populated with this data:
INSERT INTO `test` VALUES ('abcd', '1');
INSERT INTO `test` VALUES ('abcd', '2');
INSERT INTO `test` VALUES ('abcd', '3');
INSERT INTO `test` VALUES ('abcd', '4');
INSERT INTO `test` VALUES ('bbbb', '1');
INSERT INTO `test` VALUES ('bbbb', '2');
INSERT INTO `test` VALUES ('bbbb', '3');
When I run the following query:
EXPLAIN SELECT * FROM `test` WHERE (`text` = 'bbbb' AND `number` = 2)
It returns 'number' as the key to use. But the following query:
EXPLAIN SELECT * FROM `test` WHERE (`text` = 'bbbb' AND `number` = 1)
Returns 'text_number' as key to use, which would make more sense to me as
this combined key matches exactly with the 2 columns in the WHERE. On
these amount of records the performance isn't an issue, but on several
million records the query which uses the 'text' index takes 4 seconds, and
the one that uses 'text_number' index is finished in several milliseconds.
Is there a logical explaination for this? How can I change the index that
MySQL uses the index? I know I can use USE INDEX but I want MySQL to be
able to find the best plan to execute the query. This is on MySQL 5.1 and
5.5, same results.
Which http method is used by default in button click?
Which http method is used by default in button click?
Which http method is used by default in button click(server control), Get
or Post? and what is simplest the way to prove if it uses Get or Post?
Which http method is used by default in button click(server control), Get
or Post? and what is simplest the way to prove if it uses Get or Post?
Update multiple rows using CASE WHEN - ORACLE
Update multiple rows using CASE WHEN - ORACLE
I have the table ACCOUNT of structure as follow:
ACCOUNT_ID | ACCOUNT_STATUS|
004460721 | 2 |
042056291 | 5 |
601272065 | 3 |
I need to update the three rows at once using one SELECT statement such
that, the second column will be 5, 3, 2 respectively.
I used the following query but seems there is something missing
UPDATE ACCOUNT
SET ACCOUNT_STATUS = CASE
WHEN ACCOUNT_STATUS = '004460721' THEN 5
WHEN ACCOUNT_STATUS = '042056291' THEN 3
WHEN ACCOUNT_STATUS = '601272065' THEN 2
WHERE ACCOUNT_ID IN ('004460721','042056291','601272065')
My question, is this way correct? if no, can I use CASE WHEN statement and
how or I only have choice of using SUB-SELECT to acheive that in one
statement?
Kindly, notice this is for SQL ORACLE
I have the table ACCOUNT of structure as follow:
ACCOUNT_ID | ACCOUNT_STATUS|
004460721 | 2 |
042056291 | 5 |
601272065 | 3 |
I need to update the three rows at once using one SELECT statement such
that, the second column will be 5, 3, 2 respectively.
I used the following query but seems there is something missing
UPDATE ACCOUNT
SET ACCOUNT_STATUS = CASE
WHEN ACCOUNT_STATUS = '004460721' THEN 5
WHEN ACCOUNT_STATUS = '042056291' THEN 3
WHEN ACCOUNT_STATUS = '601272065' THEN 2
WHERE ACCOUNT_ID IN ('004460721','042056291','601272065')
My question, is this way correct? if no, can I use CASE WHEN statement and
how or I only have choice of using SUB-SELECT to acheive that in one
statement?
Kindly, notice this is for SQL ORACLE
Wednesday, 11 September 2013
Where can i find best tutorial and exercises in JAVA?
Where can i find best tutorial and exercises in JAVA?
I am new in JAVA. So, i don't know which way is good for learning JAVA. I
have a lot experience in php, and some C. But i don't have any experience
in JAVA. Please help me, Where can i find best tutorial and exercises in
JAVA?! And what is the best way to learning JAVA?
I am new in JAVA. So, i don't know which way is good for learning JAVA. I
have a lot experience in php, and some C. But i don't have any experience
in JAVA. Please help me, Where can i find best tutorial and exercises in
JAVA?! And what is the best way to learning JAVA?
How do foundation classes know what instance to act upon when an instance method is called?
How do foundation classes know what instance to act upon when an instance
method is called?
Certain foundation classes such as NSString or NSArray have instance
methods that do something with that instance, but never ask for the
instance to be given to then. For example:
NSArray *array = @[@"hi"];
Int number = [array count];
The count method knows which array to count without asking for one to be
provided. How so you do that? I'm looking to make a category on NSString
with an incrementByOne instance method. I don't want to ask for the string
in the method deceleration, I want to know what object I'm performing the
action on, just like count knows which array to work on. If anyone can
help me out, I would greatly appreciate it.
method is called?
Certain foundation classes such as NSString or NSArray have instance
methods that do something with that instance, but never ask for the
instance to be given to then. For example:
NSArray *array = @[@"hi"];
Int number = [array count];
The count method knows which array to count without asking for one to be
provided. How so you do that? I'm looking to make a category on NSString
with an incrementByOne instance method. I don't want to ask for the string
in the method deceleration, I want to know what object I'm performing the
action on, just like count knows which array to work on. If anyone can
help me out, I would greatly appreciate it.
How to force a textbox to update its text
How to force a textbox to update its text
So I've looked through maybe five to ten questions on stackoverflow about
setting text into a textbox using a range of commands. I've tried
SetWindowText, SendMessage with EM_SETSEL and EM_REPLACESEL, and a few
others that I can't think of off the top of my head. For the most part I
have been successful, except for one strange occurrence.
When I set the text of this specific text box, nothing appears, nothing
changes. At first I thought I was not setting the data correctly. However,
when I use Spy++ or Winspector to see the text of a textbox, the correct
data with my changes are in there, but not displayed on the actual
textbox. Even stranger, when I click back into the form with the textbox I
"edited", spy++ and Winspector's data changes to what the textbox is
displaying.
I spoke with a friend of mine and he mentioned it might be a race
condition. I'm trying to edit this box and the textbox is being edited by
some other thread as well.
If anyone has any suggestions I would really appreciate it.
So I've looked through maybe five to ten questions on stackoverflow about
setting text into a textbox using a range of commands. I've tried
SetWindowText, SendMessage with EM_SETSEL and EM_REPLACESEL, and a few
others that I can't think of off the top of my head. For the most part I
have been successful, except for one strange occurrence.
When I set the text of this specific text box, nothing appears, nothing
changes. At first I thought I was not setting the data correctly. However,
when I use Spy++ or Winspector to see the text of a textbox, the correct
data with my changes are in there, but not displayed on the actual
textbox. Even stranger, when I click back into the form with the textbox I
"edited", spy++ and Winspector's data changes to what the textbox is
displaying.
I spoke with a friend of mine and he mentioned it might be a race
condition. I'm trying to edit this box and the textbox is being edited by
some other thread as well.
If anyone has any suggestions I would really appreciate it.
QT for Android on Mac or Linux build "Can not detect ndk toolchain..."
QT for Android on Mac or Linux build "Can not detect ndk toolchain..."
I`ve just install SDK, NDK, JDK. Open Terminal.
moroz@moroz:~/qt/qt5$ ./configure -developer-build -opensource
-confirm-license -xplatform android-g++ -nomake tests -nomake examples
-android-ndk android-ndk-r9/ -android-sdk android-sdk-linux/
-android-ndk-host linux-x86_64 -android-toolchain-version 4.8 -skip
qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples +
cd qtbase + /home/moroz/qt/qt5/qtbase/configure -top-level
-developer-build -opensource -confirm-license -xplatform android-g++
-nomake tests -nomake examples -android-ndk android-ndk-r9/ -android-sdk
android-sdk-linux/ -android-ndk-host linux-x86_64
-android-toolchain-version 4.8 -skip qttranslations -skip qtwebkit -skip
qtserialport -skip qtwebkit-examples
Can not detect Android NDK toolchain. Please use
-android-toolchain-version to specify
And there is the same message on Mac and Ubuntu!!!
I`ve just install SDK, NDK, JDK. Open Terminal.
moroz@moroz:~/qt/qt5$ ./configure -developer-build -opensource
-confirm-license -xplatform android-g++ -nomake tests -nomake examples
-android-ndk android-ndk-r9/ -android-sdk android-sdk-linux/
-android-ndk-host linux-x86_64 -android-toolchain-version 4.8 -skip
qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples +
cd qtbase + /home/moroz/qt/qt5/qtbase/configure -top-level
-developer-build -opensource -confirm-license -xplatform android-g++
-nomake tests -nomake examples -android-ndk android-ndk-r9/ -android-sdk
android-sdk-linux/ -android-ndk-host linux-x86_64
-android-toolchain-version 4.8 -skip qttranslations -skip qtwebkit -skip
qtserialport -skip qtwebkit-examples
Can not detect Android NDK toolchain. Please use
-android-toolchain-version to specify
And there is the same message on Mac and Ubuntu!!!
Find active links parent and clone nested ul
Find active links parent and clone nested ul
//This works! but I was trying to avoid the extra class
$("a.active").parent().addClass("active");
$('li.active ul').clone().appendTo('.leftnav').removeClass();
// this does not work
$("a.active").parent(function () {
$('this ul').clone().appendTo('.leftnav').removeClass();
})
// does not work either
var activeLink = $("a.active").parent();
$(activeLink('ul')).clone().appendTo('.leftnav').removeClass();
Can you add to the "this" by looking for its nest ul?
if not
what about placing it in a variable?
//This works! but I was trying to avoid the extra class
$("a.active").parent().addClass("active");
$('li.active ul').clone().appendTo('.leftnav').removeClass();
// this does not work
$("a.active").parent(function () {
$('this ul').clone().appendTo('.leftnav').removeClass();
})
// does not work either
var activeLink = $("a.active").parent();
$(activeLink('ul')).clone().appendTo('.leftnav').removeClass();
Can you add to the "this" by looking for its nest ul?
if not
what about placing it in a variable?
Save File Dialog , restrict name
Save File Dialog , restrict name
my program has a save file option which is shown below :
//Browse for file
SaveFileDialog ofd = new SaveFileDialog();
ofd.Filter = "CSV|*.csv";
ofd.DefaultExt = ".csv";
DialogResult result = ofd.ShowDialog();
string converted = result.ToString();
if (converted == "OK")
{
Master_Inventory_Export_savePath.Text = ofd.FileName;
}
if I write the file name as "example" it saves correctly as a .csv however
if I set the name as "example.txt" it saves as a text file , I've looked
on msdn etc but even setting the default extension doesn't prevent this ,
any ideas on how to only allow files of .csv to be saved ?
my program has a save file option which is shown below :
//Browse for file
SaveFileDialog ofd = new SaveFileDialog();
ofd.Filter = "CSV|*.csv";
ofd.DefaultExt = ".csv";
DialogResult result = ofd.ShowDialog();
string converted = result.ToString();
if (converted == "OK")
{
Master_Inventory_Export_savePath.Text = ofd.FileName;
}
if I write the file name as "example" it saves correctly as a .csv however
if I set the name as "example.txt" it saves as a text file , I've looked
on msdn etc but even setting the default extension doesn't prevent this ,
any ideas on how to only allow files of .csv to be saved ?
Scrollbar click makes div disappear IE9+ / Windows 8
Scrollbar click makes div disappear IE9+ / Windows 8
Because there are a couple of skinned select boxes on my site, I am using
dropkick.js, which essentially replaces the select boxes with interactive
divs. If the list is larger than the max-height, the overflow-auto makes
scrollbars appear. It works fine on Firefox, Chrome and Safari.
On Windows 8 + IE9 & IE10 a scrollbar appears, but when I click or try to
drag it, the div hides!
> Link to the page
I have only found a slightly similar issue on a Bootstrap UI combobox but
that script did not work for me, because dropkick.js does not use
Bootstrap and adapting the script did not solve the problem.
> Link to similar bug
I was hoping it could be fixed with stopPropagation on the div but no luck
on that either. Tried -ms-overflow-style:scrollbar but that does not
change the behaviour.
Has anyone stumbled across a working fix for this in IE9+?
Because there are a couple of skinned select boxes on my site, I am using
dropkick.js, which essentially replaces the select boxes with interactive
divs. If the list is larger than the max-height, the overflow-auto makes
scrollbars appear. It works fine on Firefox, Chrome and Safari.
On Windows 8 + IE9 & IE10 a scrollbar appears, but when I click or try to
drag it, the div hides!
> Link to the page
I have only found a slightly similar issue on a Bootstrap UI combobox but
that script did not work for me, because dropkick.js does not use
Bootstrap and adapting the script did not solve the problem.
> Link to similar bug
I was hoping it could be fixed with stopPropagation on the div but no luck
on that either. Tried -ms-overflow-style:scrollbar but that does not
change the behaviour.
Has anyone stumbled across a working fix for this in IE9+?
What's wrongof the MyBatis SQL?
What's wrongof the MyBatis SQL?
I've got two sql in MyBatis, the first one is a query result, and the
second one tries to get the count of the first one. the first sql:
<select id="getFeedbackEntities" resultType="map" parameterType="map">
SELECT * FROM feed_back
WHERE (DATE(sumit_time) BETWEEN #{startDate} AND #{endDate})
AND (comment LIKE #{keyword} OR city LIKE #{keyword} OR isp LIKE
#{keyword})
<if test="type > 0">
AND type = #{type}
</if>
<if test="reason > 0">
AND reason = #{reason}
</if>
ORDER BY #{sort} #{order} LIMIT #{offset}, #{limit}
</select>
the second sql is:
<select id="getFeedbackCount" resultType="int" parameterType="map">
SELECT COUNT(1) FROM feed_back
WHERE (DATE(sumit_time) BETWEEN #{startDate} AND #{endDate})
AND (comment LIKE #{keyword} OR city LIKE #{keyword} OR isp LIKE
#{keyword})
<if test="type > 0">
AND type = #{type}
</if>
<if test="reason > 0">
AND reason = #{reason}
</if>
</select>
I called them with the same parameters. The two sql work fine in seperate
environment, while in the webapp, the second one got the wrong result. I'm
really confused.
I've got two sql in MyBatis, the first one is a query result, and the
second one tries to get the count of the first one. the first sql:
<select id="getFeedbackEntities" resultType="map" parameterType="map">
SELECT * FROM feed_back
WHERE (DATE(sumit_time) BETWEEN #{startDate} AND #{endDate})
AND (comment LIKE #{keyword} OR city LIKE #{keyword} OR isp LIKE
#{keyword})
<if test="type > 0">
AND type = #{type}
</if>
<if test="reason > 0">
AND reason = #{reason}
</if>
ORDER BY #{sort} #{order} LIMIT #{offset}, #{limit}
</select>
the second sql is:
<select id="getFeedbackCount" resultType="int" parameterType="map">
SELECT COUNT(1) FROM feed_back
WHERE (DATE(sumit_time) BETWEEN #{startDate} AND #{endDate})
AND (comment LIKE #{keyword} OR city LIKE #{keyword} OR isp LIKE
#{keyword})
<if test="type > 0">
AND type = #{type}
</if>
<if test="reason > 0">
AND reason = #{reason}
</if>
</select>
I called them with the same parameters. The two sql work fine in seperate
environment, while in the webapp, the second one got the wrong result. I'm
really confused.
How to delete a file from the filesystem based on the returned case insensitive delta?
How to delete a file from the filesystem based on the returned case
insensitive delta?
I am attempting to write a code to fulfill this particular case documented
in the Dropbox Core API python SDK.
[path, nil]: Indicates that there is no file/folder at the path on
Dropbox. To update your local state to match, delete whatever is at path,
including any children (you will sometimes also get "delete" delta entries
for the children, but this is not guaranteed). If your local state doesn't
have anything at path, ignore this entry.
The API notes that the returned [path] is case insensitive.
Remember: Dropbox treats file names in a case-insensitive but
case-preserving way. To facilitate this, the path strings above are
lower-cased versions of the actual path. The metadata dicts have the
original, case-preserved path.
How do I remove the file or directory in question from my system if I do
not know the case-preserved version of the path?
insensitive delta?
I am attempting to write a code to fulfill this particular case documented
in the Dropbox Core API python SDK.
[path, nil]: Indicates that there is no file/folder at the path on
Dropbox. To update your local state to match, delete whatever is at path,
including any children (you will sometimes also get "delete" delta entries
for the children, but this is not guaranteed). If your local state doesn't
have anything at path, ignore this entry.
The API notes that the returned [path] is case insensitive.
Remember: Dropbox treats file names in a case-insensitive but
case-preserving way. To facilitate this, the path strings above are
lower-cased versions of the actual path. The metadata dicts have the
original, case-preserved path.
How do I remove the file or directory in question from my system if I do
not know the case-preserved version of the path?
Tuesday, 10 September 2013
iText not able to recognize language texts other than English to generate pdf
iText not able to recognize language texts other than English to generate pdf
We are using iText for reporting in an android app with localization and
multilanguage support but iText does not recognize languages texts other
than English. The pdf report shows jibberish instead of the chosen
language. Please help.
We are using iText for reporting in an android app with localization and
multilanguage support but iText does not recognize languages texts other
than English. The pdf report shows jibberish instead of the chosen
language. Please help.
Required device capabilities For iPhone5 upper
Required device capabilities For iPhone5 upper
Today, iPhone5C and iPhone5S were announced by Apple.
So I want to cut support for iPhone4S under. (I want to focus 640 × 1136
resolution only.
Do you know how to limit iPhone5 upper on iTunes?
Can property "Required device capabilities" limit it?
Today, iPhone5C and iPhone5S were announced by Apple.
So I want to cut support for iPhone4S under. (I want to focus 640 × 1136
resolution only.
Do you know how to limit iPhone5 upper on iTunes?
Can property "Required device capabilities" limit it?
Pass url variable on to next page?
Pass url variable on to next page?
I need some help on passing a url php variable onto the next page. I've
tried searching throughout the site for help and I've spent a lot of time
trying to figure this out with no luck. Basically I need to be able to
change the paypal link button id on page 2 with the url variable from page
1.
The variable is initially passed along with the URL:
http://www.site.com?p=paypalbuttonid I would like to pass that "p"
variable on to the next page.
Page 1 code (above html):
<?php
session_start();
$_SESSION['paypal'] = $_GET['p'];
?>
Page 2 code (above html):
<?php
session_start();
$p = $_SESSION['paypal'];
?>
I'm calling the variable in a link on page 2 (below html):
<a
href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=<?php
echo $p ;?>" target="_blank" class="btn">
I'm not sure what I'm dong wrong but I'm a complete newbie to PHP so
please help! The variable shows up blank in the URL on page 2. Thank you!
- Chad
I need some help on passing a url php variable onto the next page. I've
tried searching throughout the site for help and I've spent a lot of time
trying to figure this out with no luck. Basically I need to be able to
change the paypal link button id on page 2 with the url variable from page
1.
The variable is initially passed along with the URL:
http://www.site.com?p=paypalbuttonid I would like to pass that "p"
variable on to the next page.
Page 1 code (above html):
<?php
session_start();
$_SESSION['paypal'] = $_GET['p'];
?>
Page 2 code (above html):
<?php
session_start();
$p = $_SESSION['paypal'];
?>
I'm calling the variable in a link on page 2 (below html):
<a
href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=<?php
echo $p ;?>" target="_blank" class="btn">
I'm not sure what I'm dong wrong but I'm a complete newbie to PHP so
please help! The variable shows up blank in the URL on page 2. Thank you!
- Chad
list picker selected item load from isolated storage text without listpicker selection changed event
list picker selected item load from isolated storage text without
listpicker selection changed event
I have a page that updates list picker selection to isolated storage(text
file),on app reload i gave the selected item(text file) to list picker.Now
any list picker change would update my isolated store(text file) using
selection changed as it needs .The problem is that on app reload when
selected item goes to listpicker it starts the selection changed event
handler.
The code is a little large....any logical suggestions?
listpicker selection changed event
I have a page that updates list picker selection to isolated storage(text
file),on app reload i gave the selected item(text file) to list picker.Now
any list picker change would update my isolated store(text file) using
selection changed as it needs .The problem is that on app reload when
selected item goes to listpicker it starts the selection changed event
handler.
The code is a little large....any logical suggestions?
Drush not working in sublime Text 2
Drush not working in sublime Text 2
I use sublime_drush with Sublime Text 2. Recently i am facing a problem.
I cant use drush from Sublime all the time.
But i can use just once after a restart of Sublime.
OS MAC OSX 10.8.4
Sublime Version 2.0.1 Build 2217
I use sublime_drush with Sublime Text 2. Recently i am facing a problem.
I cant use drush from Sublime all the time.
But i can use just once after a restart of Sublime.
OS MAC OSX 10.8.4
Sublime Version 2.0.1 Build 2217
Toolbar in main VC and Toolbar in Modal VC won't show same button
Toolbar in main VC and Toolbar in Modal VC won't show same button
I am running into a weird issue that I can't find anything for on the
internet. I have a UIViewController that is showing a toolbar at the
bottom with a custom button in it. That button is added like..
List<UIBarButtonItem> items = new List<UIBarButtonItem>();
UIButton _helpButton = new UIButton();
//....
// code to create our custom button with background
// .....
UIBarButtonItem helpBarButton = new UIBarButtonItem(_helpButton);
items.Add(helpBarButton);
When showing our VC, we show the toolbar and everything looks great. On
the VC, we have a button that opens another VC(as the root view of another
UINavigationController) as a modal FormSheet. In ViewDidAppear, we also
set the toolbar to visible, which would show the same help button, which
also works great.
Once the modal VC is shown, since it's not full screen, you can still see
the other VC in the background. The toolbar on the background VC no longer
has the help button visible(the Toolbar is still showing). There is no
code that removes or hides the help button, so I'm not sure what is
happening to it.
As I don't really know how to set this scenario up in objective-c, I'm not
sure if this is an iOS issue, a Xamarin.iOS issue, or an issue with my
understanding of the toolbar.
I am running into a weird issue that I can't find anything for on the
internet. I have a UIViewController that is showing a toolbar at the
bottom with a custom button in it. That button is added like..
List<UIBarButtonItem> items = new List<UIBarButtonItem>();
UIButton _helpButton = new UIButton();
//....
// code to create our custom button with background
// .....
UIBarButtonItem helpBarButton = new UIBarButtonItem(_helpButton);
items.Add(helpBarButton);
When showing our VC, we show the toolbar and everything looks great. On
the VC, we have a button that opens another VC(as the root view of another
UINavigationController) as a modal FormSheet. In ViewDidAppear, we also
set the toolbar to visible, which would show the same help button, which
also works great.
Once the modal VC is shown, since it's not full screen, you can still see
the other VC in the background. The toolbar on the background VC no longer
has the help button visible(the Toolbar is still showing). There is no
code that removes or hides the help button, so I'm not sure what is
happening to it.
As I don't really know how to set this scenario up in objective-c, I'm not
sure if this is an iOS issue, a Xamarin.iOS issue, or an issue with my
understanding of the toolbar.
Is it harmful for the HDD, the icon samples to be in D:\?
Is it harmful for the HDD, the icon samples to be in D:\?
Is it harmful for the HDD, the icon samples to be in D:\? ..Also the start
menu button sample is in D:. (Classic Shell)
I downloaded some nice icons and exchanged the old ones on my desktop. The
User, My Computer, Recycle Bin ones, and made two New Folders using icons
for them too.
The question is - I moved these new icon samples in D:\ (which is not the
primary drive), and was wondering if the pin that reads the HDD is
physically moving all the time from one side of the disk to the other.
Because the icons are situated in the D:\ ..and these icons are set to
items that are located in C:\ , lol!
so i was wondering if it damages (physically) the hard drive!
Please answer, Thank You!
Is it harmful for the HDD, the icon samples to be in D:\? ..Also the start
menu button sample is in D:. (Classic Shell)
I downloaded some nice icons and exchanged the old ones on my desktop. The
User, My Computer, Recycle Bin ones, and made two New Folders using icons
for them too.
The question is - I moved these new icon samples in D:\ (which is not the
primary drive), and was wondering if the pin that reads the HDD is
physically moving all the time from one side of the disk to the other.
Because the icons are situated in the D:\ ..and these icons are set to
items that are located in C:\ , lol!
so i was wondering if it damages (physically) the hard drive!
Please answer, Thank You!
c# how to preven double value truncation when converting to string
c# how to preven double value truncation when converting to string
Double x = 11.123456789123456;
string y = Convert.ToString(x);
//gives y=11.1234567891235
//y should be =11.123456789123456
From the above code how can I prevent the last digit(6) from being truncated
Double x = 11.123456789123456;
string y = Convert.ToString(x);
//gives y=11.1234567891235
//y should be =11.123456789123456
From the above code how can I prevent the last digit(6) from being truncated
Monday, 9 September 2013
return an pointer to an object from a function without using new to allocate the pointer
return an pointer to an object from a function without using new to
allocate the pointer
From the thread in
When should I use the new keyword in C++?
The answer talks about when "new" must be used in order to create a
pointer to an object if you need to return the pointer to the object from
the function.
However, my code below works fine. I use a local pointer instead of
allocating some memory to a new pointer.
node* queue::dequeue(){
if(head==0){
cout<<"error: the queue is empty, can't dequeue.\n";
return 0;
}
else if(head->next !=0){
node *tmp=head;
head=head->next;
tmp->next=0;
return tmp;
}
else if(head->next ==0){
node *tmp=head;
head=0;
tmp->next=0;
return tmp;
}
}
It is a simple dequeue() operation. My tmp is a local pointer. But i still
return it.
allocate the pointer
From the thread in
When should I use the new keyword in C++?
The answer talks about when "new" must be used in order to create a
pointer to an object if you need to return the pointer to the object from
the function.
However, my code below works fine. I use a local pointer instead of
allocating some memory to a new pointer.
node* queue::dequeue(){
if(head==0){
cout<<"error: the queue is empty, can't dequeue.\n";
return 0;
}
else if(head->next !=0){
node *tmp=head;
head=head->next;
tmp->next=0;
return tmp;
}
else if(head->next ==0){
node *tmp=head;
head=0;
tmp->next=0;
return tmp;
}
}
It is a simple dequeue() operation. My tmp is a local pointer. But i still
return it.
placeholder vs. data-placeholder, in HTML
placeholder vs. data-placeholder, in HTML
What's the difference between the two?
placeholder vs. data-placeholder?
They both seem to produce the same results.
<select data-placeholder="Enter name">
<select placeholder="Enter name">
What's the difference?
(Which one's stronger?)
What's the difference between the two?
placeholder vs. data-placeholder?
They both seem to produce the same results.
<select data-placeholder="Enter name">
<select placeholder="Enter name">
What's the difference?
(Which one's stronger?)
How can I generate a call tree?
How can I generate a call tree?
I need to write some functionality to build a call tree given an assembly
i.e. I want to know that method A of some type calls methods B and C or
other types.
I've looked around within the Reflection API but don't see any ready way
to accomplish this. can anyone point me in the right direction?
I need to write some functionality to build a call tree given an assembly
i.e. I want to know that method A of some type calls methods B and C or
other types.
I've looked around within the Reflection API but don't see any ready way
to accomplish this. can anyone point me in the right direction?
QProcess saving to Qtextedit
QProcess saving to Qtextedit
What I'm trying to do is launch a program within another program using
QProcess and then save the output from the launched program into a
QTextEdit of the launcher program. Every time I launch this program I want
it to add more text to the QTextEdit. Now I get the program to launch but
then after the text is supposed to be written it crashes. Here is the
code:
#ifndef WIDGET_H
#define WIDGET_H
#include <QtGui/QWidget>
#include <QPushButton>
#include <QTextEdit>
class Widget : public QWidget
{
Q_OBJECT
public:
Widget();
~Widget();
public slots:
void launchModule();
void finished();
private:
QPushButton* addBtn;
QTextEdit* text;
};
What I'm trying to do is launch a program within another program using
QProcess and then save the output from the launched program into a
QTextEdit of the launcher program. Every time I launch this program I want
it to add more text to the QTextEdit. Now I get the program to launch but
then after the text is supposed to be written it crashes. Here is the
code:
#ifndef WIDGET_H
#define WIDGET_H
#include <QtGui/QWidget>
#include <QPushButton>
#include <QTextEdit>
class Widget : public QWidget
{
Q_OBJECT
public:
Widget();
~Widget();
public slots:
void launchModule();
void finished();
private:
QPushButton* addBtn;
QTextEdit* text;
};
Bootstrap 3 - Align font-awesome icon inside button vertically
Bootstrap 3 - Align font-awesome icon inside button vertically
I am trying to align some font-awesome arrow vertically inside two
Bootstrap buttons.
Actually both the text and the icons should be vertically aligned in the
middle of the button.
If the text inside falls in a single line or wraps in multiple ones the
arrow icon should always adjust to the middle of the total height of the
button, if that makes sense.
I've been trying to sort this one out for hours now but for the life of me
I can't figure this one out.
Here's the markup:
<div class="container">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<button type="button" class="btn btn-block btn-foo1"><span>
this is <br>button<br>one</span><i
class="icon-angle-right"></i></button>
<button type="button" class="btn btn-block
btn-foo2"><span>this is button two</span><i
class="icon-angle-right"></i></button>
</div>
</div>
and here's a jsFiddle with what I currently have. Please note that the red
background of the icons should touch the edges of the button
(top/bottom/right) as opposed to what it is now.
I am trying to align some font-awesome arrow vertically inside two
Bootstrap buttons.
Actually both the text and the icons should be vertically aligned in the
middle of the button.
If the text inside falls in a single line or wraps in multiple ones the
arrow icon should always adjust to the middle of the total height of the
button, if that makes sense.
I've been trying to sort this one out for hours now but for the life of me
I can't figure this one out.
Here's the markup:
<div class="container">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<button type="button" class="btn btn-block btn-foo1"><span>
this is <br>button<br>one</span><i
class="icon-angle-right"></i></button>
<button type="button" class="btn btn-block
btn-foo2"><span>this is button two</span><i
class="icon-angle-right"></i></button>
</div>
</div>
and here's a jsFiddle with what I currently have. Please note that the red
background of the icons should touch the edges of the button
(top/bottom/right) as opposed to what it is now.
Using jquery mask plugin for cellphone numbers
Using jquery mask plugin for cellphone numbers
I'm designing a form which contains some input elements. One of them is
about cellphone numbers. In my form, first digit should be between 1-9 ,
other digits could be any number. Here is my jQuery code.I need a pattern
in order to make this project work:
$(".not-empty2").mask('Z99-9999999', { translation: { 'O': { pattern:
/*an expression comes here*/, optional: true } } });
I'm designing a form which contains some input elements. One of them is
about cellphone numbers. In my form, first digit should be between 1-9 ,
other digits could be any number. Here is my jQuery code.I need a pattern
in order to make this project work:
$(".not-empty2").mask('Z99-9999999', { translation: { 'O': { pattern:
/*an expression comes here*/, optional: true } } });
JQuery drag and drop position on multiple drop to one droppable area
JQuery drag and drop position on multiple drop to one droppable area
I have created a very simple drag and drop quiz, where the user has a list
of 8 actions that they must drag into the correct drop area (there are 3
drop areas). So I might have 2 or 3 items being dropped onto one droppable
div.
This works fine except the actions are dragged on top of the previous
dropped action, rather than stacking beneath.
I cant seem to find a definitive list of options to use with
ui.draggable.position. This is the code I'm currently using to place the
drop:
ui.draggable.position( { of: $(this), my: 'left top', at: 'left top' } );
But as I said above, they are just placed on top of the previous drop.
Below is the style that is being generated by 2 dragged items onto 1
draggable area:
1st draggable div:
<div id="section1" class="ui-draggable correct ui-draggable-disabled
ui-state-disabled" style="position: relative; z-index: 8; left: 410px;
top: 0px;" aria-disabled="true">Use one measure of soap</div>
2nd draggable div:
<div id="section1" class="ui-draggable correct ui-draggable-disabled
ui-state-disabled" style="position: relative; z-index: 9; left: 410px;
top: -50px;" aria-disabled="true">Rinse thoroughly
(fingers/thumbs/wrists)</div>
Hope that makes sense.
Can anyone shed any light how to get these to stack properly?
Much appreciated Alan
I have created a very simple drag and drop quiz, where the user has a list
of 8 actions that they must drag into the correct drop area (there are 3
drop areas). So I might have 2 or 3 items being dropped onto one droppable
div.
This works fine except the actions are dragged on top of the previous
dropped action, rather than stacking beneath.
I cant seem to find a definitive list of options to use with
ui.draggable.position. This is the code I'm currently using to place the
drop:
ui.draggable.position( { of: $(this), my: 'left top', at: 'left top' } );
But as I said above, they are just placed on top of the previous drop.
Below is the style that is being generated by 2 dragged items onto 1
draggable area:
1st draggable div:
<div id="section1" class="ui-draggable correct ui-draggable-disabled
ui-state-disabled" style="position: relative; z-index: 8; left: 410px;
top: 0px;" aria-disabled="true">Use one measure of soap</div>
2nd draggable div:
<div id="section1" class="ui-draggable correct ui-draggable-disabled
ui-state-disabled" style="position: relative; z-index: 9; left: 410px;
top: -50px;" aria-disabled="true">Rinse thoroughly
(fingers/thumbs/wrists)</div>
Hope that makes sense.
Can anyone shed any light how to get these to stack properly?
Much appreciated Alan
Efficient Ways to Load Large data Sets
Efficient Ways to Load Large data Sets
I am reading a white paper on MapReduce by Google. And I want to know how
to pass GBs of data efficiently to MapReduce algorithm. The paper shows
stats for processing TBs of data in seconds. This paper says that to make
it work effieciently they reduce the network calls and try to make local
writes on local disks. Only the reducer function performs the remote calls
and writes olocal outputfile. Now when we load GBs of data in memory to
pass it to a Map function, the data loader application will would
certainly go out of memory.
So my question is what techniques should be used to load data efficiently
and pass to scheduler applications for M and R schedulings and to
calculate the number of M pieces and R pieces.
I would most probably reading some data from the Oracle database and
update it back in some other tables.
URL to white paper
http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/mapreduce-osdi04.pdf
I am reading a white paper on MapReduce by Google. And I want to know how
to pass GBs of data efficiently to MapReduce algorithm. The paper shows
stats for processing TBs of data in seconds. This paper says that to make
it work effieciently they reduce the network calls and try to make local
writes on local disks. Only the reducer function performs the remote calls
and writes olocal outputfile. Now when we load GBs of data in memory to
pass it to a Map function, the data loader application will would
certainly go out of memory.
So my question is what techniques should be used to load data efficiently
and pass to scheduler applications for M and R schedulings and to
calculate the number of M pieces and R pieces.
I would most probably reading some data from the Oracle database and
update it back in some other tables.
URL to white paper
http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/mapreduce-osdi04.pdf
Sunday, 8 September 2013
Inserting a record in the middle of a set of records in MS Access
Inserting a record in the middle of a set of records in MS Access
Say, I have 10 records in my MS Access file. I need to insert few rows
inside i.e: in the middle of existing records. How to do that? Any
suggestions? Regards
Say, I have 10 records in my MS Access file. I need to insert few rows
inside i.e: in the middle of existing records. How to do that? Any
suggestions? Regards
How to show whether user already liked object instance in Django
How to show whether user already liked object instance in Django
I have the following table in my Django model, Dishes and Likes. On my
home page I am showing a list of all the dishes in the database, and I
have a like button on each dish. For dishes that the user has liked I want
to indicate that they already liked it, so that they can unlike it and
vice versa. I have been trying different approaches for the last few days
but can't seem to figure anything out. Here is the code for my latest
unsuccessful attempt.
#dishes table
class Dishes(models.Model):
name = models.CharField(max_length=40, unique=True)
def liked(dish, user):
try:
user_upvoted = Likes.objects.get(dish=dish, user=user)
except:
user_upvoted = None
if user_upvoted:
return True
else:
return False
#upvotes
class Likes(models.Model):
dish = models.ForeignKey(Dishes)
user = models.ForeignKey(User)
date_added = models.DateTimeField(auto_now_add=True)
def home(request):
this_user = auth.models.User.objects.get(id=1)
dishes = models.Dishes.objects.all()
for dish in dishes:
models.Dishes.voted(dish, this_user)
`enter code here`return render_to_response('frontend/home.html', {
'dishes': dishes, })
I have the following table in my Django model, Dishes and Likes. On my
home page I am showing a list of all the dishes in the database, and I
have a like button on each dish. For dishes that the user has liked I want
to indicate that they already liked it, so that they can unlike it and
vice versa. I have been trying different approaches for the last few days
but can't seem to figure anything out. Here is the code for my latest
unsuccessful attempt.
#dishes table
class Dishes(models.Model):
name = models.CharField(max_length=40, unique=True)
def liked(dish, user):
try:
user_upvoted = Likes.objects.get(dish=dish, user=user)
except:
user_upvoted = None
if user_upvoted:
return True
else:
return False
#upvotes
class Likes(models.Model):
dish = models.ForeignKey(Dishes)
user = models.ForeignKey(User)
date_added = models.DateTimeField(auto_now_add=True)
def home(request):
this_user = auth.models.User.objects.get(id=1)
dishes = models.Dishes.objects.all()
for dish in dishes:
models.Dishes.voted(dish, this_user)
`enter code here`return render_to_response('frontend/home.html', {
'dishes': dishes, })
Include file generate warning
Include file generate warning
I have an INCLUDE file to manage user permissions (include/permission.php)
// PERM
$result = mysql_query("SELECT * FROM mod_permission WHERE
usuer_id=".$_SESSION['user_id']);
$row = mysql_fetch_array($result, MYSQL_BOTH) or die(mysql_error());
$perm_add = $row['perm_add'];
$perm_edit = $row['perm_edit'];
$perm_del = $row['perm_del'];
But when i try to include i have error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean
given in
I'm like to make something this:
File: example.php
<?php
include_once "include/db_conn.php";
include_once "include/permission.php";
if ($perm_add != "1") {
header("Location: $url/dash.php?error=1"); exit;
}
?>
Where do I wrong? Thanks ALL for helping!!!
I have an INCLUDE file to manage user permissions (include/permission.php)
// PERM
$result = mysql_query("SELECT * FROM mod_permission WHERE
usuer_id=".$_SESSION['user_id']);
$row = mysql_fetch_array($result, MYSQL_BOTH) or die(mysql_error());
$perm_add = $row['perm_add'];
$perm_edit = $row['perm_edit'];
$perm_del = $row['perm_del'];
But when i try to include i have error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean
given in
I'm like to make something this:
File: example.php
<?php
include_once "include/db_conn.php";
include_once "include/permission.php";
if ($perm_add != "1") {
header("Location: $url/dash.php?error=1"); exit;
}
?>
Where do I wrong? Thanks ALL for helping!!!
byte[] image is not renderer correctly by HttpServlet
byte[] image is not renderer correctly by HttpServlet
I've got this piece of coding which, when displayed in Firefox or Chrome,
throws an exception (the image cannot be displayed because it contains
errors).
byte[] img2 = { 105, 86, 66, 79, 82, 119, 48, 75, 71, 103,
111, 65, 65, 65, 65, 78, 83, 85, 104, 69, 85, 103,
65, 65, 65, 68, 65, 65, 65, 65, 65, 101, 67, 65, 89, 65, 65,
65, 66, 113, 112, 74, 51, 66, 65, 65, 65,
65, 71, 88, 82, 70, 87, 72, 82, 84, 98, 50, 90, 48, 100, 50,
70, 121, 90, 81, 66, 66, 90, 71, 57, 105,
90, 83, 66, 74, 98, 87, 70, 110, 90, 86, 74, 108, 89, 87, 82,
53, 99, 99, 108, 108, 80, 65, 65, 65, 65,
50, 112, 74, 82, 69, 70, 85, 101, 78, 114, 115, 87, 69, 49,
73, 86, 71, 69, 85, 118, 102, 54, 107, 111,
87, 108, 69, 97, 101, 85, 89, 113, 73, 115, 89, 85, 55, 82,
78, 106, 107, 81, 104, 87, 81, 109, 90,
103, 90, 67, 103, 76, 105, 113, 85, 119, 69, 88, 89, 72, 119,
81, 117, 99, 117, 85, 109, 107, 66, 90,
87, 71, 122, 99, 87, 69, 112, 82, 85, 71, 66, 81, 73, 47, 85,
99, 82, 97, 89, 69, 74, 97, 111, 71, 107,
107, 87, 78, 81, 75, 108, 79, 97, 83, 85, 111, 47, 99, 57, 53,
52, 72, 47, 102, 55, 51, 110, 115, 122,
85, 113, 115, 72, 99, 43, 69, 78, 56, 55, 53, 53, 99, 57, 56,
57, 53, 53, 53, 55, 118, 106, 99, 84,
107, 49, 86, 53, 113, 88, 57, 76, 57, 114, 113, 116, 113, 99,
109, 74, 53, 75, 97, 89, 109, 102, 116,
74, 119, 50, 78, 84, 98, 54, 106, 56, 49, 80, 85, 47, 98, 103,
51, 85, 72, 117, 115, 50, 53, 109, 87,
103, 57, 108, 104, 121, 101, 85, 81, 66, 82, 65, 72, 56, 90,
56, 84, 106, 53, 102, 102, 67, 78, 49,
111, 77, 68, 78, 107, 106, 84, 69, 105, 108, 70, 87, 118, 121,
76, 101, 116, 66, 67, 122, 79, 115, 106,
67, 78, 111, 120, 101, 84, 47, 77, 109, 116, 90, 107, 121, 97,
66, 122, 43, 55, 49, 106, 116, 72, 69,
53, 75, 121, 53, 53, 107, 108, 76, 111, 84, 74, 102, 78, 117,
108, 109, 115, 109, 83, 84, 121, 115, 65,
105, 110, 121, 48, 65, 120, 75, 43, 53, 99, 90, 111, 102, 55,
54, 70, 53, 102, 52, 47, 108, 111, 114,
81, 57, 51, 90, 83, 52, 102, 114, 117, 83, 102, 80, 47, 112,
76, 105, 88, 53, 115, 47, 90, 68, 49, 78,
76, 120, 110, 70, 52, 79, 84, 112, 106, 114, 65, 49, 101, 80,
109, 116, 101, 51, 100, 98, 50, 105, 106,
106, 115, 68, 116, 105, 84, 100, 101, 117, 121, 104, 97, 121,
50, 86, 121, 108, 112, 116, 56, 50, 48,
70, 65, 71, 75, 115, 43, 53, 105, 57, 104, 71, 73, 84, 86,
108, 78, 83, 84, 106, 87, 116, 76, 98, 108,
67, 71, 121, 116, 102, 85, 50, 66, 86, 117, 88, 75, 82, 68,
117, 114, 109, 111, 51, 102, 75, 79, 84,
79, 111, 77, 56, 97, 115, 78, 112, 122, 114, 99, 83, 119, 101,
85, 90, 122, 118, 85, 99, 55, 82, 74,
98, 49, 52, 55, 110, 114, 69, 71, 89, 104, 76, 51, 107, 82,
120, 66, 97, 49, 48, 47, 79, 107, 82, 43,
114, 54, 52, 48, 108, 104, 98, 68, 65, 120, 113, 106, 75, 107,
65, 84, 108, 81, 88, 109, 85, 120, 76,
43, 84, 66, 89, 50, 82, 87, 65, 113, 106, 57, 81, 83, 67, 100,
114, 105, 113, 105, 113, 49, 71, 117,
99, 81, 48, 89, 121, 76, 116, 43, 49, 66, 50, 115, 72, 73, 78,
55, 117, 81, 116, 122, 56, 47, 89, 47,
78, 81, 82, 67, 72, 54, 85, 74, 74, 74, 57, 72, 110, 70, 48,
111, 83, 109, 81, 106, 115, 90, 97, 97,
110, 75, 69, 86, 75, 65, 70, 76, 118, 105, 79, 98, 54, 72, 85,
98, 104, 72, 75, 50, 78, 75, 110, 68,
77, 107, 90, 54, 76, 111, 51, 100, 111, 81, 118, 108, 117, 87,
66, 99, 113, 122, 115, 43, 103, 107, 97,
56, 98, 68, 66, 68, 111, 66, 72, 100, 66, 90, 43, 102, 103,
76, 113, 57, 53, 89, 120, 107, 54, 113,
120, 121, 89, 69, 49, 50, 67, 99, 111, 68, 98, 117, 118, 113,
85, 100, 83, 109, 118, 90, 85, 109, 73,
119, 53, 99, 88, 43, 105, 74, 65, 100, 65, 121, 88, 109, 67,
52, 70, 102, 88, 75, 65, 101, 87, 90, 69,
90, 53, 111, 55, 52, 77, 118, 76, 115, 76, 106, 76, 109, 89,
115, 80, 97, 87, 100, 68, 112, 52, 86,
112, 100, 105, 107, 53, 87, 47, 56, 77, 111, 77, 121, 88, 89,
55, 54, 47, 77, 101, 75, 106, 106, 51,
54, 47, 119, 90, 120, 115, 100, 49, 86, 112, 114, 118, 110,
101, 83, 85, 73, 111, 111, 76, 86, 120,
116, 121, 85, 47, 79, 103, 97, 110, 107, 100, 51, 81, 56, 57,
100, 86, 70, 70, 74, 117, 108, 109, 113,
100, 43, 110, 48, 99, 65, 89, 66, 100, 72, 66, 122, 110, 110,
51, 106, 111, 102, 116, 43, 111, 114, 88,
120, 67, 66, 99, 51, 89, 79, 108, 65, 73, 113, 78, 101, 119,
83, 100, 49, 116, 87, 70, 74, 99, 116, 74,
81, 110, 55, 103, 48, 83, 73, 71, 86, 49, 68, 106, 53, 70, 72,
109, 73, 53, 111, 77, 122, 81, 103, 47,
55, 112, 52, 79, 117, 48, 85, 112, 81, 69, 75, 71, 102, 65,
98, 115, 78, 66, 76, 104, 121, 81, 67, 67,
84, 69, 82, 102, 79, 71, 78, 84, 79, 51, 89, 74, 107, 106,
100, 77, 106, 113, 82, 74, 80, 76, 102, 53,
84, 89, 87, 53, 84, 106, 43, 74, 108, 107, 51, 48, 107, 43,
87, 74, 101, 83, 89, 70, 49, 76, 52, 69,
55, 87, 121, 87, 54, 107, 53, 57, 98, 110, 73, 69, 73, 72, 77,
104, 122, 108, 74, 101, 87, 103, 77, 56,
102, 121, 119, 101, 54, 76, 65, 112, 106, 57, 107, 65, 109,
77, 87, 106, 97, 56, 122, 80, 82, 85, 82,
43, 117, 48, 109, 120, 48, 99, 84, 69, 74, 56, 112, 66, 56,
77, 89, 70, 78, 72, 122, 82, 115, 88, 104,
43, 53, 65, 55, 68, 122, 56, 80, 84, 115, 109, 53, 98, 52,
103, 114, 82, 79, 66, 84, 85, 54, 54, 70,
47, 74, 103, 86, 117, 81, 53, 65, 52, 106, 52, 78, 75, 111,
80, 72, 107, 66, 66, 66, 117, 71, 99, 65,
89, 122, 113, 79, 55, 78, 100, 70, 57, 117, 98, 121, 111, 49,
99, 48, 106, 113, 82, 118, 54, 54, 105,
119, 79, 119, 97, 68, 117, 122, 99, 77, 116, 53, 43, 109, 70,
113, 101, 104, 69, 74, 115, 98, 119, 118,
79, 81, 114, 97, 106, 119, 122, 67, 76, 115, 108, 104, 109,
66, 119, 57, 122, 89, 69, 115, 54, 82, 48,
112, 83, 119, 112, 75, 55, 101, 69, 121, 81, 55, 85, 51, 55,
119, 117, 90, 72, 121, 73, 99, 57, 53,
102, 79, 97, 115, 57, 50, 117, 47, 86, 71, 80, 50, 113, 79,
47, 121, 75, 73, 65, 111, 103, 68, 99, 68,
105, 67, 99, 86, 55, 115, 104, 89, 116, 122, 43, 53, 43, 53,
102, 65, 81, 89, 65, 80, 115, 81, 106,
121, 52, 54, 108, 99, 104, 65, 65, 65, 65, 65, 65, 83, 85, 86,
79, 82, 75, 53, 67, 89, 73, 73, 61 };
response.setContentType("image/jpeg");
response.setContentLength(img2.length);
response.getOutputStream().write(img2, 0, img2.length);
response.getOutputStream().close();
If I embed the same piece in an HTML it all works okay. Can anybody tell
me why?
<img
src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAeCAYAAABqpJ3BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2pJREFUeNrsWE1IVGEUvf6koWlEaeUYqIsYU7RNjkQhWQmZgZCgLiqUwEXYHwQucuUmkBZWGzcWEpRUGBQI/UcRaYEJaoGkkWNQKlOaSUo/c954H/f73nszUqsHc+EN8755c9895557vjcTk1V5qX9L9rqtqcmJ5KaYmftJw2NTb6j81PU/bg3UHus25mWg9lhyeUQBRAH8Z8Tj5ffCN1oMDNkjTEilFWvyLetBCzOsjCNoxeT/MmtZkyaBz+71jtHE5Ky55klLoTJfNulmsmSTysAiny0AxK+5cZof76F5f4/lorQ93ZS4fruSfP/pLiX5s/ZD1NLxnF4OTpjrA1ePmte3db2ijjsDtiTdeuyhay2Vylpt820FAGKs+5i9hGITVlNSTjWtLblCGytfU2BVuXKRDurmo3fKOTOoM8asNpzrcSweUZzvUc7RJb147nrEGYhL3kRxBa10/OkR+r640lhbDAxqjKkATlQXmUxL+TBY2RWAqj9QSCdriqiq1GucQ0YyLt+1B2sHIN7uQtz8/Y/NQRCH6UJJJ9HnF0oSmQjsZaanKEVKAFLviOb6HUbhHK2NKnDMkZ6Lo3doQvluWBcqzs+gka8bDBDoBHdBZ+fgLq95Yxk6qxyYE12CcoDbuvqUdSmvZUmIw5cX+iJAdAyXmC4FfXKAeWZEZ5o74MvLsLjLmYsPaWdDp4Vpdik5W/8MoMyXY76/MeKjj36/wZxsd1VprvneSUIooLVxtyU/Ogankd3Q89dVFFJulmqd+n0cAYBdHBznn3joft+orXxCBc3YOlAIqNewSd1tWFJctJQn7g0SIGV1Dj5FHmI5oMzQg/7p4Ou0UpQEKGfAbsNBLhyQCC
TERfOGNTO3YJkjdMjqRJPLf5TYW5Tj+Jlk30k+WJeSYF1L4E7WyW6k59bnIEIHMhzlJeWgM8fywe6LApj9kAmMWja8zPRUR+u0mx0cTEJ8pB8MYFNHzRsXh+5A7Dz8PTsm5b4grROBTU66F/JgVuQ5A4j4NKoPHkBBBuGcAYzqO7NdF9ubyo1c0jqRv66iwOwaDuzcMt5+mFqehEJsbwvOQrajwzCLslhmBw9zYEs6R0pSwpK7eEyQ7U37wuZHyIc95fOas92u/VGP2qO/yKIAogDcDiCcV7shYtz+5+5fAQYAPsQjy46lchAAAAAASUVORK5CYII="/>
I've got this piece of coding which, when displayed in Firefox or Chrome,
throws an exception (the image cannot be displayed because it contains
errors).
byte[] img2 = { 105, 86, 66, 79, 82, 119, 48, 75, 71, 103,
111, 65, 65, 65, 65, 78, 83, 85, 104, 69, 85, 103,
65, 65, 65, 68, 65, 65, 65, 65, 65, 101, 67, 65, 89, 65, 65,
65, 66, 113, 112, 74, 51, 66, 65, 65, 65,
65, 71, 88, 82, 70, 87, 72, 82, 84, 98, 50, 90, 48, 100, 50,
70, 121, 90, 81, 66, 66, 90, 71, 57, 105,
90, 83, 66, 74, 98, 87, 70, 110, 90, 86, 74, 108, 89, 87, 82,
53, 99, 99, 108, 108, 80, 65, 65, 65, 65,
50, 112, 74, 82, 69, 70, 85, 101, 78, 114, 115, 87, 69, 49,
73, 86, 71, 69, 85, 118, 102, 54, 107, 111,
87, 108, 69, 97, 101, 85, 89, 113, 73, 115, 89, 85, 55, 82,
78, 106, 107, 81, 104, 87, 81, 109, 90,
103, 90, 67, 103, 76, 105, 113, 85, 119, 69, 88, 89, 72, 119,
81, 117, 99, 117, 85, 109, 107, 66, 90,
87, 71, 122, 99, 87, 69, 112, 82, 85, 71, 66, 81, 73, 47, 85,
99, 82, 97, 89, 69, 74, 97, 111, 71, 107,
107, 87, 78, 81, 75, 108, 79, 97, 83, 85, 111, 47, 99, 57, 53,
52, 72, 47, 102, 55, 51, 110, 115, 122,
85, 113, 115, 72, 99, 43, 69, 78, 56, 55, 53, 53, 99, 57, 56,
57, 53, 53, 53, 55, 118, 106, 99, 84,
107, 49, 86, 53, 113, 88, 57, 76, 57, 114, 113, 116, 113, 99,
109, 74, 53, 75, 97, 89, 109, 102, 116,
74, 119, 50, 78, 84, 98, 54, 106, 56, 49, 80, 85, 47, 98, 103,
51, 85, 72, 117, 115, 50, 53, 109, 87,
103, 57, 108, 104, 121, 101, 85, 81, 66, 82, 65, 72, 56, 90,
56, 84, 106, 53, 102, 102, 67, 78, 49,
111, 77, 68, 78, 107, 106, 84, 69, 105, 108, 70, 87, 118, 121,
76, 101, 116, 66, 67, 122, 79, 115, 106,
67, 78, 111, 120, 101, 84, 47, 77, 109, 116, 90, 107, 121, 97,
66, 122, 43, 55, 49, 106, 116, 72, 69,
53, 75, 121, 53, 53, 107, 108, 76, 111, 84, 74, 102, 78, 117,
108, 109, 115, 109, 83, 84, 121, 115, 65,
105, 110, 121, 48, 65, 120, 75, 43, 53, 99, 90, 111, 102, 55,
54, 70, 53, 102, 52, 47, 108, 111, 114,
81, 57, 51, 90, 83, 52, 102, 114, 117, 83, 102, 80, 47, 112,
76, 105, 88, 53, 115, 47, 90, 68, 49, 78,
76, 120, 110, 70, 52, 79, 84, 112, 106, 114, 65, 49, 101, 80,
109, 116, 101, 51, 100, 98, 50, 105, 106,
106, 115, 68, 116, 105, 84, 100, 101, 117, 121, 104, 97, 121,
50, 86, 121, 108, 112, 116, 56, 50, 48,
70, 65, 71, 75, 115, 43, 53, 105, 57, 104, 71, 73, 84, 86,
108, 78, 83, 84, 106, 87, 116, 76, 98, 108,
67, 71, 121, 116, 102, 85, 50, 66, 86, 117, 88, 75, 82, 68,
117, 114, 109, 111, 51, 102, 75, 79, 84,
79, 111, 77, 56, 97, 115, 78, 112, 122, 114, 99, 83, 119, 101,
85, 90, 122, 118, 85, 99, 55, 82, 74,
98, 49, 52, 55, 110, 114, 69, 71, 89, 104, 76, 51, 107, 82,
120, 66, 97, 49, 48, 47, 79, 107, 82, 43,
114, 54, 52, 48, 108, 104, 98, 68, 65, 120, 113, 106, 75, 107,
65, 84, 108, 81, 88, 109, 85, 120, 76,
43, 84, 66, 89, 50, 82, 87, 65, 113, 106, 57, 81, 83, 67, 100,
114, 105, 113, 105, 113, 49, 71, 117,
99, 81, 48, 89, 121, 76, 116, 43, 49, 66, 50, 115, 72, 73, 78,
55, 117, 81, 116, 122, 56, 47, 89, 47,
78, 81, 82, 67, 72, 54, 85, 74, 74, 74, 57, 72, 110, 70, 48,
111, 83, 109, 81, 106, 115, 90, 97, 97,
110, 75, 69, 86, 75, 65, 70, 76, 118, 105, 79, 98, 54, 72, 85,
98, 104, 72, 75, 50, 78, 75, 110, 68,
77, 107, 90, 54, 76, 111, 51, 100, 111, 81, 118, 108, 117, 87,
66, 99, 113, 122, 115, 43, 103, 107, 97,
56, 98, 68, 66, 68, 111, 66, 72, 100, 66, 90, 43, 102, 103,
76, 113, 57, 53, 89, 120, 107, 54, 113,
120, 121, 89, 69, 49, 50, 67, 99, 111, 68, 98, 117, 118, 113,
85, 100, 83, 109, 118, 90, 85, 109, 73,
119, 53, 99, 88, 43, 105, 74, 65, 100, 65, 121, 88, 109, 67,
52, 70, 102, 88, 75, 65, 101, 87, 90, 69,
90, 53, 111, 55, 52, 77, 118, 76, 115, 76, 106, 76, 109, 89,
115, 80, 97, 87, 100, 68, 112, 52, 86,
112, 100, 105, 107, 53, 87, 47, 56, 77, 111, 77, 121, 88, 89,
55, 54, 47, 77, 101, 75, 106, 106, 51,
54, 47, 119, 90, 120, 115, 100, 49, 86, 112, 114, 118, 110,
101, 83, 85, 73, 111, 111, 76, 86, 120,
116, 121, 85, 47, 79, 103, 97, 110, 107, 100, 51, 81, 56, 57,
100, 86, 70, 70, 74, 117, 108, 109, 113,
100, 43, 110, 48, 99, 65, 89, 66, 100, 72, 66, 122, 110, 110,
51, 106, 111, 102, 116, 43, 111, 114, 88,
120, 67, 66, 99, 51, 89, 79, 108, 65, 73, 113, 78, 101, 119,
83, 100, 49, 116, 87, 70, 74, 99, 116, 74,
81, 110, 55, 103, 48, 83, 73, 71, 86, 49, 68, 106, 53, 70, 72,
109, 73, 53, 111, 77, 122, 81, 103, 47,
55, 112, 52, 79, 117, 48, 85, 112, 81, 69, 75, 71, 102, 65,
98, 115, 78, 66, 76, 104, 121, 81, 67, 67,
84, 69, 82, 102, 79, 71, 78, 84, 79, 51, 89, 74, 107, 106,
100, 77, 106, 113, 82, 74, 80, 76, 102, 53,
84, 89, 87, 53, 84, 106, 43, 74, 108, 107, 51, 48, 107, 43,
87, 74, 101, 83, 89, 70, 49, 76, 52, 69,
55, 87, 121, 87, 54, 107, 53, 57, 98, 110, 73, 69, 73, 72, 77,
104, 122, 108, 74, 101, 87, 103, 77, 56,
102, 121, 119, 101, 54, 76, 65, 112, 106, 57, 107, 65, 109,
77, 87, 106, 97, 56, 122, 80, 82, 85, 82,
43, 117, 48, 109, 120, 48, 99, 84, 69, 74, 56, 112, 66, 56,
77, 89, 70, 78, 72, 122, 82, 115, 88, 104,
43, 53, 65, 55, 68, 122, 56, 80, 84, 115, 109, 53, 98, 52,
103, 114, 82, 79, 66, 84, 85, 54, 54, 70,
47, 74, 103, 86, 117, 81, 53, 65, 52, 106, 52, 78, 75, 111,
80, 72, 107, 66, 66, 66, 117, 71, 99, 65,
89, 122, 113, 79, 55, 78, 100, 70, 57, 117, 98, 121, 111, 49,
99, 48, 106, 113, 82, 118, 54, 54, 105,
119, 79, 119, 97, 68, 117, 122, 99, 77, 116, 53, 43, 109, 70,
113, 101, 104, 69, 74, 115, 98, 119, 118,
79, 81, 114, 97, 106, 119, 122, 67, 76, 115, 108, 104, 109,
66, 119, 57, 122, 89, 69, 115, 54, 82, 48,
112, 83, 119, 112, 75, 55, 101, 69, 121, 81, 55, 85, 51, 55,
119, 117, 90, 72, 121, 73, 99, 57, 53,
102, 79, 97, 115, 57, 50, 117, 47, 86, 71, 80, 50, 113, 79,
47, 121, 75, 73, 65, 111, 103, 68, 99, 68,
105, 67, 99, 86, 55, 115, 104, 89, 116, 122, 43, 53, 43, 53,
102, 65, 81, 89, 65, 80, 115, 81, 106,
121, 52, 54, 108, 99, 104, 65, 65, 65, 65, 65, 65, 83, 85, 86,
79, 82, 75, 53, 67, 89, 73, 73, 61 };
response.setContentType("image/jpeg");
response.setContentLength(img2.length);
response.getOutputStream().write(img2, 0, img2.length);
response.getOutputStream().close();
If I embed the same piece in an HTML it all works okay. Can anybody tell
me why?
<img
src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAeCAYAAABqpJ3BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2pJREFUeNrsWE1IVGEUvf6koWlEaeUYqIsYU7RNjkQhWQmZgZCgLiqUwEXYHwQucuUmkBZWGzcWEpRUGBQI/UcRaYEJaoGkkWNQKlOaSUo/c954H/f73nszUqsHc+EN8755c9895557vjcTk1V5qX9L9rqtqcmJ5KaYmftJw2NTb6j81PU/bg3UHus25mWg9lhyeUQBRAH8Z8Tj5ffCN1oMDNkjTEilFWvyLetBCzOsjCNoxeT/MmtZkyaBz+71jtHE5Ky55klLoTJfNulmsmSTysAiny0AxK+5cZof76F5f4/lorQ93ZS4fruSfP/pLiX5s/ZD1NLxnF4OTpjrA1ePmte3db2ijjsDtiTdeuyhay2Vylpt820FAGKs+5i9hGITVlNSTjWtLblCGytfU2BVuXKRDurmo3fKOTOoM8asNpzrcSweUZzvUc7RJb147nrEGYhL3kRxBa10/OkR+r640lhbDAxqjKkATlQXmUxL+TBY2RWAqj9QSCdriqiq1GucQ0YyLt+1B2sHIN7uQtz8/Y/NQRCH6UJJJ9HnF0oSmQjsZaanKEVKAFLviOb6HUbhHK2NKnDMkZ6Lo3doQvluWBcqzs+gka8bDBDoBHdBZ+fgLq95Yxk6qxyYE12CcoDbuvqUdSmvZUmIw5cX+iJAdAyXmC4FfXKAeWZEZ5o74MvLsLjLmYsPaWdDp4Vpdik5W/8MoMyXY76/MeKjj36/wZxsd1VprvneSUIooLVxtyU/Ogankd3Q89dVFFJulmqd+n0cAYBdHBznn3joft+orXxCBc3YOlAIqNewSd1tWFJctJQn7g0SIGV1Dj5FHmI5oMzQg/7p4Ou0UpQEKGfAbsNBLhyQCC
TERfOGNTO3YJkjdMjqRJPLf5TYW5Tj+Jlk30k+WJeSYF1L4E7WyW6k59bnIEIHMhzlJeWgM8fywe6LApj9kAmMWja8zPRUR+u0mx0cTEJ8pB8MYFNHzRsXh+5A7Dz8PTsm5b4grROBTU66F/JgVuQ5A4j4NKoPHkBBBuGcAYzqO7NdF9ubyo1c0jqRv66iwOwaDuzcMt5+mFqehEJsbwvOQrajwzCLslhmBw9zYEs6R0pSwpK7eEyQ7U37wuZHyIc95fOas92u/VGP2qO/yKIAogDcDiCcV7shYtz+5+5fAQYAPsQjy46lchAAAAAASUVORK5CYII="/>
Subscribe to:
Comments (Atom)