Multiple Inheritance in C
I am stuck with a classical Multiple Inheritance problem in C.
I have created source files Stack.c and Queue.c. Both of them #include a
file Node.c (which containing functions to allocate and deallocate
memory). Now, I am trying to implement another program in a single file,
for which I need to include both Stack.c and Queue.c. I tried to #include
both the files, but the compiler is throwing a conflicting type error.
What is the most correct way to do so?
Thanks in advance!!
Saturday, 31 August 2013
Mysql subquery sum of votes
Mysql subquery sum of votes
I've got a table of votes, alongside a table of 'ideas' (entries)
Basically, I want to retrieve an object that can be read as:
id,
name,
title,
votes : {
up : x,
down : y
}
So it's simple enough until I get to the subquery and need to do two sets
of SUMs on the positive and negative values of votes.
SELECT id,name,title FROM ideas
LEFT JOIN votes ON ideas.id = votes.idea_id
My (simplified) votes table looks something like:
id
idea_id
value
Where value can be either a positive or negative int.
How would I go about getting the above object in a single query?
Bonus point: How would I also get an aggregate field, where positive and
negative votes are added together?
I've got a table of votes, alongside a table of 'ideas' (entries)
Basically, I want to retrieve an object that can be read as:
id,
name,
title,
votes : {
up : x,
down : y
}
So it's simple enough until I get to the subquery and need to do two sets
of SUMs on the positive and negative values of votes.
SELECT id,name,title FROM ideas
LEFT JOIN votes ON ideas.id = votes.idea_id
My (simplified) votes table looks something like:
id
idea_id
value
Where value can be either a positive or negative int.
How would I go about getting the above object in a single query?
Bonus point: How would I also get an aggregate field, where positive and
negative votes are added together?
Multiple drop down windows that auto-close when opening another
Multiple drop down windows that auto-close when opening another
I have an example of what I'm working on here at JSFiddle
http://jsfiddle.net/OfSilence/zFuUp/. I'm trying to find a way to make the
drop-down that's opened auto close when opening another. All the solutions
I find either keep anything from opening or opening & closing everything
at the same time. Keep in mind on the final page their will be around 30
of these drop-downs. Any help would be greatly appreciated! JSFiddle
I have an example of what I'm working on here at JSFiddle
http://jsfiddle.net/OfSilence/zFuUp/. I'm trying to find a way to make the
drop-down that's opened auto close when opening another. All the solutions
I find either keep anything from opening or opening & closing everything
at the same time. Keep in mind on the final page their will be around 30
of these drop-downs. Any help would be greatly appreciated! JSFiddle
How to return IEnumerable instead of string with conditions in foreach?
How to return IEnumerable instead of string with conditions in foreach?
What approach do I have to make, to make something like the method below
to work for IEnumerable<Flight> instead of string? I want to manipulate my
IEnumerable source(in parameter) with conditions written in method, and
return IEnumerable based on those conditions only.
public string FilterFlights(IEnumerable<Flight> flights)
{
string s = "";
foreach (var flight in flights)
{
var indexItem = 0;
DateTime previousArrivalDateTime = new DateTime();
TimeSpan timeSpan;
int time = 0;
foreach (var segments in flight.Segments)
{
if (indexItem == 0)
{
previousArrivalDateTime = segments.ArrivalDate;
s = s + "Departure: " + segments.DepartureDate + ",
Arrival: " + segments.ArrivalDate + "; ";
}
if (indexItem > 0)
{
timeSpan = segments.DepartureDate - previousArrivalDateTime;
time += timeSpan.Hours;
s = s + "Departure: " + segments.DepartureDate + ",
Arrival: " + segments.ArrivalDate + "; ";
previousArrivalDateTime = segments.ArrivalDate;
}
indexItem++;
}
if (time > 2)
Console.WriteLine(s);
}
return s;
}
Thank you!
What approach do I have to make, to make something like the method below
to work for IEnumerable<Flight> instead of string? I want to manipulate my
IEnumerable source(in parameter) with conditions written in method, and
return IEnumerable based on those conditions only.
public string FilterFlights(IEnumerable<Flight> flights)
{
string s = "";
foreach (var flight in flights)
{
var indexItem = 0;
DateTime previousArrivalDateTime = new DateTime();
TimeSpan timeSpan;
int time = 0;
foreach (var segments in flight.Segments)
{
if (indexItem == 0)
{
previousArrivalDateTime = segments.ArrivalDate;
s = s + "Departure: " + segments.DepartureDate + ",
Arrival: " + segments.ArrivalDate + "; ";
}
if (indexItem > 0)
{
timeSpan = segments.DepartureDate - previousArrivalDateTime;
time += timeSpan.Hours;
s = s + "Departure: " + segments.DepartureDate + ",
Arrival: " + segments.ArrivalDate + "; ";
previousArrivalDateTime = segments.ArrivalDate;
}
indexItem++;
}
if (time > 2)
Console.WriteLine(s);
}
return s;
}
Thank you!
Javascript pass parameter to eventListener function whilst in loop
Javascript pass parameter to eventListener function whilst in loop
This code will pass the last value created by the loop the eventListener
function, I need the value at the time the eventListener was created to be
attached.
window.onload = function() {
var el = document.getElementsByClassName('modify');
for (var i = 0; i < el.length; i++) {
var getId=el[i].id.split("_");
document.getElementById("modify_y_"+getId[2]).addEventListener('mouseover',
function() {
document.getElementById("modify_x_"+getId[2]).style.borderBottom =
'#e6665 solid 3px';
}, false);
}
}
This code will pass the last value created by the loop the eventListener
function, I need the value at the time the eventListener was created to be
attached.
window.onload = function() {
var el = document.getElementsByClassName('modify');
for (var i = 0; i < el.length; i++) {
var getId=el[i].id.split("_");
document.getElementById("modify_y_"+getId[2]).addEventListener('mouseover',
function() {
document.getElementById("modify_x_"+getId[2]).style.borderBottom =
'#e6665 solid 3px';
}, false);
}
}
Code igniter routes making internal server error
Code igniter routes making internal server error
Been stuck on this for hours, hope it is not something to simple.
So I'm trying to route 3 vars from one URL to another with this code:
$route['activate_email/(:any)/(:any)/(:any)'] = "user/activate/$1/$2/$3";
and the user controller code:
public function activate($code='', $email='', $id=''){
die("1");
//Check vars
if(empty($code) || empty($email) || empty($id) ||
!is_numeric(ceil($id))){
die("BAD");
}
//Check details in DB
$result = $this->db->query("SELECT * FROM `companies` WHERE `id` = ?",
array($id))->result_array();
print_r($result);
exit;
}
Thanks for any help
Been stuck on this for hours, hope it is not something to simple.
So I'm trying to route 3 vars from one URL to another with this code:
$route['activate_email/(:any)/(:any)/(:any)'] = "user/activate/$1/$2/$3";
and the user controller code:
public function activate($code='', $email='', $id=''){
die("1");
//Check vars
if(empty($code) || empty($email) || empty($id) ||
!is_numeric(ceil($id))){
die("BAD");
}
//Check details in DB
$result = $this->db->query("SELECT * FROM `companies` WHERE `id` = ?",
array($id))->result_array();
print_r($result);
exit;
}
Thanks for any help
Java Servlet - 404 errors
Java Servlet - 404 errors
My system has Tomcat seven and all the files are under webapps. So, here
are my mvc :
Web.xml :
<servlet>
<servlet-name>NouvelleAnnonce</servlet-name>
<servlet-class>com.forum.servlets.NouvelleAnnonce</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>NouvelleAnnonce</servlet-name>
<url-pattern>/nouvelleannonce</url-pattern>
</servlet-mapping>
com.forum.servlets.NouvelleAnnonce.java
package com.forum.servlets;
import java.io.IOException; import java.util.ArrayList; import
java.util.List;
import javax.servlet.ServletException; import
javax.servlet.http.HttpServlet; import
javax.servlet.http.HttpServletRequest; import
javax.servlet.http.HttpServletResponse; import
javax.servlet.http.HttpSession;
import com.forum.beans.Utilisateur; import com.forum.dao.AnnonceDAO;
import com.forum.form.TopicForm;
public class NouvelleAnnonce extends HttpServlet { public static final
String VUE = "/WEB-INF/nouvelleannonce.jsp"; public static final String
BAN = "/WEB-INF/banni.jsp"; public static final String ATT_USER =
"utilisateur"; public static final String ATT_FORM = "formnouvelle";
public static final String CMPT_J = "j";
public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException { HttpSession session =
request.getSession(); Utilisateur utilisateur = (Utilisateur) session
.getAttribute("utilisateur");
if (utilisateur.getNiveauuser() != 0)
this.getServletContext().getRequestDispatcher(VUE)
.forward(request, response); else
this.getServletContext().getRequestDispatcher(BAN)
.forward(request, response); }
public void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException { HttpSession session =
request.getSession(); Utilisateur utilisateur = (Utilisateur) session
.getAttribute("utilisateur");
AnnonceDAO<com.forum.beans.Annonce, Integer> td = new
AnnonceDAO(); TopicForm form = new TopicForm(); com.forum.beans.Annonce t
= form.creerAnnonce(request); List tl = utilisateur.getAnnonceList();
request.setAttribute(ATT_FORM, form);
try { if (utilisateur.getAnnonceList() == null)
tl = new ArrayList<com.forum.beans.Annonce>(); else
tl = utilisateur.getAnnonceList(); } catch (Exception e) {
System.out.println(e); }
if (form.getErreurs().isEmpty()) { t.setTcreateur(utilisateur);
t.setDernPostuleur(utilisateur.getNom()); tl.add(t);
utilisateur.setAnnonceList(tl); td.save(t);
session.setAttribute(CMPT_J, 1);
session.setAttribute(ATT_FORM,
form); response.sendRedirect("/projetForum/forum?num=1"); } else {
session.setAttribute(ATT_USER, utilisateur);
this.getServletContext().getRequestDispatcher(VUE) .forward(request,
response); } } }
Error page : http://nsa34.casimages.com/img/2013/08/31/130831023723838934.jpg
My system has Tomcat seven and all the files are under webapps. So, here
are my mvc :
Web.xml :
<servlet>
<servlet-name>NouvelleAnnonce</servlet-name>
<servlet-class>com.forum.servlets.NouvelleAnnonce</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>NouvelleAnnonce</servlet-name>
<url-pattern>/nouvelleannonce</url-pattern>
</servlet-mapping>
com.forum.servlets.NouvelleAnnonce.java
package com.forum.servlets;
import java.io.IOException; import java.util.ArrayList; import
java.util.List;
import javax.servlet.ServletException; import
javax.servlet.http.HttpServlet; import
javax.servlet.http.HttpServletRequest; import
javax.servlet.http.HttpServletResponse; import
javax.servlet.http.HttpSession;
import com.forum.beans.Utilisateur; import com.forum.dao.AnnonceDAO;
import com.forum.form.TopicForm;
public class NouvelleAnnonce extends HttpServlet { public static final
String VUE = "/WEB-INF/nouvelleannonce.jsp"; public static final String
BAN = "/WEB-INF/banni.jsp"; public static final String ATT_USER =
"utilisateur"; public static final String ATT_FORM = "formnouvelle";
public static final String CMPT_J = "j";
public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException { HttpSession session =
request.getSession(); Utilisateur utilisateur = (Utilisateur) session
.getAttribute("utilisateur");
if (utilisateur.getNiveauuser() != 0)
this.getServletContext().getRequestDispatcher(VUE)
.forward(request, response); else
this.getServletContext().getRequestDispatcher(BAN)
.forward(request, response); }
public void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException { HttpSession session =
request.getSession(); Utilisateur utilisateur = (Utilisateur) session
.getAttribute("utilisateur");
AnnonceDAO<com.forum.beans.Annonce, Integer> td = new
AnnonceDAO(); TopicForm form = new TopicForm(); com.forum.beans.Annonce t
= form.creerAnnonce(request); List tl = utilisateur.getAnnonceList();
request.setAttribute(ATT_FORM, form);
try { if (utilisateur.getAnnonceList() == null)
tl = new ArrayList<com.forum.beans.Annonce>(); else
tl = utilisateur.getAnnonceList(); } catch (Exception e) {
System.out.println(e); }
if (form.getErreurs().isEmpty()) { t.setTcreateur(utilisateur);
t.setDernPostuleur(utilisateur.getNom()); tl.add(t);
utilisateur.setAnnonceList(tl); td.save(t);
session.setAttribute(CMPT_J, 1);
session.setAttribute(ATT_FORM,
form); response.sendRedirect("/projetForum/forum?num=1"); } else {
session.setAttribute(ATT_USER, utilisateur);
this.getServletContext().getRequestDispatcher(VUE) .forward(request,
response); } } }
Error page : http://nsa34.casimages.com/img/2013/08/31/130831023723838934.jpg
XDocument lost Declaration after update
XDocument lost Declaration after update
Here my code, after edit node in that xdoc, i call method save to save it
but the xdoc has lost it's first line declaration. I already set
xdoc.Declaration but it didn't work. Anyone have solution for this case ?
Thanks so much :)
using (Stream stream = storage.OpenFile("APPSDATA.xml", FileMode.Open,
FileAccess.ReadWrite))
{
//var xdoc = XDocument.Load("APPSDATA.xml");
var xdoc = XDocument.Load(stream, LoadOptions.None);
var listnode = from c in xdoc.Descendants("Ungdung")
select c;
var xElements = listnode as IList<XElement> ??
listnode.ToList();
for (int i = 0; i < xElements.Count; i++)
{
progressIndicator.Text = "Checking " +
xElements[i].Element("Name").Value + "...";
var element = xElements[i].Element("Id");
if (element != null)
{
var appId = element.Value;
var appVersion = await GetAppsVersion(appId);
xElements[i].SetElementValue("Version",
appVersion.ToString());
}
if (i != xElements.Count - 1) continue;
xdoc.Declaration = new XDeclaration("1.0",
"utf-8", "yes");
xdoc.Save(stream);
}
}
Here my code, after edit node in that xdoc, i call method save to save it
but the xdoc has lost it's first line declaration. I already set
xdoc.Declaration but it didn't work. Anyone have solution for this case ?
Thanks so much :)
using (Stream stream = storage.OpenFile("APPSDATA.xml", FileMode.Open,
FileAccess.ReadWrite))
{
//var xdoc = XDocument.Load("APPSDATA.xml");
var xdoc = XDocument.Load(stream, LoadOptions.None);
var listnode = from c in xdoc.Descendants("Ungdung")
select c;
var xElements = listnode as IList<XElement> ??
listnode.ToList();
for (int i = 0; i < xElements.Count; i++)
{
progressIndicator.Text = "Checking " +
xElements[i].Element("Name").Value + "...";
var element = xElements[i].Element("Id");
if (element != null)
{
var appId = element.Value;
var appVersion = await GetAppsVersion(appId);
xElements[i].SetElementValue("Version",
appVersion.ToString());
}
if (i != xElements.Count - 1) continue;
xdoc.Declaration = new XDeclaration("1.0",
"utf-8", "yes");
xdoc.Save(stream);
}
}
Friday, 30 August 2013
How to get a mean array with numpy
How to get a mean array with numpy
I have a 4-D(d0,d1,d2,d3,d4) numpy array. I want to get a 2-D(d0,d1)mean
array, Now my solution is as following:
area=d3*d4
mean = numpy.sum(numpy.sum(data, axis=3), axis=2) / area
But How can I use numpy.mean to get the mean array.
I have a 4-D(d0,d1,d2,d3,d4) numpy array. I want to get a 2-D(d0,d1)mean
array, Now my solution is as following:
area=d3*d4
mean = numpy.sum(numpy.sum(data, axis=3), axis=2) / area
But How can I use numpy.mean to get the mean array.
Thursday, 29 August 2013
WCF service fails to call another WCF service on same machine
WCF service fails to call another WCF service on same machine
I have a website hosted in IIS7 in server A. The website calls a web
service that is also hosted in server A, but the call returns an error
401. I tried referencing to the web service by IP address, host
(A.domain.com), and fully qualified dsn. None worked.
After some research, I found out about the loopback check, and the
BackConnectionHostNames.
Refer to this article
Disabling the loopback check fixes the problem, but is not a desirable
solution.
For the BackConnectionHostNames, I tried adding:
A
A.domain.com
A.full.domain.com
But it didn't work.
I played some with IIS http bindings for the website, I tried adding
A.domain.com to the host name, and I also tried setting the IP, but still
got the same error.
Am I missing something? (I clearly am...) Where else should I be looking at?
Any help appreciated. Thanks
I have a website hosted in IIS7 in server A. The website calls a web
service that is also hosted in server A, but the call returns an error
401. I tried referencing to the web service by IP address, host
(A.domain.com), and fully qualified dsn. None worked.
After some research, I found out about the loopback check, and the
BackConnectionHostNames.
Refer to this article
Disabling the loopback check fixes the problem, but is not a desirable
solution.
For the BackConnectionHostNames, I tried adding:
A
A.domain.com
A.full.domain.com
But it didn't work.
I played some with IIS http bindings for the website, I tried adding
A.domain.com to the host name, and I also tried setting the IP, but still
got the same error.
Am I missing something? (I clearly am...) Where else should I be looking at?
Any help appreciated. Thanks
Render image with anti alias or down-sample?
Render image with anti alias or down-sample?
I have DXF file. I want to create raster images (mipmaps?).
The most detailed image will be rendered with Anti-aliasing.
Question : From quality point of view, will down-sampled version have the
same quality as rendered w/ AA with w/2, h/2 ?
I have DXF file. I want to create raster images (mipmaps?).
The most detailed image will be rendered with Anti-aliasing.
Question : From quality point of view, will down-sampled version have the
same quality as rendered w/ AA with w/2, h/2 ?
Design pattern to pass data back from winform to parent program one-way
Design pattern to pass data back from winform to parent program one-way
I am refactoring another programmer's existing relativley complex VBA
project (i.e. "classic VB") and I would like to make it as robust and easy
to manage for future revisions. I am relativley new to design patterns,
but want to include some to help structure the code.
The program features a "start-up" dialog with configuration options (e.g.
radio buttons, checkboxes etc.) and a "Go" button and then does some
processing based on the selections made.
I would like to be able to design the code in such a way that when the
"Go" button is clicked it passes the configuration options back to the
program through a class interface such that I can change the look of the
dialog (e.g. add more checkboxes etc.) but not have to change the
interface. Even better would be to be able pass back an object/class
instance through the interface.
I have had a look around, and am not sure of a pattern that could be used
for this (maybe proxy?). I did have a look at MVC, but it seems a bit of
overkill for one form that is "one-directional" in that I don't need to
update the form after the button is clicked.
Does anyone have any ideas on ways that they would go about it?
I am refactoring another programmer's existing relativley complex VBA
project (i.e. "classic VB") and I would like to make it as robust and easy
to manage for future revisions. I am relativley new to design patterns,
but want to include some to help structure the code.
The program features a "start-up" dialog with configuration options (e.g.
radio buttons, checkboxes etc.) and a "Go" button and then does some
processing based on the selections made.
I would like to be able to design the code in such a way that when the
"Go" button is clicked it passes the configuration options back to the
program through a class interface such that I can change the look of the
dialog (e.g. add more checkboxes etc.) but not have to change the
interface. Even better would be to be able pass back an object/class
instance through the interface.
I have had a look around, and am not sure of a pattern that could be used
for this (maybe proxy?). I did have a look at MVC, but it seems a bit of
overkill for one form that is "one-directional" in that I don't need to
update the form after the button is clicked.
Does anyone have any ideas on ways that they would go about it?
Wednesday, 28 August 2013
Anyone know of this website: [on hold]
Anyone know of this website: [on hold]
started using it, curious to know what you think... is it really free? can
you download anything from there? i am looking for an all in one website -
just to download mind free.. so if anyone has experience with it I'd love
to hear about it.
started using it, curious to know what you think... is it really free? can
you download anything from there? i am looking for an all in one website -
just to download mind free.. so if anyone has experience with it I'd love
to hear about it.
Allow only VPN traffic with GUFW not working
Allow only VPN traffic with GUFW not working
Running Kubuntu 13.04
I have read this tutorial about only allowing torrent traffic with GUFW
but it seems this is not working for the browser. My torrent application
is working but I cant browse any website as soon as I switch outgoing to
Reject. Why is the rule not working, do I need to change the anywhere to
my local lan ip address or something? I am not sure if my torrent download
+ upload work but my browser wont connect to site, I can only connect to
my localhost server.
The censored is my current internet IP i got from my VPN Provider
eingehend = Incoming irgendwo = anywhere
Running Kubuntu 13.04
I have read this tutorial about only allowing torrent traffic with GUFW
but it seems this is not working for the browser. My torrent application
is working but I cant browse any website as soon as I switch outgoing to
Reject. Why is the rule not working, do I need to change the anywhere to
my local lan ip address or something? I am not sure if my torrent download
+ upload work but my browser wont connect to site, I can only connect to
my localhost server.
The censored is my current internet IP i got from my VPN Provider
eingehend = Incoming irgendwo = anywhere
ldap_set_option not setting timeout option
ldap_set_option not setting timeout option
I'm using ldap_connect to work with an LDAP server from an PHP
application, which works fine. Now I need to set timeouts, so that an
request will be canceled if it runs to long. For this I set the following
options with the following lines of code:
$ldapconn = ldap_connect($ldap['host'], $ldap['port'])
or myExClass::throwException("unable to connect");
echo LDAP_OPT_TIMELIMIT;
ldap_set_option ($ldapconn, LDAP_OPT_TIMELIMIT,1);
ldap_set_option ($ldapconn, LDAP_OPT_NETWORK_TIMEOUT,1);
echo LDAP_OPT_TIMELIMIT;
The echo are inserted for debugging. In this example I found out, that the
option LDAP_OPT_TIMELIMIT is unchanged 4. Before and after
ldap_set_option.
Why that option is not changed? What could be the reason? By the way: the
return code of ldap_set_optionis 1 in both cases.
I'm using ldap_connect to work with an LDAP server from an PHP
application, which works fine. Now I need to set timeouts, so that an
request will be canceled if it runs to long. For this I set the following
options with the following lines of code:
$ldapconn = ldap_connect($ldap['host'], $ldap['port'])
or myExClass::throwException("unable to connect");
echo LDAP_OPT_TIMELIMIT;
ldap_set_option ($ldapconn, LDAP_OPT_TIMELIMIT,1);
ldap_set_option ($ldapconn, LDAP_OPT_NETWORK_TIMEOUT,1);
echo LDAP_OPT_TIMELIMIT;
The echo are inserted for debugging. In this example I found out, that the
option LDAP_OPT_TIMELIMIT is unchanged 4. Before and after
ldap_set_option.
Why that option is not changed? What could be the reason? By the way: the
return code of ldap_set_optionis 1 in both cases.
Tuesday, 27 August 2013
how to send dynamic data using ajax
how to send dynamic data using ajax
normally, we have a ajax request like:
$.ajax({
type: 'GET',
url: "/biboundsoptimization",
data: {
objects: '2',
},
success: function( data ) {
console.log(data);
alert(data);
},
error:function(data,status,er) {
alert("error: "+data+" status: "+status+"
er:"+er);
}
});
but now I cannot know the number of variables in the data field . For
example, when the client enters 2 the data field should be like:
data: {
objects1: value of objects1,
objects2: value of objects2,
},
if the client enters 3 the data field should be like:
data: {
objects1: value of objects1,
objects2: value of objects2,
objects3: value of objects3,
},
Before the ajax request, the client has already entered the value of each
objects into different input fields. But i don't know the number until he
enters it. So i cannot write as above. it is obvious that a loop is
required to get all the objects by looping over the number of loops
provided by the client. I tried to something like:
for(int i = 1; i < clientValue; i++){
'objects' + i: $('#objects' + i).val(),
}
But it doesn't work. Grammatically it is wrong. Can anyone help me with
that? Thanks!
normally, we have a ajax request like:
$.ajax({
type: 'GET',
url: "/biboundsoptimization",
data: {
objects: '2',
},
success: function( data ) {
console.log(data);
alert(data);
},
error:function(data,status,er) {
alert("error: "+data+" status: "+status+"
er:"+er);
}
});
but now I cannot know the number of variables in the data field . For
example, when the client enters 2 the data field should be like:
data: {
objects1: value of objects1,
objects2: value of objects2,
},
if the client enters 3 the data field should be like:
data: {
objects1: value of objects1,
objects2: value of objects2,
objects3: value of objects3,
},
Before the ajax request, the client has already entered the value of each
objects into different input fields. But i don't know the number until he
enters it. So i cannot write as above. it is obvious that a loop is
required to get all the objects by looping over the number of loops
provided by the client. I tried to something like:
for(int i = 1; i < clientValue; i++){
'objects' + i: $('#objects' + i).val(),
}
But it doesn't work. Grammatically it is wrong. Can anyone help me with
that? Thanks!
Receiving Reports Form Users Of java.lang.OutOfMemoryError
Receiving Reports Form Users Of java.lang.OutOfMemoryError
I've been having reports from my users of force closing on start-up and
crashes on my latest release of my application.
I think ive pinpointed the problem to my theming in my preferences. The
problem is, cannot figure out what the problem is...
Here is my code for theming my application:
ImageButton ibStopwatch = (ImageButton) findViewById(R.id.ibStopwatch);
ImageButton ibFs = (ImageButton) findViewById(R.id.ibFs);
ImageButton ibFsn = (ImageButton) findViewById(R.id.ibFsn);
ImageButton ibMusic = (ImageButton) findViewById(R.id.ibMusic);
ImageButton ibYoutube = (ImageButton) findViewById(R.id.ibYoutube);
ImageButton ibPlay = (ImageButton) findViewById(R.id.ibPlay);
ImageButton ibSearch = (ImageButton) findViewById(R.id.ibSearch);
ImageButton ibBrowser = (ImageButton) findViewById(R.id.ibBrowser);
RelativeLayout rl = (RelativeLayout) findViewById(R.id.rl);
ViewFlipper vf = (ViewFlipper) findViewById(R.id.vf);
String theme = prefs.getString("Theme", "1");
if (theme.contentEquals("1")) {
tvTime.setTextColor(Color.parseColor("#CCCCCC"));
tvAmPm.setTextColor(Color.parseColor("#CCCCCC"));
tvDate.setTextColor(Color.parseColor("#CCCCCC"));
tvAlarm.setTextColor(Color.parseColor("#CCCCCC"));
tvBat.setTextColor(Color.parseColor("#CCCCCC"));
rl.setBackgroundColor(Color.parseColor("#222222"));
vf.setDisplayedChild(0);
ibStopwatch.setBackgroundResource(R.drawable.stopwatch);
ibFs.setBackgroundResource(R.drawable.fs);
ibFsn.setBackgroundResource(R.drawable.fsnm);
ibMusic.setBackgroundResource(R.drawable.music);
ibYoutube.setBackgroundResource(R.drawable.youtube);
ibPlay.setBackgroundResource(R.drawable.play);
ibSearch.setBackgroundResource(R.drawable.search);
ibBrowser.setBackgroundResource(R.drawable.browser);
}
if (theme.contentEquals("2")) {
tvTime.setTextColor(Color.RED);
tvAmPm.setTextColor(Color.RED);
tvDate.setTextColor(Color.RED);
tvAlarm.setTextColor(Color.RED);
tvBat.setTextColor(Color.RED);
rl.setBackgroundColor(Color.parseColor("#180000"));
vf.setDisplayedChild(1);
ibStopwatch.setBackgroundResource(R.drawable.stopwatchred);
ibFs.setBackgroundResource(R.drawable.fsred);
ibFsn.setBackgroundResource(R.drawable.fsnmred);
ibMusic.setBackgroundResource(R.drawable.musicred);
ibYoutube.setBackgroundResource(R.drawable.youtubered);
ibPlay.setBackgroundResource(R.drawable.playred);
ibSearch.setBackgroundResource(R.drawable.searchred);
ibBrowser.setBackgroundResource(R.drawable.browserred);
}
if (theme.contentEquals("3")) {
tvTime.setTextColor(Color.GREEN);
tvAmPm.setTextColor(Color.GREEN);
tvDate.setTextColor(Color.GREEN);
tvAlarm.setTextColor(Color.GREEN);
tvBat.setTextColor(Color.GREEN);
rl.setBackgroundColor(Color.parseColor("#001800"));
vf.setDisplayedChild(2);
ibStopwatch.setBackgroundResource(R.drawable.stopwatchgreen);
ibFs.setBackgroundResource(R.drawable.fsgreen);
ibFsn.setBackgroundResource(R.drawable.fsnmgreen);
ibMusic.setBackgroundResource(R.drawable.musicgreen);
ibYoutube.setBackgroundResource(R.drawable.youtubegreen);
ibPlay.setBackgroundResource(R.drawable.playgreen);
ibSearch.setBackgroundResource(R.drawable.searchgreen);
ibBrowser.setBackgroundResource(R.drawable.browsergreen);
}
if (theme.contentEquals("4")) {
tvTime.setTextColor(Color.BLUE);
tvAmPm.setTextColor(Color.BLUE);
tvDate.setTextColor(Color.BLUE);
tvAlarm.setTextColor(Color.BLUE);
tvBat.setTextColor(Color.BLUE);
rl.setBackgroundColor(Color.parseColor("#000018"));
vf.setDisplayedChild(3);
ibStopwatch.setBackgroundResource(R.drawable.stopwatchblue);
ibFs.setBackgroundResource(R.drawable.fsblue);
ibFsn.setBackgroundResource(R.drawable.fsnmblue);
ibMusic.setBackgroundResource(R.drawable.musicblue);
ibYoutube.setBackgroundResource(R.drawable.youtubeblue);
ibPlay.setBackgroundResource(R.drawable.playblue);
ibSearch.setBackgroundResource(R.drawable.searchblue);
ibBrowser.setBackgroundResource(R.drawable.browserblue);
}
This is for my main activity where most of the errors happen.
I find that sometimes when I change the theme in my preferences Activity
and press back which calls finish() when I enter preferences and the
launches my main activity when i press back to refresh the layout and
resources etc.
The problem could be to do with excessive use and changing of resources
may be causing it to crash. The crashing, for me, is random after changing
themes.
This is the stack trace I am given in the developer console:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.timmo.clock/com.timmo.clock.DeskClock}:
android.view.InflateException: Binary XML file line #156: Error inflating
class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2246)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2296)
at android.app.ActivityThread.access$700(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #156: Error
inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
at android.app.Activity.setContentView(Activity.java:1928)
at com.timmo.clock.DeskClock.onCreate(DeskClock.java:77)
at android.app.Activity.performCreate(Activity.java:5250)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2210)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:593)
... 25 more
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:817)
at android.content.res.Resources.loadDrawable(Resources.java:2854)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.AnalogClock.<init>(AnalogClock.java:88)
at android.widget.AnalogClock.<init>(AnalogClock.java:67)
... 28 more
As I struggle to read stacks I hope someone can help me figure out my
problem and hopefully I can get this bug fixed instead of wiping the
feature completely...
Thanks
I've been having reports from my users of force closing on start-up and
crashes on my latest release of my application.
I think ive pinpointed the problem to my theming in my preferences. The
problem is, cannot figure out what the problem is...
Here is my code for theming my application:
ImageButton ibStopwatch = (ImageButton) findViewById(R.id.ibStopwatch);
ImageButton ibFs = (ImageButton) findViewById(R.id.ibFs);
ImageButton ibFsn = (ImageButton) findViewById(R.id.ibFsn);
ImageButton ibMusic = (ImageButton) findViewById(R.id.ibMusic);
ImageButton ibYoutube = (ImageButton) findViewById(R.id.ibYoutube);
ImageButton ibPlay = (ImageButton) findViewById(R.id.ibPlay);
ImageButton ibSearch = (ImageButton) findViewById(R.id.ibSearch);
ImageButton ibBrowser = (ImageButton) findViewById(R.id.ibBrowser);
RelativeLayout rl = (RelativeLayout) findViewById(R.id.rl);
ViewFlipper vf = (ViewFlipper) findViewById(R.id.vf);
String theme = prefs.getString("Theme", "1");
if (theme.contentEquals("1")) {
tvTime.setTextColor(Color.parseColor("#CCCCCC"));
tvAmPm.setTextColor(Color.parseColor("#CCCCCC"));
tvDate.setTextColor(Color.parseColor("#CCCCCC"));
tvAlarm.setTextColor(Color.parseColor("#CCCCCC"));
tvBat.setTextColor(Color.parseColor("#CCCCCC"));
rl.setBackgroundColor(Color.parseColor("#222222"));
vf.setDisplayedChild(0);
ibStopwatch.setBackgroundResource(R.drawable.stopwatch);
ibFs.setBackgroundResource(R.drawable.fs);
ibFsn.setBackgroundResource(R.drawable.fsnm);
ibMusic.setBackgroundResource(R.drawable.music);
ibYoutube.setBackgroundResource(R.drawable.youtube);
ibPlay.setBackgroundResource(R.drawable.play);
ibSearch.setBackgroundResource(R.drawable.search);
ibBrowser.setBackgroundResource(R.drawable.browser);
}
if (theme.contentEquals("2")) {
tvTime.setTextColor(Color.RED);
tvAmPm.setTextColor(Color.RED);
tvDate.setTextColor(Color.RED);
tvAlarm.setTextColor(Color.RED);
tvBat.setTextColor(Color.RED);
rl.setBackgroundColor(Color.parseColor("#180000"));
vf.setDisplayedChild(1);
ibStopwatch.setBackgroundResource(R.drawable.stopwatchred);
ibFs.setBackgroundResource(R.drawable.fsred);
ibFsn.setBackgroundResource(R.drawable.fsnmred);
ibMusic.setBackgroundResource(R.drawable.musicred);
ibYoutube.setBackgroundResource(R.drawable.youtubered);
ibPlay.setBackgroundResource(R.drawable.playred);
ibSearch.setBackgroundResource(R.drawable.searchred);
ibBrowser.setBackgroundResource(R.drawable.browserred);
}
if (theme.contentEquals("3")) {
tvTime.setTextColor(Color.GREEN);
tvAmPm.setTextColor(Color.GREEN);
tvDate.setTextColor(Color.GREEN);
tvAlarm.setTextColor(Color.GREEN);
tvBat.setTextColor(Color.GREEN);
rl.setBackgroundColor(Color.parseColor("#001800"));
vf.setDisplayedChild(2);
ibStopwatch.setBackgroundResource(R.drawable.stopwatchgreen);
ibFs.setBackgroundResource(R.drawable.fsgreen);
ibFsn.setBackgroundResource(R.drawable.fsnmgreen);
ibMusic.setBackgroundResource(R.drawable.musicgreen);
ibYoutube.setBackgroundResource(R.drawable.youtubegreen);
ibPlay.setBackgroundResource(R.drawable.playgreen);
ibSearch.setBackgroundResource(R.drawable.searchgreen);
ibBrowser.setBackgroundResource(R.drawable.browsergreen);
}
if (theme.contentEquals("4")) {
tvTime.setTextColor(Color.BLUE);
tvAmPm.setTextColor(Color.BLUE);
tvDate.setTextColor(Color.BLUE);
tvAlarm.setTextColor(Color.BLUE);
tvBat.setTextColor(Color.BLUE);
rl.setBackgroundColor(Color.parseColor("#000018"));
vf.setDisplayedChild(3);
ibStopwatch.setBackgroundResource(R.drawable.stopwatchblue);
ibFs.setBackgroundResource(R.drawable.fsblue);
ibFsn.setBackgroundResource(R.drawable.fsnmblue);
ibMusic.setBackgroundResource(R.drawable.musicblue);
ibYoutube.setBackgroundResource(R.drawable.youtubeblue);
ibPlay.setBackgroundResource(R.drawable.playblue);
ibSearch.setBackgroundResource(R.drawable.searchblue);
ibBrowser.setBackgroundResource(R.drawable.browserblue);
}
This is for my main activity where most of the errors happen.
I find that sometimes when I change the theme in my preferences Activity
and press back which calls finish() when I enter preferences and the
launches my main activity when i press back to refresh the layout and
resources etc.
The problem could be to do with excessive use and changing of resources
may be causing it to crash. The crashing, for me, is random after changing
themes.
This is the stack trace I am given in the developer console:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.timmo.clock/com.timmo.clock.DeskClock}:
android.view.InflateException: Binary XML file line #156: Error inflating
class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2246)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2296)
at android.app.ActivityThread.access$700(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #156: Error
inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
at android.app.Activity.setContentView(Activity.java:1928)
at com.timmo.clock.DeskClock.onCreate(DeskClock.java:77)
at android.app.Activity.performCreate(Activity.java:5250)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2210)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:593)
... 25 more
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:817)
at android.content.res.Resources.loadDrawable(Resources.java:2854)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.AnalogClock.<init>(AnalogClock.java:88)
at android.widget.AnalogClock.<init>(AnalogClock.java:67)
... 28 more
As I struggle to read stacks I hope someone can help me figure out my
problem and hopefully I can get this bug fixed instead of wiping the
feature completely...
Thanks
jquery: how to implement a scroll for a div element like in windows contacts for alphabetic index
jquery: how to implement a scroll for a div element like in windows
contacts for alphabetic index
I would like to implement a scroll for my blog for the voting system
If you see the blog link below it has a voting arrow up,down on the left side
http://jimmywales.quora.com/
so when the user scrolls the page the arrows should move down when another
same element comes in it should leave replacing that element's place with
the coming element
this enables the user to vote the post at any point when he reads a long post
I first found it on my windows phone for my contacts index
If you have a quora account you can login in and find exact happening like
this method by visting the same blog above
contacts for alphabetic index
I would like to implement a scroll for my blog for the voting system
If you see the blog link below it has a voting arrow up,down on the left side
http://jimmywales.quora.com/
so when the user scrolls the page the arrows should move down when another
same element comes in it should leave replacing that element's place with
the coming element
this enables the user to vote the post at any point when he reads a long post
I first found it on my windows phone for my contacts index
If you have a quora account you can login in and find exact happening like
this method by visting the same blog above
Replace values located close to themselves with the mean value
Replace values located close to themselves with the mean value
I'm not sure if SO is the proper place for asking this, if it's not, I
will remove the question and try it in some other place. Said that I'm
trying to do the following:
I have a List<double> and want to replace the block of values whose values
are situated very close (say 0.75 in this example) to a single value,
representing the mean of the replaced values. The values that are
isolated, or alone, should not be modified. Also the replaced block can't
be longer than 5.
Computing the mean value for each interval from 0, 5, 10.. would not
provide the expected results.
It happened many times that LINQ power surprised me gladly and I would be
happy if someone could guide me in the creation of this little method.
What I've thought is to first find the closest values for each one,
calculate the distance, if the distance is less than minimum (0.75 in this
example) then assign those values to the same block.
When all values are assigned to their blocks run a second loop that
replaces each block (with one value, or many values) to its mean.
The problem that I have in this approach is to assign the "block": if
several values are together, I need to check if the evaluating value is
contained in another block, and if it so, the new value should be in that
block too. I don't know if this is the right way of doing this or I'm over
complicating it.
Thanks for reading, and any help is appreciated.
I'm not sure if SO is the proper place for asking this, if it's not, I
will remove the question and try it in some other place. Said that I'm
trying to do the following:
I have a List<double> and want to replace the block of values whose values
are situated very close (say 0.75 in this example) to a single value,
representing the mean of the replaced values. The values that are
isolated, or alone, should not be modified. Also the replaced block can't
be longer than 5.
Computing the mean value for each interval from 0, 5, 10.. would not
provide the expected results.
It happened many times that LINQ power surprised me gladly and I would be
happy if someone could guide me in the creation of this little method.
What I've thought is to first find the closest values for each one,
calculate the distance, if the distance is less than minimum (0.75 in this
example) then assign those values to the same block.
When all values are assigned to their blocks run a second loop that
replaces each block (with one value, or many values) to its mean.
The problem that I have in this approach is to assign the "block": if
several values are together, I need to check if the evaluating value is
contained in another block, and if it so, the new value should be in that
block too. I don't know if this is the right way of doing this or I'm over
complicating it.
Thanks for reading, and any help is appreciated.
Using Smooks transformer in Mule 3.4 CE
Using Smooks transformer in Mule 3.4 CE
I'm trying to use smooks 1.5 to transform a csv file to xml. I have
already imported all smooks jar, but getting this error
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration >problem: Unable to locate NamespaceHandler for namespace
>>[http://www.muleforge.org/smooks/schema/mule-module-smooks] Offending
resource: URL
>>[file:/D:/Documents/MuleStudio/workspace/.mule/apps/smooksapp/SmooksApp.xml]
This is my mule-config file
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:smooks="http://www.muleforge.org/smooks/schema/mule-module-smooks"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file
http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.muleforge.org/smooks/schema/mule-module-smooks
http://dist.muleforge.org/smooks/schema/mule-module-smooks/1.3/mule-module-smooks.xsd">
<flow name="SmooksAppFlow1" doc:name="SmooksAppFlow1">
<file:inbound-endpoint
path="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources"
responseTimeout="10000" doc:name="File"/>
<smooks:transformer name="csvToXmlSmooksTransformer"
configFile="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources\smooks-config.xml"
resultType="STRING" reportPath="target/smooks-report/report.html"
/>
<file:outbound-endpoint responseTimeout="10000" doc:name="File"
path="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources"/>
</flow>
</mule>
I'm trying to use smooks 1.5 to transform a csv file to xml. I have
already imported all smooks jar, but getting this error
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration >problem: Unable to locate NamespaceHandler for namespace
>>[http://www.muleforge.org/smooks/schema/mule-module-smooks] Offending
resource: URL
>>[file:/D:/Documents/MuleStudio/workspace/.mule/apps/smooksapp/SmooksApp.xml]
This is my mule-config file
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:smooks="http://www.muleforge.org/smooks/schema/mule-module-smooks"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file
http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.muleforge.org/smooks/schema/mule-module-smooks
http://dist.muleforge.org/smooks/schema/mule-module-smooks/1.3/mule-module-smooks.xsd">
<flow name="SmooksAppFlow1" doc:name="SmooksAppFlow1">
<file:inbound-endpoint
path="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources"
responseTimeout="10000" doc:name="File"/>
<smooks:transformer name="csvToXmlSmooksTransformer"
configFile="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources\smooks-config.xml"
resultType="STRING" reportPath="target/smooks-report/report.html"
/>
<file:outbound-endpoint responseTimeout="10000" doc:name="File"
path="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources"/>
</flow>
</mule>
ASUS router EA-N66R has different subnet mask than laptop
ASUS router EA-N66R has different subnet mask than laptop
I have a new ASUS router that works perfectly, and I'm trying to set up an
ASUS EA-N66R repeater to use with that router. But when I connect my
Ethernet from my laptop to the repeater, the setup will not launch for the
repeater, only for the source router (using asusrouter.com and also trying
IP address 10.0.1.1, and also downloading the utilities from asus to
configure it). The utility says that my laptop has a different subnet mask
than the router, so the configuration option will not launch. The laptop
is set to obtain IP addresses automatically for IPv4. The utility from
asus says that the repeater subnet mask is 255.255.255.0, as well as the
source router. Should I use a temporary static ip address for my laptop
with a certain subnet mask to get it working? The source router gets it's
signal from a cable modem. Any help with this would be appreciated.
I have a new ASUS router that works perfectly, and I'm trying to set up an
ASUS EA-N66R repeater to use with that router. But when I connect my
Ethernet from my laptop to the repeater, the setup will not launch for the
repeater, only for the source router (using asusrouter.com and also trying
IP address 10.0.1.1, and also downloading the utilities from asus to
configure it). The utility says that my laptop has a different subnet mask
than the router, so the configuration option will not launch. The laptop
is set to obtain IP addresses automatically for IPv4. The utility from
asus says that the repeater subnet mask is 255.255.255.0, as well as the
source router. Should I use a temporary static ip address for my laptop
with a certain subnet mask to get it working? The source router gets it's
signal from a cable modem. Any help with this would be appreciated.
Getting domain class values in Javascript(gsp)
Getting domain class values in Javascript(gsp)
I want to retrieve ALL values set in my domain class to the client side
(gsp or Javascript) Let's say I have a domain class named GeneralSetting.
The approach I used works but not completely how I want.
gsp file
<%
def test = com.domain.GeneralSetting.findAll()[0]
def test1 = com.domain.GeneralSetting.findAll()[0].color
%>
Js
console.debug('${test}'); OUTPUT: [com.domain.GeneralSetting : 1]
console.debug('${test1}'); OUTPUT: red
I was thinking about something like this:
def globalSettings = com.digithurst.gutmann.domain.GeneralSetting.getAll()[0]
def array = []
//Add all properties
globalSettings.each {
array.add(it);
}
But when I ouput the array i just keep getting this:
[com.domain.GeneralSetting : 1] instead of all the properties
I want to retrieve ALL values set in my domain class to the client side
(gsp or Javascript) Let's say I have a domain class named GeneralSetting.
The approach I used works but not completely how I want.
gsp file
<%
def test = com.domain.GeneralSetting.findAll()[0]
def test1 = com.domain.GeneralSetting.findAll()[0].color
%>
Js
console.debug('${test}'); OUTPUT: [com.domain.GeneralSetting : 1]
console.debug('${test1}'); OUTPUT: red
I was thinking about something like this:
def globalSettings = com.digithurst.gutmann.domain.GeneralSetting.getAll()[0]
def array = []
//Add all properties
globalSettings.each {
array.add(it);
}
But when I ouput the array i just keep getting this:
[com.domain.GeneralSetting : 1] instead of all the properties
Monday, 26 August 2013
Saving vectors in a Mat opencv
Saving vectors in a Mat opencv
I am trying to save 4 Matrix inside a Matrix.But I was not sure if we can
do that.So I converted my 4matrix to 4 vectors. Now I want to insert the 4
vectors in the matrix. My code is:
Mat hist_TL = Mat::zeros(20,1, CV_32F);
Mat hist_TR = Mat::zeros(20,1, CV_32F);
Mat hist_BL = Mat::zeros(20,1, CV_32F);
Mat hist_BR = Mat::zeros(20,1, CV_32F);
for(int i=1;i<=21;i++)
{
for(int k=0;k<TL_k_stats.rows;k++)
{
float angl_TL=TL_k_stats.at<float>(k,3);
float angl_TR=TR_k_stats.at<float>(k,3);
float angl_BL=BL_k_stats.at<float>(k,3);
float angl_BR=BR_k_stats.at<float>(k,3);
if((angl_TL<=bins[i]) && (angl_TL>bins[i-1]))
{
hist_TL.at<float>(i-1,0)+=TL_k_stats.at<float>(k,4);
}
if((angl_TR<=bins[i]) && (angl_TR>bins[i-1]))
{
hist_TR.at<float>(i-1,0)+=TR_k_stats.at<float>(k,4);
}
if((angl_BL<=bins[i]) && (angl_BL>bins[i-1]))
{
hist_BL.at<float>(i-1,0)+=BL_k_stats.at<float>(k,4);
}
if((angl_BR<=bins[i]) && (angl_BR>bins[i-1]))
{
hist_BR.at<float>(i-1,0)+=BR_k_stats.at<float>(k,4);
}
}
hist_TL=hist_TL.inv();
hist_TR=hist_TR.inv();
hist_BL=hist_BL.inv();
hist_BR=hist_BR.inv();
std::vector<float> vhist_TL;
std::vector<float> vhist_TR;
std::vector<float> vhist_BL;
std::vector<float> vhist_BR;
hist_TL.copyTo(vhist_TL);
hist_TR.copyTo(vhist_TR);
hist_BL.copyTo(vhist_BL);
hist_BR.copyTo(vhist_BR);
So I want to copy the the 4 vectors to one Matrix. If there is any way i
can do it without the conversion of matrix to vector.Please let me know.In
matlab we can directly store it into an array and return it like this
features[] = {hist_TL', hist_TR', hist_BL', hist_BR'};
So how can I achieve this in opencv??
I am trying to save 4 Matrix inside a Matrix.But I was not sure if we can
do that.So I converted my 4matrix to 4 vectors. Now I want to insert the 4
vectors in the matrix. My code is:
Mat hist_TL = Mat::zeros(20,1, CV_32F);
Mat hist_TR = Mat::zeros(20,1, CV_32F);
Mat hist_BL = Mat::zeros(20,1, CV_32F);
Mat hist_BR = Mat::zeros(20,1, CV_32F);
for(int i=1;i<=21;i++)
{
for(int k=0;k<TL_k_stats.rows;k++)
{
float angl_TL=TL_k_stats.at<float>(k,3);
float angl_TR=TR_k_stats.at<float>(k,3);
float angl_BL=BL_k_stats.at<float>(k,3);
float angl_BR=BR_k_stats.at<float>(k,3);
if((angl_TL<=bins[i]) && (angl_TL>bins[i-1]))
{
hist_TL.at<float>(i-1,0)+=TL_k_stats.at<float>(k,4);
}
if((angl_TR<=bins[i]) && (angl_TR>bins[i-1]))
{
hist_TR.at<float>(i-1,0)+=TR_k_stats.at<float>(k,4);
}
if((angl_BL<=bins[i]) && (angl_BL>bins[i-1]))
{
hist_BL.at<float>(i-1,0)+=BL_k_stats.at<float>(k,4);
}
if((angl_BR<=bins[i]) && (angl_BR>bins[i-1]))
{
hist_BR.at<float>(i-1,0)+=BR_k_stats.at<float>(k,4);
}
}
hist_TL=hist_TL.inv();
hist_TR=hist_TR.inv();
hist_BL=hist_BL.inv();
hist_BR=hist_BR.inv();
std::vector<float> vhist_TL;
std::vector<float> vhist_TR;
std::vector<float> vhist_BL;
std::vector<float> vhist_BR;
hist_TL.copyTo(vhist_TL);
hist_TR.copyTo(vhist_TR);
hist_BL.copyTo(vhist_BL);
hist_BR.copyTo(vhist_BR);
So I want to copy the the 4 vectors to one Matrix. If there is any way i
can do it without the conversion of matrix to vector.Please let me know.In
matlab we can directly store it into an array and return it like this
features[] = {hist_TL', hist_TR', hist_BL', hist_BR'};
So how can I achieve this in opencv??
Move bg-image with mouse from center (javaScript/jQuery/CSS)
Move bg-image with mouse from center (javaScript/jQuery/CSS)
I'm moving the body's background-position based on the position of the
mouse. But I need it to move a little differently, I want it to be so that
when the mouse is exactly in the center of the page, the background-image
is in exactly 'background-position: center;'
Here's the codepen: http://codepen.io/hellaFont/pen/IldnH
Here's my code:
$(window).on('mousemove', function(event) {
var x = event.clientX;
var y = event.clientY;
var windW = $(window).width();
var windH = $(window).height();
var imgW = $("#hide").width();
var imgH = $("#hide").height();
numX = x/windW * 50 + imgW/3;
numY = y/windH * 50 + imgH/3;
$('body').css({
'background-position-x' : - numX,
'background-position-y' : - numY
});
});
I'm moving the body's background-position based on the position of the
mouse. But I need it to move a little differently, I want it to be so that
when the mouse is exactly in the center of the page, the background-image
is in exactly 'background-position: center;'
Here's the codepen: http://codepen.io/hellaFont/pen/IldnH
Here's my code:
$(window).on('mousemove', function(event) {
var x = event.clientX;
var y = event.clientY;
var windW = $(window).width();
var windH = $(window).height();
var imgW = $("#hide").width();
var imgH = $("#hide").height();
numX = x/windW * 50 + imgW/3;
numY = y/windH * 50 + imgH/3;
$('body').css({
'background-position-x' : - numX,
'background-position-y' : - numY
});
});
MySQL statement not finding a row with matching data
MySQL statement not finding a row with matching data
On a recent project I am having issues when matching a password in the
database.
The query is as follows:
mysql_query("SELECT * FROM user_accounts WHERE username = '$username' AND
password = '$encryptedPass'")
This outputs
SELECT * FROM user_accounts WHERE username = 'T-McFarlane' AND password =
'äê1\Y¸c'
/code/pre
pIt can find me with just the user but with the password it cannot. I have
echoed out both the database password and the encrypted password provides
and they are exactly identical - this is what is in the database but it
cannot find the matching row./p
pMy question is that does this password contain any special characters or
would there be any other reason that this is failing?/p
pI have tried both utf8_swedish_ci and latin1_swedish_ci for my collation
setting in the database./p
On a recent project I am having issues when matching a password in the
database.
The query is as follows:
mysql_query("SELECT * FROM user_accounts WHERE username = '$username' AND
password = '$encryptedPass'")
This outputs
SELECT * FROM user_accounts WHERE username = 'T-McFarlane' AND password =
'äê1\Y¸c'
/code/pre
pIt can find me with just the user but with the password it cannot. I have
echoed out both the database password and the encrypted password provides
and they are exactly identical - this is what is in the database but it
cannot find the matching row./p
pMy question is that does this password contain any special characters or
would there be any other reason that this is failing?/p
pI have tried both utf8_swedish_ci and latin1_swedish_ci for my collation
setting in the database./p
web hosting company?
web hosting company?
I'm developing an android project but it should be connected to a server
and database. So I would like to ask about the best web hosting company so
that I can host my web project and test it.
thanks in advance.
I'm developing an android project but it should be connected to a server
and database. So I would like to ask about the best web hosting company so
that I can host my web project and test it.
thanks in advance.
Android Fails to send a few Multi part SMSes in row
Android Fails to send a few Multi part SMSes in row
I'm developing an app which sends a few Multipart SMSes in a row, it sends
the first one successfully but fails to send the rest of them, (although
it's able of sending short SMS, one part).even the main Messaging app of
the phone (Samsung Galaxy GRAND) fails to send long messages after I
stopped my app, and it doesn't fix until I restart the phone. I tried many
codes and dunno what's wrong, it's the simple code below. I watched it by
LogCat and there is no exception or error, where do you think the problem
is?
SmsManager sms = SmsManager.getDefault();
if (message.length() > 160) {
ArrayList<String> parts = sms
.divideMessage(message);
sms.sendMultipartTextMessage(phoneNumber, null,
parts, null, null);
} else {
sms.sendTextMessage(phoneNumber, null,
message.toString(), null, null);
}
I'm developing an app which sends a few Multipart SMSes in a row, it sends
the first one successfully but fails to send the rest of them, (although
it's able of sending short SMS, one part).even the main Messaging app of
the phone (Samsung Galaxy GRAND) fails to send long messages after I
stopped my app, and it doesn't fix until I restart the phone. I tried many
codes and dunno what's wrong, it's the simple code below. I watched it by
LogCat and there is no exception or error, where do you think the problem
is?
SmsManager sms = SmsManager.getDefault();
if (message.length() > 160) {
ArrayList<String> parts = sms
.divideMessage(message);
sms.sendMultipartTextMessage(phoneNumber, null,
parts, null, null);
} else {
sms.sendTextMessage(phoneNumber, null,
message.toString(), null, null);
}
Programmatically hide comment and view tabs drupal.stackexchange.com
Programmatically hide comment and view tabs – drupal.stackexchange.com
Can you please help me to hide the tabs from the Find/Add/Edit content
page? Is there a way to programmatically hide them?
Can you please help me to hide the tabs from the Find/Add/Edit content
page? Is there a way to programmatically hide them?
What Jquery selector to use?
What Jquery selector to use?
What selector do I need to use to get the src value of this picture?
<div class="rg-image">
<img src="/zenphoto/cache/test2/6244146_460s_595_watermark.jpg">
</div>
What selector do I need to use to get the src value of this picture?
<div class="rg-image">
<img src="/zenphoto/cache/test2/6244146_460s_595_watermark.jpg">
</div>
Sunday, 25 August 2013
How to properly use Marionette layouts?
How to properly use Marionette layouts?
my current code looks like this:
define([
'jquery',
'underscore',
'backbone',
'marionette',
'templates',
'gridView',
'detailView',
'detailModel'
], function ($, _, Backbone, Marionette, JST, GridView, DetailView,
DetailModel) {
'use strict';
return Marionette.Layout.extend({
el: '#main',
template: JST['app/scripts/templates/main.ejs'],
initialize: function() {
this.render();
},
onRender: function () {
var Layout = Marionette.Layout.extend({
el: 'div',
template: _.template(""),
regions: {
grid: '#grid',
detail: '#detail'
}
});
this.layout = new Layout();
this.layout.render();
},
showGrid: function () {
var detailModel = new DetailModel();
var g = new GridView(detailModel);
var d = new DetailView(detailModel);
this.layout.grid.show(g);
this.layout.detail.show(d);
}
});
});
What I do not understand is why I need an extra layout in my onRender
method to make this work. The '#grid' and '#detail' divs are part of the
main.ejs template, but the following does not work:
return Marionette.Layout.extend({
el: '#main',
template: JST['app/scripts/templates/main.ejs'],
regions: {
grid: '#grid',
detail: '#detail'
},
initialize: function() {
this.render();
},
onRender: function () {
var detailModel = new DetailModel();
var g = new GridView(detailModel);
var d = new DetailView(detailModel);
this.grid.show(g);
this.detail.show(d);
}
});
It seems that the layout only works if the elements specified in the
region object already exist when the layout is created. But the
documentation says that this is not the case.
I'm probably doing something wrong. But what ?
Regards Roger
my current code looks like this:
define([
'jquery',
'underscore',
'backbone',
'marionette',
'templates',
'gridView',
'detailView',
'detailModel'
], function ($, _, Backbone, Marionette, JST, GridView, DetailView,
DetailModel) {
'use strict';
return Marionette.Layout.extend({
el: '#main',
template: JST['app/scripts/templates/main.ejs'],
initialize: function() {
this.render();
},
onRender: function () {
var Layout = Marionette.Layout.extend({
el: 'div',
template: _.template(""),
regions: {
grid: '#grid',
detail: '#detail'
}
});
this.layout = new Layout();
this.layout.render();
},
showGrid: function () {
var detailModel = new DetailModel();
var g = new GridView(detailModel);
var d = new DetailView(detailModel);
this.layout.grid.show(g);
this.layout.detail.show(d);
}
});
});
What I do not understand is why I need an extra layout in my onRender
method to make this work. The '#grid' and '#detail' divs are part of the
main.ejs template, but the following does not work:
return Marionette.Layout.extend({
el: '#main',
template: JST['app/scripts/templates/main.ejs'],
regions: {
grid: '#grid',
detail: '#detail'
},
initialize: function() {
this.render();
},
onRender: function () {
var detailModel = new DetailModel();
var g = new GridView(detailModel);
var d = new DetailView(detailModel);
this.grid.show(g);
this.detail.show(d);
}
});
It seems that the layout only works if the elements specified in the
region object already exist when the layout is created. But the
documentation says that this is not the case.
I'm probably doing something wrong. But what ?
Regards Roger
Calculating reasonable detours with google maps for python
Calculating reasonable detours with google maps for python
I am going to take a drive across several states in a couple days. I'm
building a script that would scrape through lots of different locations of
interest, then tell us which ones are within 20 minutes detour of our
route. The only way I can think of to do this is by using the route on
google maps to create an array of lat/long coordinates which roughly
outline our route, then running a 'distance from line' algorithm on those
points. An alternative might be to simply add the lat/long coordinate into
the route and see how much time is added.
If you can think of an alternative, superior way to accomplish this task,
let me know :)
I am going to take a drive across several states in a couple days. I'm
building a script that would scrape through lots of different locations of
interest, then tell us which ones are within 20 minutes detour of our
route. The only way I can think of to do this is by using the route on
google maps to create an array of lat/long coordinates which roughly
outline our route, then running a 'distance from line' algorithm on those
points. An alternative might be to simply add the lat/long coordinate into
the route and see how much time is added.
If you can think of an alternative, superior way to accomplish this task,
let me know :)
[ Singles & Dating ] Open Question : How do I make this work?
[ Singles & Dating ] Open Question : How do I make this work?
A guy who travels in and out of town for work and I have been contacting
each other through text. He usually is working and sleeping, so he doesn't
get back to me all the time... I am pretty sure he likes me back because
we have been trying to set up a date night. It just doesn't always work
out. We have been out once, but as a group with his co workers. That was
when we discovered each other. I found myself liking him, and now I am in
love, but I don't know how to get the ball rolling in other ways. I know
if we go on a date and it goes well that we will connect. I just need to
find a way to connect with him when we aren't seeing each other. Texting
doesn't work all the time, and all I want to do is blurt out my love for
him. That would be crazy. I need help. I want to tell him things without
scaring him off. How do I make this relationship work? I am 23 and he is
31.
A guy who travels in and out of town for work and I have been contacting
each other through text. He usually is working and sleeping, so he doesn't
get back to me all the time... I am pretty sure he likes me back because
we have been trying to set up a date night. It just doesn't always work
out. We have been out once, but as a group with his co workers. That was
when we discovered each other. I found myself liking him, and now I am in
love, but I don't know how to get the ball rolling in other ways. I know
if we go on a date and it goes well that we will connect. I just need to
find a way to connect with him when we aren't seeing each other. Texting
doesn't work all the time, and all I want to do is blurt out my love for
him. That would be crazy. I need help. I want to tell him things without
scaring him off. How do I make this relationship work? I am 23 and he is
31.
Video-JS Prevent click event from propagationinig to child elements
Video-JS Prevent click event from propagationinig to child elements
I created a simple video page with Video-JS plugin. videos plays in a
popup module. What i'm trying to do is to close this popup whenever the
video wrapper is clicked, not the video. But i fail to do so and even when
i click on video controls the popup closes. My code looks like this:
$('.popup-video').click(function() {
$(this).fadeOut(500);
// Pause Video
});
$('.popup-video>div').click(function(e) {
e.stopPropagation();
});
$('.popup-video>video').click(function(e) {
e.stopPropagation();
});
.stopPropagation method used to do the trick, but not now! what am i doing
wrong?
I created a simple video page with Video-JS plugin. videos plays in a
popup module. What i'm trying to do is to close this popup whenever the
video wrapper is clicked, not the video. But i fail to do so and even when
i click on video controls the popup closes. My code looks like this:
$('.popup-video').click(function() {
$(this).fadeOut(500);
// Pause Video
});
$('.popup-video>div').click(function(e) {
e.stopPropagation();
});
$('.popup-video>video').click(function(e) {
e.stopPropagation();
});
.stopPropagation method used to do the trick, but not now! what am i doing
wrong?
How to animate background image size in jquery
How to animate background image size in jquery
I am trying to make an animation of a background for a div.
I want it to look like the backgound image is being zoomed in to, like here:
http://www.teknologisk.dk/
For this purpose i want to be able to zoom in and out via jquery,
something in the lines of this:
$('.DIVNAME').css("background-size:", "3000px auto");
I just need the correct code for this
Any ideas?
Thanks :)
I am trying to make an animation of a background for a div.
I want it to look like the backgound image is being zoomed in to, like here:
http://www.teknologisk.dk/
For this purpose i want to be able to zoom in and out via jquery,
something in the lines of this:
$('.DIVNAME').css("background-size:", "3000px auto");
I just need the correct code for this
Any ideas?
Thanks :)
Saturday, 24 August 2013
Converting TIFF image to Fax Group 3 format
Converting TIFF image to Fax Group 3 format
I have a Tiff image and I need to convert that image to CCITT Group 3 and
4 formats.I found a lots of tutorials but in vain.I am unable to succeed
in getting the proper compression type.So where can i find the relevant
snippet or tutorials to do the same?can i find a samll snippet to do the
same
I have a Tiff image and I need to convert that image to CCITT Group 3 and
4 formats.I found a lots of tutorials but in vain.I am unable to succeed
in getting the proper compression type.So where can i find the relevant
snippet or tutorials to do the same?can i find a samll snippet to do the
same
LinearKingdomParkingLot of TopCoder solution in C++
LinearKingdomParkingLot of TopCoder solution in C++
about the answer
http://community.topcoder.com/stat?c=problem_solution&rm=305511&rd=14283&pm=10982&cr=19849563
I am just wondering why int t1=solve(d+1,min(p1,a[d]),p2)+(int)(a[d]>p1);?
if the 'd' stands for the dth element of vi,why t1++ when
a[d]>p1,shouldn't it be < here , what the meaning of this sentence, I
think it is when insert the dth element of vi into the parking lot on
condition that the element after dth have been inserted into the lot?Is
that right?
about the answer
http://community.topcoder.com/stat?c=problem_solution&rm=305511&rd=14283&pm=10982&cr=19849563
I am just wondering why int t1=solve(d+1,min(p1,a[d]),p2)+(int)(a[d]>p1);?
if the 'd' stands for the dth element of vi,why t1++ when
a[d]>p1,shouldn't it be < here , what the meaning of this sentence, I
think it is when insert the dth element of vi into the parking lot on
condition that the element after dth have been inserted into the lot?Is
that right?
ComboBox show dropdown menu on text selection
ComboBox show dropdown menu on text selection
I want to show the list of items in a combo box when the user selects the
text. I have a touch screen application and it's very difficult to hit the
dropdown arrow so I figure I'd show the menu when the text is selected
which is often what gets touched. I'm using VS 2008. and suggestions for a
touch friendly numeric up down solution in VS2008?
I want to show the list of items in a combo box when the user selects the
text. I have a touch screen application and it's very difficult to hit the
dropdown arrow so I figure I'd show the menu when the text is selected
which is often what gets touched. I'm using VS 2008. and suggestions for a
touch friendly numeric up down solution in VS2008?
Python: how do I create a list of combinations from a series of ranges of numbers
Python: how do I create a list of combinations from a series of ranges of
numbers
For a list of numerical values of n length, e. g. [1, 3, 1, 2, ...], I
would like to create a list of the lists of all possible combinations of
values from range[x]. The output might look something like this:
for list[1, 3, 2] return all possible lists of range[x] values:
# the sequence of the list is unimportant
[
[0,0,0],[1,0,0],[0,1,0],[0,2,0],[0,3,0],[0,0,1],[0,0,2],[1,1,0],
[1,2,0],[1,3,0],[1,0,1],[1,0,2],[0,1,1],[0,2,1],[0,3,1],[0,1,2],
[0,2,2],[0,3,2],[1,1,1],[1,2,1],[1,3,1],[1,1,2],[1,2,2],[1,3,2]
]
numbers
For a list of numerical values of n length, e. g. [1, 3, 1, 2, ...], I
would like to create a list of the lists of all possible combinations of
values from range[x]. The output might look something like this:
for list[1, 3, 2] return all possible lists of range[x] values:
# the sequence of the list is unimportant
[
[0,0,0],[1,0,0],[0,1,0],[0,2,0],[0,3,0],[0,0,1],[0,0,2],[1,1,0],
[1,2,0],[1,3,0],[1,0,1],[1,0,2],[0,1,1],[0,2,1],[0,3,1],[0,1,2],
[0,2,2],[0,3,2],[1,1,1],[1,2,1],[1,3,1],[1,1,2],[1,2,2],[1,3,2]
]
Sonar vision smiley face on art works
Sonar vision smiley face on art works
Does anyone know what is going on with the smiley faces appearing on sonar
vision over certain works of art? I assume it is more than one place but
I've only noticed it once so far and that is in a bedroom in the safe
house mission very early in the game. I've only been playing an hour or
so.
Does anyone know what is going on with the smiley faces appearing on sonar
vision over certain works of art? I assume it is more than one place but
I've only noticed it once so far and that is in a bedroom in the safe
house mission very early in the game. I've only been playing an hour or
so.
Trying to restore files from Ubuntu One, get error 401
Trying to restore files from Ubuntu One, get error 401
I had a system crash on my laptop. I had to do a fresh install, and now I
want to restore my backed up home directory from Ubuntu One. Everything
starts out fine, it asks me for my encryption password, and after several
minutes it gives me an error 401. What little I have been able to find
about this suggests it is a server side error, I hope there is something I
can do about it.
If deja-dup won't work remotely, I would be happy to download the backup
files and run deja-dup remotely. But I don't see how to download files
from my Ubuntu One account. I don't want to sync anything, just download.
There is an upload button, but no apparent way to download anything. It
must be possible to ftp my own stuff back to my computer?
Thanks.
I had a system crash on my laptop. I had to do a fresh install, and now I
want to restore my backed up home directory from Ubuntu One. Everything
starts out fine, it asks me for my encryption password, and after several
minutes it gives me an error 401. What little I have been able to find
about this suggests it is a server side error, I hope there is something I
can do about it.
If deja-dup won't work remotely, I would be happy to download the backup
files and run deja-dup remotely. But I don't see how to download files
from my Ubuntu One account. I don't want to sync anything, just download.
There is an upload button, but no apparent way to download anything. It
must be possible to ftp my own stuff back to my computer?
Thanks.
Rails with activeadmin and devise - signed_in?
Rails with activeadmin and devise - signed_in?
I have installed devise and activeadmin. When i login to activeadmin rails
thinks that im also signed_in as a user on page but with no current_user
value. When i go on some pages without login as user (with logged on
activeadmin) statement:
<% if signed_in? %>
is true and rails try to run script in it. How can i tell rails that
activeadmin users isnt current_user for whole site?
I have installed devise and activeadmin. When i login to activeadmin rails
thinks that im also signed_in as a user on page but with no current_user
value. When i go on some pages without login as user (with logged on
activeadmin) statement:
<% if signed_in? %>
is true and rails try to run script in it. How can i tell rails that
activeadmin users isnt current_user for whole site?
Python atuomatic indentation
Python atuomatic indentation
Suppose I have Python code like the following:
import sys #just an example
a=10
....
# a lot of lines here
....
print(result)
Suppose I want to wrap the many lines of code between a=10 and
print(result) in a function, how do I make sure the code is properly and
automatically indented (especially for nested for-loops) when the code is
pasted inside the function?
Can anyone show the way to do it in editors such as Emacs, vim,
Sublimetext, etc.?
Suppose I have Python code like the following:
import sys #just an example
a=10
....
# a lot of lines here
....
print(result)
Suppose I want to wrap the many lines of code between a=10 and
print(result) in a function, how do I make sure the code is properly and
automatically indented (especially for nested for-loops) when the code is
pasted inside the function?
Can anyone show the way to do it in editors such as Emacs, vim,
Sublimetext, etc.?
Friday, 23 August 2013
How to export the contents of a blog to JSON?
How to export the contents of a blog to JSON?
I am working on a blog and learning web development at the same time. I
want to learn more about JSON so I am trying to implement a way to export
the entire contents of my blog to JSON and later XML. I am hitting a lot
of problems on the way, the biggest one being getting the url of the page
which I want to render as JSON/XML dynamically. The code for my website
can be found here. I still need to comment more and I have to implement a
lot of functionalities.
I am working with Google App engine and use the jinja2 template engine.
Thanks.
I am working on a blog and learning web development at the same time. I
want to learn more about JSON so I am trying to implement a way to export
the entire contents of my blog to JSON and later XML. I am hitting a lot
of problems on the way, the biggest one being getting the url of the page
which I want to render as JSON/XML dynamically. The code for my website
can be found here. I still need to comment more and I have to implement a
lot of functionalities.
I am working with Google App engine and use the jinja2 template engine.
Thanks.
pickle saving pygame Surface (python)
pickle saving pygame Surface (python)
I tried to save a pygame.Surface but it doesn't let me, error
TypeError: can't pickle Surface objects
I can make it save surfaces? Or maybe there is another module that can
save it ?
I tried to save a pygame.Surface but it doesn't let me, error
TypeError: can't pickle Surface objects
I can make it save surfaces? Or maybe there is another module that can
save it ?
posting array using ajax to the controller in cakePHP
posting array using ajax to the controller in cakePHP
I am relatively new to cake and I am struggling with a custom filter that
im making in order to display products based on which checkboxes have been
ticked. The checkboxes get populated based on which attributes the user
creates in the backend, i then collect all the values of the selected
boxes into an array with javascript and post it to the controller, but for
some reason I cannot access the controller variable named '$find_tags' in
my view, it throughs undefined variable. Here is my javascript and ajax
which collects and posts correctly (when i firebug it 'data' in my
controller has array values which im posting) so thats fine
$("#clickme").click(function(event){
event.preventDefault(); var searchIDs = $("#checkboxes
input:checkbox:checked").map(function(){ return $(this).val(); }).get();
var contentType = "application/x-www-form-urlencoded";
var data = 'data[ID]='+searchIDs;
$.post("",data,function(data){
console.log(data);
});
});`
Here is my controller code which im assuming is where the fault lies
if ($this->request->is('post') ) {
$data = $this->request->data['ID'];
$find_tags = array();
$selected_tags = $data;
foreach($selected_tags as $tag)
{
array_push($find_tags,$this->Product->findByTag($tag));
$this->set('find_tags', _($find_tags));
}
}
And here is my view code where i get Undefined variable: find_tags
foreach($find_tags as $all_tag)
{
echo $all_tag['Product']['name'];
echo '</br>';
}
Any help or suggestions would really be appreciated been struggling with
this for a while now
I am relatively new to cake and I am struggling with a custom filter that
im making in order to display products based on which checkboxes have been
ticked. The checkboxes get populated based on which attributes the user
creates in the backend, i then collect all the values of the selected
boxes into an array with javascript and post it to the controller, but for
some reason I cannot access the controller variable named '$find_tags' in
my view, it throughs undefined variable. Here is my javascript and ajax
which collects and posts correctly (when i firebug it 'data' in my
controller has array values which im posting) so thats fine
$("#clickme").click(function(event){
event.preventDefault(); var searchIDs = $("#checkboxes
input:checkbox:checked").map(function(){ return $(this).val(); }).get();
var contentType = "application/x-www-form-urlencoded";
var data = 'data[ID]='+searchIDs;
$.post("",data,function(data){
console.log(data);
});
});`
Here is my controller code which im assuming is where the fault lies
if ($this->request->is('post') ) {
$data = $this->request->data['ID'];
$find_tags = array();
$selected_tags = $data;
foreach($selected_tags as $tag)
{
array_push($find_tags,$this->Product->findByTag($tag));
$this->set('find_tags', _($find_tags));
}
}
And here is my view code where i get Undefined variable: find_tags
foreach($find_tags as $all_tag)
{
echo $all_tag['Product']['name'];
echo '</br>';
}
Any help or suggestions would really be appreciated been struggling with
this for a while now
Glue divs next to each other
Glue divs next to each other
Is there anyway to make divs sort of blue to each other no matter the size
that they have?
http://imgur.com/mxODPnk
I've tried searching and the float:left works but for example in the image
above the yellow div will make the brown and green not appear in the
location like in the image, but below the line of the yellow.
I've tried using display: inline-block but it still doesn't work.
.glue-div{
margin-left: 10px;
border: 1px solid black;
color: orange;
float: left;
background: #303030;
}
here is a jfiddle that represents what my question is:
http://jsfiddle.net/sezcY/
Simply look at div six positioning. It should be below three and it has a
huge margin.
I guess I'd have to rearrange the order of the divs through JQuery?
Is there anyway to make divs sort of blue to each other no matter the size
that they have?
http://imgur.com/mxODPnk
I've tried searching and the float:left works but for example in the image
above the yellow div will make the brown and green not appear in the
location like in the image, but below the line of the yellow.
I've tried using display: inline-block but it still doesn't work.
.glue-div{
margin-left: 10px;
border: 1px solid black;
color: orange;
float: left;
background: #303030;
}
here is a jfiddle that represents what my question is:
http://jsfiddle.net/sezcY/
Simply look at div six positioning. It should be below three and it has a
huge margin.
I guess I'd have to rearrange the order of the divs through JQuery?
Rexex right match url with DOT at the end
Rexex right match url with DOT at the end
I have right regex to find urls in text, but one thing i can't solve. If
url ends with DOT - this dot matches as part of url.
http://jsfiddle.net/DKNat/11/
For sample, text is 'The url is www.domain.com. Second is wiki.org.'
Urls last dot is not part of url, but regex replace it too.
I have right regex to find urls in text, but one thing i can't solve. If
url ends with DOT - this dot matches as part of url.
http://jsfiddle.net/DKNat/11/
For sample, text is 'The url is www.domain.com. Second is wiki.org.'
Urls last dot is not part of url, but regex replace it too.
Thursday, 22 August 2013
Set Unique pair of columns in a MySQL table
Set Unique pair of columns in a MySQL table
I am working on project with php-MySQL in the back-end.It has various
articles to browse,sorted into various categories and a user-login system.
I recently added a watch-list functionality to it which enables users to
add articles to their watch-list/dashboard.
I have the following tables.
Articles table
article-id(int) Primary-Unique
cat(varchar)
name(varchar)
subCat(varchar)
description(varchar)
date added
users table
username(varchar) Primary-Unique
lname
fname
joined-date
.Watchlist table
article-id(int)
username(varchar)
date_watch
As we can see there is no unique key for watch-list table
I want to make (username + article-id) a unique pair Because for every
username more than 1 article-id's exist and viceversa
I just want to insert and delete rows and It's not needed to update them
how to prevent duplicate entries?
till now I have been checking number of rows with php
"SELECT * FROM watchlist WHERE article-id={$id} AND username={$user}"
and if mysql_num_rows() >1(not allowed to insert)
This works fine but if by mistake that INSERT command is executed thare
will be a duplicate entry
How to prevent it?
I am using phpmyadmin
Thanks,
Shrikanth
I am working on project with php-MySQL in the back-end.It has various
articles to browse,sorted into various categories and a user-login system.
I recently added a watch-list functionality to it which enables users to
add articles to their watch-list/dashboard.
I have the following tables.
Articles table
article-id(int) Primary-Unique
cat(varchar)
name(varchar)
subCat(varchar)
description(varchar)
date added
users table
username(varchar) Primary-Unique
lname
fname
joined-date
.Watchlist table
article-id(int)
username(varchar)
date_watch
As we can see there is no unique key for watch-list table
I want to make (username + article-id) a unique pair Because for every
username more than 1 article-id's exist and viceversa
I just want to insert and delete rows and It's not needed to update them
how to prevent duplicate entries?
till now I have been checking number of rows with php
"SELECT * FROM watchlist WHERE article-id={$id} AND username={$user}"
and if mysql_num_rows() >1(not allowed to insert)
This works fine but if by mistake that INSERT command is executed thare
will be a duplicate entry
How to prevent it?
I am using phpmyadmin
Thanks,
Shrikanth
php iframe keep redirecting websites within frame
php iframe keep redirecting websites within frame
I have an iframe that renders websites (like http://google.com). However
for websites that redirect (like http://tinyurl.com/l6llqre), the redirect
will open within the entire window of my current browser. How do I fix it
so that the website will redirect within the iframe??
Here's my iframe:
public function renderContent() {
if ($this->url) {
return
<iframe
src={$this->url}
width="100%"
height="500px"
scrolling="no"
/>;
} else {
return <ui:box type="red">{'The website cannot be loaded'}</ui:box>;
}
}
Really new at php, would appreciate any tips!
I have an iframe that renders websites (like http://google.com). However
for websites that redirect (like http://tinyurl.com/l6llqre), the redirect
will open within the entire window of my current browser. How do I fix it
so that the website will redirect within the iframe??
Here's my iframe:
public function renderContent() {
if ($this->url) {
return
<iframe
src={$this->url}
width="100%"
height="500px"
scrolling="no"
/>;
} else {
return <ui:box type="red">{'The website cannot be loaded'}</ui:box>;
}
}
Really new at php, would appreciate any tips!
Equational Logic- L-Structures
Equational Logic- L-Structures
L is the language ${+,*, -, <,0, 1}$. I need help showing that for each $m
\in \mathbb(Z)$ there is an atomic $L$-formula $F_{m}(x)$, having $x$ as
its only variable, that defines the one-element subsets ${m}$ of
$\mathbb{Z}$ i.e. ${a \in \mathbb{Z}: F_{m}(a)}$ is true = ${m}$
I know that an atomic formula is with no connectors and a L-formula is a
pair $(A,I)$ where $I$ is an interpretation of $A$ on $L$. I'm confused
why this formula $F_{m). Not sure where to go from here.
Then I can use that proof to show that for each finite subset $Y=
{m_1,...,m_k}$ of $\mathbb{Z}$ there is an $L$ formuala $F_{Y}(x)$ that
defines $Y$, i.e. $F_{Y}(a)$ if true iff $a \in Y$ i think. I'm just stuck
on how to go about it.
L is the language ${+,*, -, <,0, 1}$. I need help showing that for each $m
\in \mathbb(Z)$ there is an atomic $L$-formula $F_{m}(x)$, having $x$ as
its only variable, that defines the one-element subsets ${m}$ of
$\mathbb{Z}$ i.e. ${a \in \mathbb{Z}: F_{m}(a)}$ is true = ${m}$
I know that an atomic formula is with no connectors and a L-formula is a
pair $(A,I)$ where $I$ is an interpretation of $A$ on $L$. I'm confused
why this formula $F_{m). Not sure where to go from here.
Then I can use that proof to show that for each finite subset $Y=
{m_1,...,m_k}$ of $\mathbb{Z}$ there is an $L$ formuala $F_{Y}(x)$ that
defines $Y$, i.e. $F_{Y}(a)$ if true iff $a \in Y$ i think. I'm just stuck
on how to go about it.
JQuery Ajax returns an error
JQuery Ajax returns an error
I am using this code :
$.get("games.php?x="+x+"&o="+o, function(xml,status) {
$("#game").empty();
var row;
$(xml).find("value").each(function(index, value) {
if ( index % 3 == 0) {
row = $("<tr></tr>");
$("#game").append(row);
}
console.log($("<td width=\"50\"
height=\"50\"></td>").text(value));
row.append($("<td width=\"50\"
height=\"50\"></td>").text(value));
});
});
and im catching the Ajax errors with this :
$.ajaxSetup({
error: function(xhr, status, error) {
alert("An AJAX error occured: " + status + "\nError: " + error);
}
});
You can see it work here in the site im building for a web course :
http://62.219.127.85/sites/2013b/xox/xo.php?x=7&o=8
and see that the return xml is valid and correct :
http://62.219.127.85/sites/2013b/xox/games.php?x=7&o=8
To those who dont want to get in the site, it returns :
<game>
<x>
<id>7</id>
<id>Ofek Ron</id>
</x>
<o>
<id>8</id>
<id>Avi Fahima</id>
</o>
<value>o</value>
<value>x</value>
<value>-</value>
<value>x</value>
<value>0</value>
<value>x</value>
<value>x</value>
<value>o</value>
<value>o</value>
</game>
Yet i get this weird error on the get request, which is very uninformative
"error" is all the info they could give me, and now im stuck! can anyone
help?
I am using this code :
$.get("games.php?x="+x+"&o="+o, function(xml,status) {
$("#game").empty();
var row;
$(xml).find("value").each(function(index, value) {
if ( index % 3 == 0) {
row = $("<tr></tr>");
$("#game").append(row);
}
console.log($("<td width=\"50\"
height=\"50\"></td>").text(value));
row.append($("<td width=\"50\"
height=\"50\"></td>").text(value));
});
});
and im catching the Ajax errors with this :
$.ajaxSetup({
error: function(xhr, status, error) {
alert("An AJAX error occured: " + status + "\nError: " + error);
}
});
You can see it work here in the site im building for a web course :
http://62.219.127.85/sites/2013b/xox/xo.php?x=7&o=8
and see that the return xml is valid and correct :
http://62.219.127.85/sites/2013b/xox/games.php?x=7&o=8
To those who dont want to get in the site, it returns :
<game>
<x>
<id>7</id>
<id>Ofek Ron</id>
</x>
<o>
<id>8</id>
<id>Avi Fahima</id>
</o>
<value>o</value>
<value>x</value>
<value>-</value>
<value>x</value>
<value>0</value>
<value>x</value>
<value>x</value>
<value>o</value>
<value>o</value>
</game>
Yet i get this weird error on the get request, which is very uninformative
"error" is all the info they could give me, and now im stuck! can anyone
help?
SQL c# insert Command doesn't work
SQL c# insert Command doesn't work
I'm having a problem insertin data into my database. I can read from the
database by using the select query, so I know my connection string is
correct, but for some reason the insert doesn't work. Here's my code:
private string ConnectionString()
{
return @"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\App_Data\dbBusiness.mdf;Integrated
Security=True;User Instance=True";
}
private void Insert()
{
string sqlStrInsert = "INSERT INTO table
(param1,param2)VALUES(@param1,@param2)";
SqlConnection connection = new SqlConnection(ConnectionString());
SqlCommand command = new SqlCommand(sqlStrInsert, connection);
command.Parameters.Add("@param1", SqlDbType.SmallInt);
command.Parameters.Add("@param2", SqlDbType.NVarChar,50);
command.Parameters["@param1"].Value = numOf_company;
command.Parameters["@param2"].Value = txt_name.Text;
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}
Im having trouble figuring this out so i'd appreciate anyone who helps
I'm having a problem insertin data into my database. I can read from the
database by using the select query, so I know my connection string is
correct, but for some reason the insert doesn't work. Here's my code:
private string ConnectionString()
{
return @"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\App_Data\dbBusiness.mdf;Integrated
Security=True;User Instance=True";
}
private void Insert()
{
string sqlStrInsert = "INSERT INTO table
(param1,param2)VALUES(@param1,@param2)";
SqlConnection connection = new SqlConnection(ConnectionString());
SqlCommand command = new SqlCommand(sqlStrInsert, connection);
command.Parameters.Add("@param1", SqlDbType.SmallInt);
command.Parameters.Add("@param2", SqlDbType.NVarChar,50);
command.Parameters["@param1"].Value = numOf_company;
command.Parameters["@param2"].Value = txt_name.Text;
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}
Im having trouble figuring this out so i'd appreciate anyone who helps
Bash Terminal keeps clearing / overwriting itself
Bash Terminal keeps clearing / overwriting itself
My bash terminal on Ubuntu 12.04 64 bit keeps clearing itself partially
when the output is too big.
If I do a ls -al in a directory with many files. The terminal prints the
result, inbetween it scrolls down without printing anything and then
continues with the remaining result.
Or when I am tailing a log file I often see the output is overwritten in
the terminal. If i scroll up I can see parts of output replaced by blank
space.
Note: I have kept scrolling in Profile Preferences for terminal as
'Unlimited'.I never had any issue before of this kind
My bash terminal on Ubuntu 12.04 64 bit keeps clearing itself partially
when the output is too big.
If I do a ls -al in a directory with many files. The terminal prints the
result, inbetween it scrolls down without printing anything and then
continues with the remaining result.
Or when I am tailing a log file I often see the output is overwritten in
the terminal. If i scroll up I can see parts of output replaced by blank
space.
Note: I have kept scrolling in Profile Preferences for terminal as
'Unlimited'.I never had any issue before of this kind
Urls not redirecting in django
Urls not redirecting in django
I wanted to redirect some urls in my django project. So i tried using
django redirects app.
In settings.py :-
SITE_ID=1
INSTALLED APPS = (
...
'django.contrib.sites',
'django.contrib.redirects',
...
)
MIDDLEWARE_CLASSES = (
...
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
)
I did syncdb and then added the redirect from admin. Nothing happens. Is
there anything i missed?
I wanted to redirect some urls in my django project. So i tried using
django redirects app.
In settings.py :-
SITE_ID=1
INSTALLED APPS = (
...
'django.contrib.sites',
'django.contrib.redirects',
...
)
MIDDLEWARE_CLASSES = (
...
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
)
I did syncdb and then added the redirect from admin. Nothing happens. Is
there anything i missed?
Wednesday, 21 August 2013
How can I move a SQL Server LocalDb database from one machine to another?
How can I move a SQL Server LocalDb database from one machine to another?
I have a SQL Server database that was created from VS2012. I located the
database files for that. I would like to back up the database and move it
to a different machine.
My application already has started up and is running. Do I need to somehow
stop the database before I copy the files?
Can I just make a copy of the files and move them to another machine?
I have the following connectionString:
The database files are in my C:\Users\Melina folder. Will the VS2012 on
the other machine be able to access the data files without me doing
anything?
<add name="TestContext" connectionString="Data
Source=(LocalDb)\v11.0;Initial Catalog=Test;Integrated Security=SSPI;"
providerName="System.Data.SqlClient" />
I have a SQL Server database that was created from VS2012. I located the
database files for that. I would like to back up the database and move it
to a different machine.
My application already has started up and is running. Do I need to somehow
stop the database before I copy the files?
Can I just make a copy of the files and move them to another machine?
I have the following connectionString:
The database files are in my C:\Users\Melina folder. Will the VS2012 on
the other machine be able to access the data files without me doing
anything?
<add name="TestContext" connectionString="Data
Source=(LocalDb)\v11.0;Initial Catalog=Test;Integrated Security=SSPI;"
providerName="System.Data.SqlClient" />
J Developer 32-bit Error when installing( ERROR Launch:No such file or directory)
J Developer 32-bit Error when installing( ERROR Launch:No such file or
directory)
i downloaded j developer from oracle web site for 64 bit i had problem &
couldn't install it will give me error `---------------------------
ERROR
ERROR Launch:No such file or directory
OK
`
directory)
i downloaded j developer from oracle web site for 64 bit i had problem &
couldn't install it will give me error `---------------------------
ERROR
ERROR Launch:No such file or directory
OK
`
How to directly use Pandas Date-time index in calculations?
How to directly use Pandas Date-time index in calculations?
I have the following code that works:
table['CALC_DOM']=table.index
table['CALC_DOM']=table['END_DATE']-['CALC_DOM']
should be a better way to directly convert from table.index? like:
table['CALC_DOM']=table.index
table['CALC_DOM']=table['END_DATE']-(table.index())
I have tried using table.index.get_values and
table.index.date
and all I get is TypeError: incompatible type [object] for a
datetime/timedelta operation
I have the following code that works:
table['CALC_DOM']=table.index
table['CALC_DOM']=table['END_DATE']-['CALC_DOM']
should be a better way to directly convert from table.index? like:
table['CALC_DOM']=table.index
table['CALC_DOM']=table['END_DATE']-(table.index())
I have tried using table.index.get_values and
table.index.date
and all I get is TypeError: incompatible type [object] for a
datetime/timedelta operation
Which sentence sounds the best? [on hold]
Which sentence sounds the best? [on hold]
I want to use the word "efficient" in a sentence that describes myself.
Here is what I have so far:
I can work efficiently
I am an efficient worker
I know how to work efficiently
I have a proven track record of being an efficient worker
I constantly push/motivate myself to work efficiently
Which sentence sounds the best and is grammatically correct?
Thanks!
I want to use the word "efficient" in a sentence that describes myself.
Here is what I have so far:
I can work efficiently
I am an efficient worker
I know how to work efficiently
I have a proven track record of being an efficient worker
I constantly push/motivate myself to work efficiently
Which sentence sounds the best and is grammatically correct?
Thanks!
Linq expression multiple left outer join error
Linq expression multiple left outer join error
I am unable to execute the below linq.
from p in Patients
join q in MURWorksheets on p.PatientId equals q.PatientId into step1
from s in step1.DefaultIfEmpty()
join t in MURWorksheetAnswers on s.MURWorksheetId equals t.MURWorksheetId
into step2
from s2 in step2.DefaultIfEmpty()
select new {p.FirstName , Date = (s.MURDate == null ? DateTime.Now.Date :
s.MURDate),
s2.MURQuestionnaireId,s2.MURExpctedAnswersId};
Here is the sql for the same for your reference.
select a.FirstName,b.MURDate,c.MURQuestionnaireId,c.MURWorksheetAnswersID
from Patients as a
left join MURWorksheet as b on a.PatientId = b.PatientId
left join MURWorksheetAnswers as c on b.MURWorksheetId = c.MURWorksheetId
I am unable to execute the below linq.
from p in Patients
join q in MURWorksheets on p.PatientId equals q.PatientId into step1
from s in step1.DefaultIfEmpty()
join t in MURWorksheetAnswers on s.MURWorksheetId equals t.MURWorksheetId
into step2
from s2 in step2.DefaultIfEmpty()
select new {p.FirstName , Date = (s.MURDate == null ? DateTime.Now.Date :
s.MURDate),
s2.MURQuestionnaireId,s2.MURExpctedAnswersId};
Here is the sql for the same for your reference.
select a.FirstName,b.MURDate,c.MURQuestionnaireId,c.MURWorksheetAnswersID
from Patients as a
left join MURWorksheet as b on a.PatientId = b.PatientId
left join MURWorksheetAnswers as c on b.MURWorksheetId = c.MURWorksheetId
XAML doesn't see my IValueConverter class
XAML doesn't see my IValueConverter class
I'm creating a simple WP8, but I'm having troubles hiding (changing the
Visibility property) on a control.
In XAML I've added xmlns:local="clr-namespace:MyProjectName" (I've also
tried with using). The XAML is then structured as follows:
<Grid x:Name="LayoutRoot" Background="{StaticResource
PhoneBackgroundBrush}" >
<Grid x:Name="ContentPanel" Grid.Row="1" >
<Grid.Resources>
<local:VisibilityFormatter x:Key="FormatConverter" />
</Grid.Resources>
<phone:LongListSelector Grid.Row="4">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Obj}"
Visibility="{Binding ObjVisibility,
Mode=OneWay,
Converter={StaticResource
FormatConverter}}" />
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
</Grid>
</Grid>
The problem is at the <local:...> line: The name "VisibilityFormatter"
does not exist in the namespace "clr-namespace:MyProjectName".
The class is defined as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace MyProjectName
{
public class Formatter
{
public class VisibilityFormatter : IValueConverter
{
// Retrieve the format string and use it to format the value.
public object Convert(object value, Type targetType, object
parameter, System.Globalization.CultureInfo culture)
{
var visibility = parameter as bool?;
return visibility.HasValue && visibility.Value ?
Visibility.Visible : Visibility.Collapsed;
}
// No need to implement converting back on a one-way binding
public object ConvertBack(object value, Type targetType,
object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
}
The class ObjInfo is a simple public class with two properties:
public bool ObjVisibility { get; set; }
public string Obj { get; set; }
It's similar to this question, but no migrating is involved. I'm
developing on WP8 from the get-go.
What am I trying to achieve? Well. I'm storing whether the control should
be visible or not in that bool property. Since the XAML control's property
only grokks the Visibility enum, but not bool, I need to convert it to
that enum.
I'm creating a simple WP8, but I'm having troubles hiding (changing the
Visibility property) on a control.
In XAML I've added xmlns:local="clr-namespace:MyProjectName" (I've also
tried with using). The XAML is then structured as follows:
<Grid x:Name="LayoutRoot" Background="{StaticResource
PhoneBackgroundBrush}" >
<Grid x:Name="ContentPanel" Grid.Row="1" >
<Grid.Resources>
<local:VisibilityFormatter x:Key="FormatConverter" />
</Grid.Resources>
<phone:LongListSelector Grid.Row="4">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Obj}"
Visibility="{Binding ObjVisibility,
Mode=OneWay,
Converter={StaticResource
FormatConverter}}" />
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
</Grid>
</Grid>
The problem is at the <local:...> line: The name "VisibilityFormatter"
does not exist in the namespace "clr-namespace:MyProjectName".
The class is defined as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace MyProjectName
{
public class Formatter
{
public class VisibilityFormatter : IValueConverter
{
// Retrieve the format string and use it to format the value.
public object Convert(object value, Type targetType, object
parameter, System.Globalization.CultureInfo culture)
{
var visibility = parameter as bool?;
return visibility.HasValue && visibility.Value ?
Visibility.Visible : Visibility.Collapsed;
}
// No need to implement converting back on a one-way binding
public object ConvertBack(object value, Type targetType,
object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
}
The class ObjInfo is a simple public class with two properties:
public bool ObjVisibility { get; set; }
public string Obj { get; set; }
It's similar to this question, but no migrating is involved. I'm
developing on WP8 from the get-go.
What am I trying to achieve? Well. I'm storing whether the control should
be visible or not in that bool property. Since the XAML control's property
only grokks the Visibility enum, but not bool, I need to convert it to
that enum.
Unable to load the specified metadata resource.driving me crazy
Unable to load the specified metadata resource.driving me crazy
I hope someone can help with this
my connection strings are as follows:
<add name="RollCallDBEntities"
connectionString="metadata=res://System.Engine/RollcallNS.csdl|res://System.Engine/RollcallNS.ssdl|res://System.Engine/RollcallNS.msl;provider=Devart.Data.Oracle;provider
connection string="User
Id=user;Password=password;Server=127.0.0.1;Direct=True;Sid=ORCL""
providerName="System.Data.EntityClient" />
my code are as follows:
using (var db= new RollCallDBEntities()) //ok
{
var query = db.TBL_ROLLCALL.ToList(); //Unable to load the
specified metadata resource.
}
my assembly:
System.Engine
Anyone have any ideas?
I hope someone can help with this
my connection strings are as follows:
<add name="RollCallDBEntities"
connectionString="metadata=res://System.Engine/RollcallNS.csdl|res://System.Engine/RollcallNS.ssdl|res://System.Engine/RollcallNS.msl;provider=Devart.Data.Oracle;provider
connection string="User
Id=user;Password=password;Server=127.0.0.1;Direct=True;Sid=ORCL""
providerName="System.Data.EntityClient" />
my code are as follows:
using (var db= new RollCallDBEntities()) //ok
{
var query = db.TBL_ROLLCALL.ToList(); //Unable to load the
specified metadata resource.
}
my assembly:
System.Engine
Anyone have any ideas?
Tuesday, 20 August 2013
Copy file from a computer not in domain to a computer in domain C++
Copy file from a computer not in domain to a computer in domain C++
I have 2 computers in which one computer is in Domain and the other one is
not in domain. I want to copy a file from a computer not in domain to a
computer in domain by providing login credentials.
I tried mapping network folder to a drive with WNetAddConnection2. Since
we will run this exe as a windows service, handling of mapped drives is a
big challenge. Are there any other ways to do network copy of file?
I have 2 computers in which one computer is in Domain and the other one is
not in domain. I want to copy a file from a computer not in domain to a
computer in domain by providing login credentials.
I tried mapping network folder to a drive with WNetAddConnection2. Since
we will run this exe as a windows service, handling of mapped drives is a
big challenge. Are there any other ways to do network copy of file?
Access C# List inside Javascript
Access C# List inside Javascript
On the server side I create a list
List<object> data = new List<object> data;
Inside Javascript the folowing won't work for anything but primitive types.
var localData = @data;
This is the error
System.Collections.Generic.List`1[System.Object]
What am I missing?
On the server side I create a list
List<object> data = new List<object> data;
Inside Javascript the folowing won't work for anything but primitive types.
var localData = @data;
This is the error
System.Collections.Generic.List`1[System.Object]
What am I missing?
Volley Not Parsing 404 response
Volley Not Parsing 404 response
Volley returns an error when a 404 response is returned from the server
even if that 404 message contains json based error codes. It does not
parse the 404 response which contains jason { code: resourceNotFound,
msg:message_index }
Is there anyway to get Volley to process the JSon in a 404 message? The
service I am integrating with returns a 404 when a resource cannot be
found.
Volley returns an error when a 404 response is returned from the server
even if that 404 message contains json based error codes. It does not
parse the 404 response which contains jason { code: resourceNotFound,
msg:message_index }
Is there anyway to get Volley to process the JSon in a 404 message? The
service I am integrating with returns a 404 when a resource cannot be
found.
Python itertools.product Input Formatting
Python itertools.product Input Formatting
I wish to execute the following code:
temp = []
temp.append([1,2])
temp.append([3,4])
temp.append([5,6])
print list(itertools.product(temp[0],temp[1],temp[2]))
However, I would like to execute it for temp with arbitrary length. I.e.
something more like:
print list(itertools.product(temp))
How do I format the input correctly for itertools.product to produce the
same result in the first segment of code without explicitly knowing how
many entries there are in temp?
I wish to execute the following code:
temp = []
temp.append([1,2])
temp.append([3,4])
temp.append([5,6])
print list(itertools.product(temp[0],temp[1],temp[2]))
However, I would like to execute it for temp with arbitrary length. I.e.
something more like:
print list(itertools.product(temp))
How do I format the input correctly for itertools.product to produce the
same result in the first segment of code without explicitly knowing how
many entries there are in temp?
windows phone push notification for multiple device
windows phone push notification for multiple device
i am developing a news paper app, my cloud server need to send a single
push notification to multiple devices using authenticated MPNS.How can i
send single push notification to multiple channel uri?how can i do that?
i am developing a news paper app, my cloud server need to send a single
push notification to multiple devices using authenticated MPNS.How can i
send single push notification to multiple channel uri?how can i do that?
How to form an animation xml
How to form an animation xml
I want to make an animation-list with multiple items and each item
contains a rotate tag . What is the proper way to form it ? Is there an
other way to do the same ? Here is my code :
<?xml version="1.0" encoding="utf-8"?>
<animation-list
<item xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true"
<rotate
android:interpolator="@android:anim/linear_interpolator"
android:repeatMode="restart"
android:fromDegrees="0"
android:toDegrees="50"
android:pivotX="301"
android:pivotY="334"
android:duration="1000"
android:startOffset="0"
/>
</item>
<item xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true"
<rotate
android:interpolator="@android:anim/linear_interpolator"
android:repeatMode="restart"
android:fromDegrees="50"
android:toDegrees="20"
android:pivotX="301"
android:pivotY="334"
android:duration="859"
android:startOffset="0"
/>
</item>
</animation-list>
I want this xml to repeat when its over . Please help.
I want to make an animation-list with multiple items and each item
contains a rotate tag . What is the proper way to form it ? Is there an
other way to do the same ? Here is my code :
<?xml version="1.0" encoding="utf-8"?>
<animation-list
<item xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true"
<rotate
android:interpolator="@android:anim/linear_interpolator"
android:repeatMode="restart"
android:fromDegrees="0"
android:toDegrees="50"
android:pivotX="301"
android:pivotY="334"
android:duration="1000"
android:startOffset="0"
/>
</item>
<item xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true"
<rotate
android:interpolator="@android:anim/linear_interpolator"
android:repeatMode="restart"
android:fromDegrees="50"
android:toDegrees="20"
android:pivotX="301"
android:pivotY="334"
android:duration="859"
android:startOffset="0"
/>
</item>
</animation-list>
I want this xml to repeat when its over . Please help.
Getting TransportDisposedIOException : Peer (vm://ipaddress#3) disposed. in active MQ
Getting TransportDisposedIOException : Peer (vm://ipaddress#3) disposed.
in active MQ
I just used this sample code to implement Active MQ
http://www.tomcatexpert.com/blog/2010/12/20/integrating-activemq-tomcat-using-global-jndi#ex-tomcat-server-xml.
Able to send and receive the message successfully with tomcat server.
Now I required to implement Shared File System Master Slave. For that I
have followed below steps to change activemq.xml configuration
http://note19.com/2007/06/24/activemq-masterslave-setup/
Added networkConnector and transportConnector in activemq.xml
<networkConnectors>
<networkConnector name="My Queue"
uri="static://(tcp://172.16.121.144:61616,tcp://172.16.121.146:61616)"
/>
</networkConnectors>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://172.16.121.144:61616"/>
</transportConnectors>
activemq.xml
<?xml version="1.0"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="172.16.121.144"
dataDirectory="\\172.16.121.145\Shared
Doc\amq\activemq\activemq-data"
schedulerSupport="false"
useJmx="true">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
</policyEntry>
<policyEntry queue=">">
<pendingQueuePolicy>
<vmQueueCursor />
</pendingQueuePolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<networkConnectors>
<networkConnector name="My Queue"
uri="static://(tcp://172.16.121.144:61616,tcp://172.16.121.146:61616)"
/>
</networkConnectors>
<persistenceAdapter>
<kahaDB directory="\\172.16.121.145\Shared
Doc\amq\activemq\activemq-data\kahadb"/>
</persistenceAdapter>
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="128 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://172.16.121.144:61616"/>
</transportConnectors>
</broker>
</beans>
Getting below exception
INFO - ContextLoader - Root WebApplicationContext:
initialization started
INFO - XmlWebApplicationContext - Refreshing Root
WebApplicationContext: startup date [Tue Aug 20 12:31:15 IST 2013];
root of context hierarchy
INFO - XmlBeanDefinitionReader - Loading XML bean definitions
from ServletContext resource [/WEB-INF/spring/jms-context.xml]
INFO - DefaultListableBeanFactory - Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@bc6a12:defining
beans
[connectionFactory,fooQueue,singleConnectionFactory,jmsTemplate,messageSenderService,jmsMessageDelegate,myMessageListener,org.springfra
mework.jms.listener.DefaultMessageListenerContainer#0]; root of
factory hierarchy
INFO - DefaultLifecycleProcessor - Starting beans in phase
2147483647
INFO - DefaultListableBeanFactory - Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1bc3ec9:
defining beans
[org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.apache.activemq.xbean.XBeanBrokerService#0];
root of factory hierarchy
INFO - BrokerService - Using Persistence Adapter:
KahaDBPersistenceAdapter[\\172.16.121.145\SharedDoc\amq\activemq\activemq-data\ka
hadb]
INFO - BrokerService - ActiveMQ 5.4.1 JMS Message
Broker (172.16.121.144) is starting
INFO - BrokerService - For help or more information
please see: http://activemq.apache.org/
INFO - TransportServerThreadSupport - Listening for connections at:
tcp://01hw385526.India.TCS.com:61616
INFO - TransportConnector - Connector openwire Started
INFO - DiscoveryNetworkConnector - Establishing network
connection from vm://172.16.121.144?async=false&network=true to
tcp://172.16.121.144:616
16
INFO - TransportConnector - Connector vm://172.16.121.144
Started
INFO - DiscoveryNetworkConnector - Establishing network
connection from vm://172.16.121.144?async=false&network=true to
tcp://172.16.121.146:616
16
INFO - DemandForwardingBridgeSupport - 172.16.121.144 bridge to
172.16.121.144 stopped
INFO - Transport - Transport failed:
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#3) di
sposed.
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#3) disposed.
at
org.apache.activemq.transport.vm.VMTransport.stop(VMTransport.java:159)
at
org.apache.activemq.transport.vm.VMTransportServer$1.stop(VMTransportServer.java:81)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.ResponseCorrelator.stop(ResponseCorrelator.java:132)
at
org.apache.activemq.util.ServiceSupport.dispose(ServiceSupport.java:43)
at
org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:137)
at
org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent.start(SimpleDiscoveryAgent.java:77)
at
org.apache.activemq.network.DiscoveryNetworkConnector.handleStart(DiscoveryNetworkConnector.java:186)
at
org.apache.activemq.network.NetworkConnector$1.doStart(NetworkConnector.java:61)
at
org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
at
org.apache.activemq.network.NetworkConnector.start(NetworkConnector.java:202)
at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2094)
at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:518)
at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
:1581)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522
)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:121)
at
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:53)
at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy4.createConnection(Unknown Source)
at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:404)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:372)
at
org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:760)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:279)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:264)
at
org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:561)
at
org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:167)
at
org.springframework.context.support.DefaultLifecycleProcessor.access$1(DefaultLifecycleProcessor.java:154)
at
org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:339)
at
org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143)
at
org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:926)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
INFO - TransportConnector - Connector vm://172.16.121.144
Stopped
INFO - DemandForwardingBridgeSupport - Network connection between
vm://172.16.121.144#2 and tcp://172.16.121.146:61616 shutdown due to a
local error
: org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#2) disposed.
INFO - DemandForwardingBridgeSupport - 172.16.121.144 bridge to
Unknown stopped
INFO - NetworkConnector - Network Connector My Queue
Started
INFO - BrokerService - ActiveMQ JMS Message Broker
(172.16.121.144, ID:01hw385526-51685-1376982077589-0:0) started
INFO - TransportConnector - Connector vm://localhost Started
INFO - ContextLoader - Root WebApplicationContext:
initialization completed in 3479 ms
INFO - DispatcherServlet - FrameworkServlet
'jms-webapp': initialization started
INFO - XmlWebApplicationContext - Refreshing
WebApplicationContext for namespace 'jms-webapp-servlet': startup date
[Tue Aug 20 12:31:18 IST 20
13]; parent: Root WebApplicationContext
INFO - XmlBeanDefinitionReader - Loading XML bean definitions
from ServletContext resource [/WEB-INF/jms-webapp-servlet.xml]
INFO - DefaultListableBeanFactory - Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@e975db:
defining beans
[jmsMessageSenderController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context
.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.contex
t.annotation.internalCommonAnnotationProcessor,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web
.servlet.view.InternalResourceViewResolver#0,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0];
p
arent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@bc6a12
INFO - DefaultAnnotationHandlerMapping - Mapped URL path [/send.html]
onto handler 'jmsMessageSenderController'
INFO - DispatcherServlet - FrameworkServlet
'jms-webapp': initialization completed in 375 ms
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\docs
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\examples
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\host-manager
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\manager
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\ROOT
Aug 20, 2013 12:31:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 20, 2013 12:31:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4825 ms
INFO - DiscoveryNetworkConnector - Establishing network
connection from vm://172.16.121.144?async=false&network=true to
tcp://172.16.121.146:616
16
INFO - TransportConnector - Connector vm://172.16.121.144
Started
INFO - Transport - Transport failed:
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#7) di
sposed.
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#7) disposed.
at
org.apache.activemq.transport.vm.VMTransport.stop(VMTransport.java:159)
at
org.apache.activemq.transport.vm.VMTransportServer$1.stop(VMTransportServer.java:81)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.ResponseCorrelator.stop(ResponseCorrelator.java:132)
at
org.apache.activemq.util.ServiceSupport.dispose(ServiceSupport.java:43)
at
org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:137)
at
org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent$1.run(SimpleDiscoveryAgent.java:164)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
INFO - DemandForwardingBridgeSupport - Network connection between
vm://172.16.121.144#6 and tcp://172.16.121.146:61616 shutdown due to a
local error
: org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#6) disposed.
INFO - TransportConnector - Connector vm://172.16.121.144
Stopped
INFO - DemandForwardingBridgeSupport - 172.16.121.144 bridge to
Unknown stopped
in active MQ
I just used this sample code to implement Active MQ
http://www.tomcatexpert.com/blog/2010/12/20/integrating-activemq-tomcat-using-global-jndi#ex-tomcat-server-xml.
Able to send and receive the message successfully with tomcat server.
Now I required to implement Shared File System Master Slave. For that I
have followed below steps to change activemq.xml configuration
http://note19.com/2007/06/24/activemq-masterslave-setup/
Added networkConnector and transportConnector in activemq.xml
<networkConnectors>
<networkConnector name="My Queue"
uri="static://(tcp://172.16.121.144:61616,tcp://172.16.121.146:61616)"
/>
</networkConnectors>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://172.16.121.144:61616"/>
</transportConnectors>
activemq.xml
<?xml version="1.0"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="172.16.121.144"
dataDirectory="\\172.16.121.145\Shared
Doc\amq\activemq\activemq-data"
schedulerSupport="false"
useJmx="true">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
</policyEntry>
<policyEntry queue=">">
<pendingQueuePolicy>
<vmQueueCursor />
</pendingQueuePolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<networkConnectors>
<networkConnector name="My Queue"
uri="static://(tcp://172.16.121.144:61616,tcp://172.16.121.146:61616)"
/>
</networkConnectors>
<persistenceAdapter>
<kahaDB directory="\\172.16.121.145\Shared
Doc\amq\activemq\activemq-data\kahadb"/>
</persistenceAdapter>
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="128 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://172.16.121.144:61616"/>
</transportConnectors>
</broker>
</beans>
Getting below exception
INFO - ContextLoader - Root WebApplicationContext:
initialization started
INFO - XmlWebApplicationContext - Refreshing Root
WebApplicationContext: startup date [Tue Aug 20 12:31:15 IST 2013];
root of context hierarchy
INFO - XmlBeanDefinitionReader - Loading XML bean definitions
from ServletContext resource [/WEB-INF/spring/jms-context.xml]
INFO - DefaultListableBeanFactory - Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@bc6a12:defining
beans
[connectionFactory,fooQueue,singleConnectionFactory,jmsTemplate,messageSenderService,jmsMessageDelegate,myMessageListener,org.springfra
mework.jms.listener.DefaultMessageListenerContainer#0]; root of
factory hierarchy
INFO - DefaultLifecycleProcessor - Starting beans in phase
2147483647
INFO - DefaultListableBeanFactory - Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1bc3ec9:
defining beans
[org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.apache.activemq.xbean.XBeanBrokerService#0];
root of factory hierarchy
INFO - BrokerService - Using Persistence Adapter:
KahaDBPersistenceAdapter[\\172.16.121.145\SharedDoc\amq\activemq\activemq-data\ka
hadb]
INFO - BrokerService - ActiveMQ 5.4.1 JMS Message
Broker (172.16.121.144) is starting
INFO - BrokerService - For help or more information
please see: http://activemq.apache.org/
INFO - TransportServerThreadSupport - Listening for connections at:
tcp://01hw385526.India.TCS.com:61616
INFO - TransportConnector - Connector openwire Started
INFO - DiscoveryNetworkConnector - Establishing network
connection from vm://172.16.121.144?async=false&network=true to
tcp://172.16.121.144:616
16
INFO - TransportConnector - Connector vm://172.16.121.144
Started
INFO - DiscoveryNetworkConnector - Establishing network
connection from vm://172.16.121.144?async=false&network=true to
tcp://172.16.121.146:616
16
INFO - DemandForwardingBridgeSupport - 172.16.121.144 bridge to
172.16.121.144 stopped
INFO - Transport - Transport failed:
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#3) di
sposed.
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#3) disposed.
at
org.apache.activemq.transport.vm.VMTransport.stop(VMTransport.java:159)
at
org.apache.activemq.transport.vm.VMTransportServer$1.stop(VMTransportServer.java:81)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.ResponseCorrelator.stop(ResponseCorrelator.java:132)
at
org.apache.activemq.util.ServiceSupport.dispose(ServiceSupport.java:43)
at
org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:137)
at
org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent.start(SimpleDiscoveryAgent.java:77)
at
org.apache.activemq.network.DiscoveryNetworkConnector.handleStart(DiscoveryNetworkConnector.java:186)
at
org.apache.activemq.network.NetworkConnector$1.doStart(NetworkConnector.java:61)
at
org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
at
org.apache.activemq.network.NetworkConnector.start(NetworkConnector.java:202)
at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2094)
at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:518)
at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
:1581)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522
)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:121)
at
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:53)
at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy4.createConnection(Unknown Source)
at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:404)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:372)
at
org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:760)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:279)
at
org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:264)
at
org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:561)
at
org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:167)
at
org.springframework.context.support.DefaultLifecycleProcessor.access$1(DefaultLifecycleProcessor.java:154)
at
org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:339)
at
org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143)
at
org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:926)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
INFO - TransportConnector - Connector vm://172.16.121.144
Stopped
INFO - DemandForwardingBridgeSupport - Network connection between
vm://172.16.121.144#2 and tcp://172.16.121.146:61616 shutdown due to a
local error
: org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#2) disposed.
INFO - DemandForwardingBridgeSupport - 172.16.121.144 bridge to
Unknown stopped
INFO - NetworkConnector - Network Connector My Queue
Started
INFO - BrokerService - ActiveMQ JMS Message Broker
(172.16.121.144, ID:01hw385526-51685-1376982077589-0:0) started
INFO - TransportConnector - Connector vm://localhost Started
INFO - ContextLoader - Root WebApplicationContext:
initialization completed in 3479 ms
INFO - DispatcherServlet - FrameworkServlet
'jms-webapp': initialization started
INFO - XmlWebApplicationContext - Refreshing
WebApplicationContext for namespace 'jms-webapp-servlet': startup date
[Tue Aug 20 12:31:18 IST 20
13]; parent: Root WebApplicationContext
INFO - XmlBeanDefinitionReader - Loading XML bean definitions
from ServletContext resource [/WEB-INF/jms-webapp-servlet.xml]
INFO - DefaultListableBeanFactory - Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@e975db:
defining beans
[jmsMessageSenderController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context
.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.contex
t.annotation.internalCommonAnnotationProcessor,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web
.servlet.view.InternalResourceViewResolver#0,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0];
p
arent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@bc6a12
INFO - DefaultAnnotationHandlerMapping - Mapped URL path [/send.html]
onto handler 'jmsMessageSenderController'
INFO - DispatcherServlet - FrameworkServlet
'jms-webapp': initialization completed in 375 ms
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\docs
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\examples
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\host-manager
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\manager
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
C:\apache-tomcat-7.0.25\webapps\ROOT
Aug 20, 2013 12:31:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 20, 2013 12:31:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 20, 2013 12:31:19 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4825 ms
INFO - DiscoveryNetworkConnector - Establishing network
connection from vm://172.16.121.144?async=false&network=true to
tcp://172.16.121.146:616
16
INFO - TransportConnector - Connector vm://172.16.121.144
Started
INFO - Transport - Transport failed:
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#7) di
sposed.
org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#7) disposed.
at
org.apache.activemq.transport.vm.VMTransport.stop(VMTransport.java:159)
at
org.apache.activemq.transport.vm.VMTransportServer$1.stop(VMTransportServer.java:81)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)
at
org.apache.activemq.transport.ResponseCorrelator.stop(ResponseCorrelator.java:132)
at
org.apache.activemq.util.ServiceSupport.dispose(ServiceSupport.java:43)
at
org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:137)
at
org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent$1.run(SimpleDiscoveryAgent.java:164)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
INFO - DemandForwardingBridgeSupport - Network connection between
vm://172.16.121.144#6 and tcp://172.16.121.146:61616 shutdown due to a
local error
: org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://172.16.121.144#6) disposed.
INFO - TransportConnector - Connector vm://172.16.121.144
Stopped
INFO - DemandForwardingBridgeSupport - 172.16.121.144 bridge to
Unknown stopped
Monday, 19 August 2013
solr tagging & excluding filters for range facets
solr tagging & excluding filters for range facets
I'm creating a uneven range facet and I want to support multiple selection
for it. However, facet on the tags/exclusions for filters stop working.
Following is my price facet ranges 0-20 20-50 50-100 100-* Initially I am
populating above range with using facet query. Now whenever end user are
selecting 0-20 and 20-50, I am generating the following
http://localhost:8983/solr/catalog/select?q=games&facet=true&wt=xml&rows=0&
fq={!tag=salePrice}salePrice:[0 TO 20]&facet.query={!ex=salePrice}[0
to 20]&
fq={!ex=salePrice}salePrice:[20 TO 50]&facet.query={!ex=salePrice}[20 to
50]&other params.
& system is returning zero results.
I am seeing following SOLR JIRA bug closed as fixed.
https://issues.apache.org/jira/browse/SOLR-3819
However, in case,only one facet.query is in action. In my example, i am
using multiple facet.query with uneven ranges. Please help.
I'm creating a uneven range facet and I want to support multiple selection
for it. However, facet on the tags/exclusions for filters stop working.
Following is my price facet ranges 0-20 20-50 50-100 100-* Initially I am
populating above range with using facet query. Now whenever end user are
selecting 0-20 and 20-50, I am generating the following
http://localhost:8983/solr/catalog/select?q=games&facet=true&wt=xml&rows=0&
fq={!tag=salePrice}salePrice:[0 TO 20]&facet.query={!ex=salePrice}[0
to 20]&
fq={!ex=salePrice}salePrice:[20 TO 50]&facet.query={!ex=salePrice}[20 to
50]&other params.
& system is returning zero results.
I am seeing following SOLR JIRA bug closed as fixed.
https://issues.apache.org/jira/browse/SOLR-3819
However, in case,only one facet.query is in action. In my example, i am
using multiple facet.query with uneven ranges. Please help.
Launch YouTube Mobile App from my website
Launch YouTube Mobile App from my website
I am in the middle of building a website. The website has embedded YouTube
videos. When I'm on my computer I can click and they play and it's all
very lovely. They open up in a Javascript window "prettyPhoto"
The current scripts look like this:
<a href="http://www.youtube.com/video" rel="prettyPhoto" title="video title">
<img src="<?php echo $domain ?>assets/images/youtubethumbnail.jpg">
</a>
When I visit the website on a mobile device such as Android, or iPhone,
iPad etc the video also plays but it plays on the page which on these
screens is very small and not pleasing to the eye. Of course you can zoom
and pan around but that is not problem solving, its just dealing with it.
How can I code in to make the website launch the native YouTube app on the
mobile devices?
I am assuming that something's going to have to go amidst the rel or title
codes that is similar to checking the browser like chrome, firefox, ie,
mobile...
Either this or I'm going to rethink another way of displaying the videos
on this site.
I am in the middle of building a website. The website has embedded YouTube
videos. When I'm on my computer I can click and they play and it's all
very lovely. They open up in a Javascript window "prettyPhoto"
The current scripts look like this:
<a href="http://www.youtube.com/video" rel="prettyPhoto" title="video title">
<img src="<?php echo $domain ?>assets/images/youtubethumbnail.jpg">
</a>
When I visit the website on a mobile device such as Android, or iPhone,
iPad etc the video also plays but it plays on the page which on these
screens is very small and not pleasing to the eye. Of course you can zoom
and pan around but that is not problem solving, its just dealing with it.
How can I code in to make the website launch the native YouTube app on the
mobile devices?
I am assuming that something's going to have to go amidst the rel or title
codes that is similar to checking the browser like chrome, firefox, ie,
mobile...
Either this or I'm going to rethink another way of displaying the videos
on this site.
Subscribe to:
Posts (Atom)