Javascript return enclosing function
I have a simple scenario in which I check if something exists before
adding it, if it does, I return the function (hence exiting). I use this
pattern many times and I would like to decouple it in another simple
function.
function onEvent(e){
if( this.has(e) )
return
this.add(e);
// More logic different on an event-basis
}
I would like to decouple it like so:
function safeAdd(e){
if( this.has(e) )
return
this.add(e);
}
function onEvent(e){
safeAdd(e);
// More logic
}
But obviously doing so just returns safeAdd and doesn't exit from onEvent,
and the rest of the logic gets executed anyways.
I know I could do something like:
function safeAdd(e){
if( this.has(e) )
return false
this.add(e);
return true
}
function onEvent(e){
if( !safeAdd(e) )
return
// More logic
}
But, since I repeat this a lot, I would like to be as concise as possible.
Saturday, 31 August 2013
Jenkins: How to modify PATH environment variable for build steps?
Jenkins: How to modify PATH environment variable for build steps?
I'm trying to follow the instructions here to prepend a directory to path
for my build steps. However, the instructions reference the deprecated
SetEnv plugin. I tried playing with the new EnvInject plugin, setting
PATH=mydir:$PATH in Script Content field of the "Inject Build Environments
to the build process" section. However, the path is not updated when my
build step shell scripts execute.
I'm trying to follow the instructions here to prepend a directory to path
for my build steps. However, the instructions reference the deprecated
SetEnv plugin. I tried playing with the new EnvInject plugin, setting
PATH=mydir:$PATH in Script Content field of the "Inject Build Environments
to the build process" section. However, the path is not updated when my
build step shell scripts execute.
Is it possible to add an html class to the tables generated by phpMyEdit?
Is it possible to add an html class to the tables generated by phpMyEdit?
I'd like to use Bootstrap 3 to style the tables created by PHPMyEdit
(Bootstra 3 requires a "table" class added to the table to style), but I
can't find a way to add a class to the table it creates. I could write my
own styles to target its auto-added classes, but I'd rather not do it that
way.
phpmyedit for those unfamiliar: http://www.phpmyedit.org/
I'd like to use Bootstrap 3 to style the tables created by PHPMyEdit
(Bootstra 3 requires a "table" class added to the table to style), but I
can't find a way to add a class to the table it creates. I could write my
own styles to target its auto-added classes, but I'd rather not do it that
way.
phpmyedit for those unfamiliar: http://www.phpmyedit.org/
Perforce Server connection error in Mac OS X
Perforce Server connection error in Mac OS X
Good Day everyone!
I am trying to configure perforce server in OS X(10.8.4) . I tried to
follow instructions from here. In fact i am not sure if i am doing it
right ! Please check the commands below that i entered in Terminal.
Last login: Sun Sep 1 02:13:19 on ttys000
MDs-MacBook-Pro:~ Emon$ export PATH=~/perforce:$PATH export P4PORT=1666
MDs-MacBook-Pro:~ Emon$ cd ~/perforce chmod a+x p4d p4d -d
MDs-MacBook-Pro:perforce Emon$ chmod a+x p4
MDs-MacBook-Pro:perforce Emon$ mkdir ~/myws cd ~/myws p4 client myws
mkdir: /Users/Emon/myws: File exists
mkdir: p4: File exists
MDs-MacBook-Pro:perforce Emon$
After that i tried to to connect from p4v, but the following occurs !
In connection setup assistance i tried (as instructed in the link)
Host : localhost
Port : 1666
And the connection continues to refuse showing this...
Connect to server failed;check $P4PORT.
TCP Connection to localhost:1666 failed.
Connect: 127.0.0.1:1666 : Connection refused.
Please someone guide me in this regard. Thank you in advance. :)
Good Day everyone!
I am trying to configure perforce server in OS X(10.8.4) . I tried to
follow instructions from here. In fact i am not sure if i am doing it
right ! Please check the commands below that i entered in Terminal.
Last login: Sun Sep 1 02:13:19 on ttys000
MDs-MacBook-Pro:~ Emon$ export PATH=~/perforce:$PATH export P4PORT=1666
MDs-MacBook-Pro:~ Emon$ cd ~/perforce chmod a+x p4d p4d -d
MDs-MacBook-Pro:perforce Emon$ chmod a+x p4
MDs-MacBook-Pro:perforce Emon$ mkdir ~/myws cd ~/myws p4 client myws
mkdir: /Users/Emon/myws: File exists
mkdir: p4: File exists
MDs-MacBook-Pro:perforce Emon$
After that i tried to to connect from p4v, but the following occurs !
In connection setup assistance i tried (as instructed in the link)
Host : localhost
Port : 1666
And the connection continues to refuse showing this...
Connect to server failed;check $P4PORT.
TCP Connection to localhost:1666 failed.
Connect: 127.0.0.1:1666 : Connection refused.
Please someone guide me in this regard. Thank you in advance. :)
How to chain two nongeneric functions in opencpu
How to chain two nongeneric functions in opencpu
OpenCPU is said to support chaining of function calls to calculate e.g.
f(g(x), h(y))
The docs about argument formats:
https://public.opencpu.org/api.html#api-arguments includes an example that
illustrates this by calculating
summary(read.csv("mydata.csv"))
In this example f is the generic function summary that takes as an
argument an object.
I need to calculate something like:
mycalc(read.csv("mydata.csv")) or
myplot(read.csv("my data.csv"))
where f take as an argument a dataframe
This doesn't seem to work when giving as object argument the sessionid or
hash key returned by the read.csv function.
How can this chaining of two nongeneric functions be solved ?
OpenCPU is said to support chaining of function calls to calculate e.g.
f(g(x), h(y))
The docs about argument formats:
https://public.opencpu.org/api.html#api-arguments includes an example that
illustrates this by calculating
summary(read.csv("mydata.csv"))
In this example f is the generic function summary that takes as an
argument an object.
I need to calculate something like:
mycalc(read.csv("mydata.csv")) or
myplot(read.csv("my data.csv"))
where f take as an argument a dataframe
This doesn't seem to work when giving as object argument the sessionid or
hash key returned by the read.csv function.
How can this chaining of two nongeneric functions be solved ?
Pointers and LValue Reference
Pointers and LValue Reference
I have this situation.
case 1
void printInt(int & i) {}
int main () {
int i=1;
printInt(&i);
}
the printInt is expecting a reference, so therefore, inside the main, I
call the printInt function and supplied with the reference i. Is this
correct.
then I can also do
case 2
int main () {
int i=1;
printInt(i); // i is a lvalue, and printInt function is
expecting a lvalue
}
so, are case 1 and case 2 seems like conflicting?
I have this situation.
case 1
void printInt(int & i) {}
int main () {
int i=1;
printInt(&i);
}
the printInt is expecting a reference, so therefore, inside the main, I
call the printInt function and supplied with the reference i. Is this
correct.
then I can also do
case 2
int main () {
int i=1;
printInt(i); // i is a lvalue, and printInt function is
expecting a lvalue
}
so, are case 1 and case 2 seems like conflicting?
Gtkmm & async timer IT & string error
Gtkmm & async timer IT & string error
I get a very special error. If I get timer IT very often. And I call a
function (in call back func), which has a string parameter, GTK doesn't
response any trigger.
Here is examplewindow.h
#ifndef GTKMM_EXAMPLEWINDOW_H
#define GTKMM_EXAMPLEWINDOW_H
#include <iostream>
#include <gtkmm.h>
#include <time.h>
#include <signal.h>
using namespace std;
using namespace Glib;
using namespace Gtk;
class ExampleWindow : public Gtk::Window
{
public:
ExampleWindow();
virtual ~ExampleWindow();
protected:
timer_t asyncTim;
struct itimerspec timerStruct;
//Signal handlers:
void on_button_clicked();
//Child widgets:
Gtk::Box m_VBox;
Gtk::Label m_Label;
Gtk::ButtonBox m_ButtonBox;
Gtk::Button m_Button;
// Gtk::AboutDialog m_Dialog;
};
void func(string message);
void asyncCallback(int i);
I get a very special error. If I get timer IT very often. And I call a
function (in call back func), which has a string parameter, GTK doesn't
response any trigger.
Here is examplewindow.h
#ifndef GTKMM_EXAMPLEWINDOW_H
#define GTKMM_EXAMPLEWINDOW_H
#include <iostream>
#include <gtkmm.h>
#include <time.h>
#include <signal.h>
using namespace std;
using namespace Glib;
using namespace Gtk;
class ExampleWindow : public Gtk::Window
{
public:
ExampleWindow();
virtual ~ExampleWindow();
protected:
timer_t asyncTim;
struct itimerspec timerStruct;
//Signal handlers:
void on_button_clicked();
//Child widgets:
Gtk::Box m_VBox;
Gtk::Label m_Label;
Gtk::ButtonBox m_ButtonBox;
Gtk::Button m_Button;
// Gtk::AboutDialog m_Dialog;
};
void func(string message);
void asyncCallback(int i);
Friday, 30 August 2013
HTML Checkbox selected Element keep tick after submit
HTML Checkbox selected Element keep tick after submit
I have check box set when i submit it, i want keep tick what i selected, I
have wrote a code but I want to know any easiest way to do it
<form action="" method="post">
<input type="checkbox" name="car[]"
<?php
if(isset($_POST['submit'])){
if(isset($_POST['car'])){
if(in_array('Bus',$_POST['car']))
{
echo ' checked="checked"" ';
}
}
}
?> value="Bus" />Bus
<input type="checkbox" name="car[]" value="Van"
<?php
if(isset($_POST['submit']))
{
if(isset($_POST['car'])){
if(in_array('Van',$_POST['car']))
{
echo ' checked="checked"" ';
}
}
} ?> />Van
<input type="submit" name="submit" value="Submit" />
</form>
I have check box set when i submit it, i want keep tick what i selected, I
have wrote a code but I want to know any easiest way to do it
<form action="" method="post">
<input type="checkbox" name="car[]"
<?php
if(isset($_POST['submit'])){
if(isset($_POST['car'])){
if(in_array('Bus',$_POST['car']))
{
echo ' checked="checked"" ';
}
}
}
?> value="Bus" />Bus
<input type="checkbox" name="car[]" value="Van"
<?php
if(isset($_POST['submit']))
{
if(isset($_POST['car'])){
if(in_array('Van',$_POST['car']))
{
echo ' checked="checked"" ';
}
}
} ?> />Van
<input type="submit" name="submit" value="Submit" />
</form>
Reload Longlistselector in WP8
Reload Longlistselector in WP8
I had about 6 Longlistselectors in my Panorama App for Wp8. And when the
app start running, they load data from a XML file into 6
ObservableCollection list then apply it to longlistselector item
source.(this working well)
I have a background worker method which is download data from the internet
then update them to the XML file and then save it.
I tried many things, spent a lot of hours to reload that new info from XML
to Longlistselector but failed :( Its seem like I cant reload XML after
save it. Anyone can help me with this? Tks so much. If u need any code,
just tell me, I will provide them all. Sry for my bad english.
private async void BwDoWork(object sender, DoWorkEventArgs e)
{
var xdoc = XDocument.Load("APPSDATA.xml");
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++)
{
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;
var file = new FileStream("APPSDATA.xml", FileMode.Open);
xdoc.Save(file);
}
}
I had about 6 Longlistselectors in my Panorama App for Wp8. And when the
app start running, they load data from a XML file into 6
ObservableCollection list then apply it to longlistselector item
source.(this working well)
I have a background worker method which is download data from the internet
then update them to the XML file and then save it.
I tried many things, spent a lot of hours to reload that new info from XML
to Longlistselector but failed :( Its seem like I cant reload XML after
save it. Anyone can help me with this? Tks so much. If u need any code,
just tell me, I will provide them all. Sry for my bad english.
private async void BwDoWork(object sender, DoWorkEventArgs e)
{
var xdoc = XDocument.Load("APPSDATA.xml");
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++)
{
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;
var file = new FileStream("APPSDATA.xml", FileMode.Open);
xdoc.Save(file);
}
}
Thursday, 29 August 2013
Get index of empty space returns wrong value
Get index of empty space returns wrong value
In JS I have a text line and I want to get the index of the first
occurrence of an empty space.
For example, this is my line:
gram somethin b
And this is my code:
index = line.indexOf(" ");
if (index == -1)
index = line.indexOf("\u00a0");
The problem here is that the result of the code is 13, but it should be 4.
Why doesnt it recognize the empty space after 'gram' as empty space? How
can I check?
In JS I have a text line and I want to get the index of the first
occurrence of an empty space.
For example, this is my line:
gram somethin b
And this is my code:
index = line.indexOf(" ");
if (index == -1)
index = line.indexOf("\u00a0");
The problem here is that the result of the code is 13, but it should be 4.
Why doesnt it recognize the empty space after 'gram' as empty space? How
can I check?
Wednesday, 28 August 2013
Why MySQL is changing the column name with value?
Why MySQL is changing the column name with value?
I have the following piece of code written somewhere in PHP:
$sql="UPDATE drivers ".
"SET Location=$lo ".
"WHERE DriverId=$id";
echo $sql;
The outcome of echo is
UPDATE drivers SET Location=locA WHERE DriverId=3
However when I run
$result = mysqli_query($con2,$sql);
echo $result;
echo mysqli_error($con2);
I get
Unknown column 'locA' in 'field list'
Why am I getting 'locA' instead of Location as column name ?
I have the following piece of code written somewhere in PHP:
$sql="UPDATE drivers ".
"SET Location=$lo ".
"WHERE DriverId=$id";
echo $sql;
The outcome of echo is
UPDATE drivers SET Location=locA WHERE DriverId=3
However when I run
$result = mysqli_query($con2,$sql);
echo $result;
echo mysqli_error($con2);
I get
Unknown column 'locA' in 'field list'
Why am I getting 'locA' instead of Location as column name ?
Why are the contents of this shell script unreadable?
Why are the contents of this shell script unreadable?
Can I just open aFile.sh, to see the bash script again? ( are receipts
from mac apps sh files ?)
If so, how?
I try'd text editor already, but it comes out like this, this is not
really readable
0Ç *ÜHܘ
†Ç0Ç10 +0Ç« *ÜHܘ
†Ç∏Ç¥1Ç∞00
4+0%O0
'0
9Ä√0lÊ.0Mï2Ò0
P20002.1.10!ßEècÑ0öYÃ˝ôê=ÌÆùãs»ã∑y02011-06-25T14:54:46Z0
thanks
Can I just open aFile.sh, to see the bash script again? ( are receipts
from mac apps sh files ?)
If so, how?
I try'd text editor already, but it comes out like this, this is not
really readable
0Ç *ÜHܘ
†Ç0Ç10 +0Ç« *ÜHܘ
†Ç∏Ç¥1Ç∞00
4+0%O0
'0
9Ä√0lÊ.0Mï2Ò0
P20002.1.10!ßEècÑ0öYÃ˝ôê=ÌÆùãs»ã∑y02011-06-25T14:54:46Z0
thanks
How to get class reference for a generic class
How to get class reference for a generic class
I am new to java (coming from an Actionscript 3.0 background) and I am
trying to port some actionscript code to java (as3signals to jsignal)
I am trying to get the class name of a generic class in order to pass it
to a super call.
In Actionscript 3.0 this would be
super(Vector.<TileVO>,Boolean);
The above piece of code would pass the class references to the constructor
for the Vector of TileVO and Boolean.
In Java this doesn't seem to work and I know I am doing something wrong:
super(ASVector.class<TileVO>,boolean.class);
To write it short, how do you get the class reference for an ASVector
class composed of TileVO objects?
Thank you!
Later Edit:
I just realised that code was not displayed properly (treated as html)
Posting some source code:
public Signal(Class<?>... params) {
this.params = params;
}
I need to pass to the Signal class references via the constructor.
new Signal(int.class) for example works
I need to know how can I pass to Signal's constructor the class of an
object of this form:
ASVector<TileVO>
I tried ASVector.class<TileVO> and it doesn't seem to work!
I am new to java (coming from an Actionscript 3.0 background) and I am
trying to port some actionscript code to java (as3signals to jsignal)
I am trying to get the class name of a generic class in order to pass it
to a super call.
In Actionscript 3.0 this would be
super(Vector.<TileVO>,Boolean);
The above piece of code would pass the class references to the constructor
for the Vector of TileVO and Boolean.
In Java this doesn't seem to work and I know I am doing something wrong:
super(ASVector.class<TileVO>,boolean.class);
To write it short, how do you get the class reference for an ASVector
class composed of TileVO objects?
Thank you!
Later Edit:
I just realised that code was not displayed properly (treated as html)
Posting some source code:
public Signal(Class<?>... params) {
this.params = params;
}
I need to pass to the Signal class references via the constructor.
new Signal(int.class) for example works
I need to know how can I pass to Signal's constructor the class of an
object of this form:
ASVector<TileVO>
I tried ASVector.class<TileVO> and it doesn't seem to work!
Invoking asynchronous method from servlet
Invoking asynchronous method from servlet
Context:
I have done alot of reading, but only found this semi-relevant.
I have a servlet that calls a method from another Java class, while
passing session-sensitive data. It is running on the Tomcat server.
It looks something like this:
@WebServlet(urlPatterns = {"/MyServlet", "/"})
public class MyServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException{
HttpSession session = request.getSession(true); //Start a session
String UserID = session.getId(); //Get a unique
user ID
MyClass class = new MyClass(); //Initialize my class
String shortID = class.newID(UserID); //Call a method
from class
System.out.println("Your short ID is: " + shortID); //Print the
result
}
}
And say the class that I'm calling looks like this:
public class MyClass {
public String newID(String UserID){
String shortID;
... //Method for shortening the UserID
return(shortID);
}
}
The method of course requires much more processing than shown in this
trivial example.
Question 1:
Now, my current understanding is that when n users call MyServlet
simultaneously, Tomcat creates n threads in doGet method. So when method
newID is called synchronously, Tomcat queues the threads and and allows
them to execute one after another. Is this correct?
Question 2:
The problem arises when I have a large number of users, as the n th user
will have to wait for newID method to be completed n-1 times, which might
take a while. Therefore I will want to call the newID method
asynchronously in order to run n threads in parallel, so to increase the
throughput.
How can I achieve this?
Would you recommend using reflections, or wrapping the newID method inside
a Runnable?
Does Tomcat take care of ExecutorService, or do I need to implement it too?
Any help will be much appreciated. Example code will be useful too!
Context:
I have done alot of reading, but only found this semi-relevant.
I have a servlet that calls a method from another Java class, while
passing session-sensitive data. It is running on the Tomcat server.
It looks something like this:
@WebServlet(urlPatterns = {"/MyServlet", "/"})
public class MyServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException{
HttpSession session = request.getSession(true); //Start a session
String UserID = session.getId(); //Get a unique
user ID
MyClass class = new MyClass(); //Initialize my class
String shortID = class.newID(UserID); //Call a method
from class
System.out.println("Your short ID is: " + shortID); //Print the
result
}
}
And say the class that I'm calling looks like this:
public class MyClass {
public String newID(String UserID){
String shortID;
... //Method for shortening the UserID
return(shortID);
}
}
The method of course requires much more processing than shown in this
trivial example.
Question 1:
Now, my current understanding is that when n users call MyServlet
simultaneously, Tomcat creates n threads in doGet method. So when method
newID is called synchronously, Tomcat queues the threads and and allows
them to execute one after another. Is this correct?
Question 2:
The problem arises when I have a large number of users, as the n th user
will have to wait for newID method to be completed n-1 times, which might
take a while. Therefore I will want to call the newID method
asynchronously in order to run n threads in parallel, so to increase the
throughput.
How can I achieve this?
Would you recommend using reflections, or wrapping the newID method inside
a Runnable?
Does Tomcat take care of ExecutorService, or do I need to implement it too?
Any help will be much appreciated. Example code will be useful too!
GTK# TreeView and StoreList won''t show data
GTK# TreeView and StoreList won''t show data
My goal is to query table and add it to ListView. I only get an empty
ListView with column names and errors. I used the tutorial, but it doesn't
help. I realized that empty rows are added because I can click on them.
using (MySqlConnection connect = new
MySqlConnection(connectionString))
{
connect.Open();
// QUERY GENERATION
mySqlCommand = new MySqlCommand(query, connect);
// QUERY PARAMETERS ADDED
ListStore store = new Gtk.ListStore(typeof(string[]));
for (int i = 0; i < tempselect.Length; i++) {
_treeView.AppendColumn(tempselect[i], new
Gtk.CellRendererText(), "text");
}
MySqlDataReader reader = mySqlCommand.ExecuteReader();
while (reader.Read())
{
store.AppendValues(reader);
}
reader.Close();
_treeView.Model = store;
connect.Close();
}
There are no errors. The application just doesn't show data. There are
data in the table. I'm trying to fix this for a whole day. Nothing works.
Thank you.
My goal is to query table and add it to ListView. I only get an empty
ListView with column names and errors. I used the tutorial, but it doesn't
help. I realized that empty rows are added because I can click on them.
using (MySqlConnection connect = new
MySqlConnection(connectionString))
{
connect.Open();
// QUERY GENERATION
mySqlCommand = new MySqlCommand(query, connect);
// QUERY PARAMETERS ADDED
ListStore store = new Gtk.ListStore(typeof(string[]));
for (int i = 0; i < tempselect.Length; i++) {
_treeView.AppendColumn(tempselect[i], new
Gtk.CellRendererText(), "text");
}
MySqlDataReader reader = mySqlCommand.ExecuteReader();
while (reader.Read())
{
store.AppendValues(reader);
}
reader.Close();
_treeView.Model = store;
connect.Close();
}
There are no errors. The application just doesn't show data. There are
data in the table. I'm trying to fix this for a whole day. Nothing works.
Thank you.
css sub menu links displaying under text below the menu
css sub menu links displaying under text below the menu
I have a CSS Menu with sub menu links but if there is text below the menu,
the sub menu displays under the text and i cannot hover over the links
here is the CSS:
.vertical-nav {
height:auto;
list-style:none;
width: 100%; /******* MODIFIED ********/
margin: 20px 0 0 0;
}
.vertical-nav li {
height: 25px;
margin: 0;
padding: 5px 0;
background-color: #666;
border: none;
text-align: center;
display: inline-block;
float: left;
width: 100px; /******* MODIFIED ********/
}
.vertical-nav li:hover {
background-color:#f36f25;
color:#FFFFFF;
}
.vertical-nav li a {
font-family:Calibri, Arial;
font-size:18px;
font-weight:bold;
color:#ffffff;
text-decoration:none;
}
.vertical-nav li.current {
background-color:#F36F25;
}
.vertical-nav li.current a {
color:#FFFFFF;
}
vertical-nav ul li ul {
display:none;
list-style-type:none;
width:125px;
padding:0px;
margin-top:3px;
margin-left:-5px;
}
vertical-nav ul li:hover ul {
display:block;
}
vertical-nav ul li:hover ul li {
background-color:#555555;
width:125px;
height:30px;
display:inline-block;
}
vertical-nav ul li ul li:hover {
background-color:#333333;
}
vertical-nav ul li ul li a {
color:#FFF;
text-decoration:underline;
}
vertical-nav ul li ul li a:hover {
text-decoration:none;
}
.vertical-nav li ul {
display: none;
margin-top: 10px;
padding: 0;
}
.vertical-nav li:hover ul {
display: block;
}
.vertical-nav li:hover .sub-menu
{
display: table;
}
.sub-menu li
{
width: 100%;
min-width: 180px;
white-space: nowrap;
display:table-row;
}
.sub-menu li a
{
display:inline-block;
padding: 0 10px;
}
and a jsFiddle: http://jsfiddle.net/7z2sE/
how can i make the sub menu links display over any text that is below...
I have a CSS Menu with sub menu links but if there is text below the menu,
the sub menu displays under the text and i cannot hover over the links
here is the CSS:
.vertical-nav {
height:auto;
list-style:none;
width: 100%; /******* MODIFIED ********/
margin: 20px 0 0 0;
}
.vertical-nav li {
height: 25px;
margin: 0;
padding: 5px 0;
background-color: #666;
border: none;
text-align: center;
display: inline-block;
float: left;
width: 100px; /******* MODIFIED ********/
}
.vertical-nav li:hover {
background-color:#f36f25;
color:#FFFFFF;
}
.vertical-nav li a {
font-family:Calibri, Arial;
font-size:18px;
font-weight:bold;
color:#ffffff;
text-decoration:none;
}
.vertical-nav li.current {
background-color:#F36F25;
}
.vertical-nav li.current a {
color:#FFFFFF;
}
vertical-nav ul li ul {
display:none;
list-style-type:none;
width:125px;
padding:0px;
margin-top:3px;
margin-left:-5px;
}
vertical-nav ul li:hover ul {
display:block;
}
vertical-nav ul li:hover ul li {
background-color:#555555;
width:125px;
height:30px;
display:inline-block;
}
vertical-nav ul li ul li:hover {
background-color:#333333;
}
vertical-nav ul li ul li a {
color:#FFF;
text-decoration:underline;
}
vertical-nav ul li ul li a:hover {
text-decoration:none;
}
.vertical-nav li ul {
display: none;
margin-top: 10px;
padding: 0;
}
.vertical-nav li:hover ul {
display: block;
}
.vertical-nav li:hover .sub-menu
{
display: table;
}
.sub-menu li
{
width: 100%;
min-width: 180px;
white-space: nowrap;
display:table-row;
}
.sub-menu li a
{
display:inline-block;
padding: 0 10px;
}
and a jsFiddle: http://jsfiddle.net/7z2sE/
how can i make the sub menu links display over any text that is below...
Tuesday, 27 August 2013
R Help:To forecast data for next two years from given given data
R Help:To forecast data for next two years from given given data
Is there any way getting values from Oracle schema and forecast for next 2
years on month basis (x axis) and load the same forecasted values to new
schema with forecasted dates in R language and need to plot it with x axis
having Months? for example : I have data in ORACLE: date Value 2012-01-07
496 2012-07-25 450 2012-09-12 760 2012-11-27 320 2013-02-28 560 2013-06-12
120 these are only sample data from oracle table and need to forecast next
2 years till 2015-06-30 and need plot in R language on month in x -axis.
Thanks in Advance..plz need urgent
Is there any way getting values from Oracle schema and forecast for next 2
years on month basis (x axis) and load the same forecasted values to new
schema with forecasted dates in R language and need to plot it with x axis
having Months? for example : I have data in ORACLE: date Value 2012-01-07
496 2012-07-25 450 2012-09-12 760 2012-11-27 320 2013-02-28 560 2013-06-12
120 these are only sample data from oracle table and need to forecast next
2 years till 2015-06-30 and need plot in R language on month in x -axis.
Thanks in Advance..plz need urgent
Name Manager function
Name Manager function
When using the "name manager function" in Excel and after "saving changes"
made with the name manager function, is there a way to "undo" those saves,
without having to completely back out of the file and having to start over
again?
For example, if after I save my changes that were made with the name
manager function, can the file I am working on be "returned to previous
information" simply by clicking the "undo symbol" at the top for the
necessary number of times it takes to return the file to the previous
status I started with? Or, are saving those changes from the name manager
function "not un-doable" which would result in me having to start all over
again with my original file.
I tried "undoing" those changes earlier today on a file, but it didn't
seem to work. So, I backed out completely and started all over again with
my file and was able to start from scratch again that way - but it would
be a lot easier if I were to be able to simply "un-do" the "saved changes"
from name manager function.
When using the "name manager function" in Excel and after "saving changes"
made with the name manager function, is there a way to "undo" those saves,
without having to completely back out of the file and having to start over
again?
For example, if after I save my changes that were made with the name
manager function, can the file I am working on be "returned to previous
information" simply by clicking the "undo symbol" at the top for the
necessary number of times it takes to return the file to the previous
status I started with? Or, are saving those changes from the name manager
function "not un-doable" which would result in me having to start all over
again with my original file.
I tried "undoing" those changes earlier today on a file, but it didn't
seem to work. So, I backed out completely and started all over again with
my file and was able to start from scratch again that way - but it would
be a lot easier if I were to be able to simply "un-do" the "saved changes"
from name manager function.
Rebuilding a BST into AVL
Rebuilding a BST into AVL
How will you rebuild a given BST into AVL which contains exactly the same
keys? The algorithm running time should be O(n) and its allowed to use
O(n) additional space. Any ideas? The whole pseudo-code is not necessary,
any idea or suggestion would be appreciated! Thanks!
How will you rebuild a given BST into AVL which contains exactly the same
keys? The algorithm running time should be O(n) and its allowed to use
O(n) additional space. Any ideas? The whole pseudo-code is not necessary,
any idea or suggestion would be appreciated! Thanks!
Search functionality in Android Custom ListView
Search functionality in Android Custom ListView
I have CursorAdapter to show data from database. Now, I want add search
functionality to custom listview. So, I tried with this. but, this is not
working.
searchOption.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs, int start, int
before, int count) {
// TODO Auto-generated method stub
AbstractActivity.this.cursorAdapter.getFilter().filter(cs);
}
@Override
public void beforeTextChanged(CharSequence s, int start, int
count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
I will be glad if you guys help to find out what's the problem in my code
or how can i add search functionality to a custom listview.
I have CursorAdapter to show data from database. Now, I want add search
functionality to custom listview. So, I tried with this. but, this is not
working.
searchOption.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs, int start, int
before, int count) {
// TODO Auto-generated method stub
AbstractActivity.this.cursorAdapter.getFilter().filter(cs);
}
@Override
public void beforeTextChanged(CharSequence s, int start, int
count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
I will be glad if you guys help to find out what's the problem in my code
or how can i add search functionality to a custom listview.
Monday, 26 August 2013
COUNT returning array?
COUNT returning array?
I'm trying to get the number of images in each gallery by using the below
query in a
$total = $connect->query("SELECT COUNT(*) FROM photos WHERE gallery =
'$row[id]'");
To print this out I'm then using $total[0] which returns Array - how do I
retrieve the number?
I'm trying to get the number of images in each gallery by using the below
query in a
$total = $connect->query("SELECT COUNT(*) FROM photos WHERE gallery =
'$row[id]'");
To print this out I'm then using $total[0] which returns Array - how do I
retrieve the number?
Functions returns empty set
Functions returns empty set
I have successfully created a function in SQL 2008:
ALTER FUNCTION [dbo].func_RAW_data_xref
(
@ColName as Nvarchar(255)
)
RETURNS @VVSrcCDs TABLE
(
vv_SRC_CD NVARCHAR(255) NULL,
vv_CD NVARCHAR(255) NULL,
vv_SRC_CD_DESC NVARCHAR(255) NULL,
vv_DSC NVARCHAR(255) NULL
)
AS
BEGIN
DECLARE
@vv_SRC_CD NVARCHAR(255),
@vv_CD NVARCHAR(255),
@vv_SRC_CD_DESC NVARCHAR(255),
@vv_DSC NVARCHAR(255);
SELECT
@vv_SRC_CD = A.vv_SRC_CD,
@vv_CD = A.vv_CD,
@vv_SRC_CD_DESC = A.vv_SRC_CD_DESC,
@vv_DSC = A.vv_DSC
FROM DBO.values A
JOIN VVLookup B
ON A.vv_SRC_CD = b.vv_SRC_CD
WHERE B.[Client Column Name] = @ColName
RETURN;
END
The problem is when I call the function:
select * from dbo.func_RAW_data_xref('_CD');
I get no results. What I do get are the columns referenced in the function
but no data. If I copy the select statement out of the function and run it
with a valid parameter for @ColName, I do get results.
I have successfully created a function in SQL 2008:
ALTER FUNCTION [dbo].func_RAW_data_xref
(
@ColName as Nvarchar(255)
)
RETURNS @VVSrcCDs TABLE
(
vv_SRC_CD NVARCHAR(255) NULL,
vv_CD NVARCHAR(255) NULL,
vv_SRC_CD_DESC NVARCHAR(255) NULL,
vv_DSC NVARCHAR(255) NULL
)
AS
BEGIN
DECLARE
@vv_SRC_CD NVARCHAR(255),
@vv_CD NVARCHAR(255),
@vv_SRC_CD_DESC NVARCHAR(255),
@vv_DSC NVARCHAR(255);
SELECT
@vv_SRC_CD = A.vv_SRC_CD,
@vv_CD = A.vv_CD,
@vv_SRC_CD_DESC = A.vv_SRC_CD_DESC,
@vv_DSC = A.vv_DSC
FROM DBO.values A
JOIN VVLookup B
ON A.vv_SRC_CD = b.vv_SRC_CD
WHERE B.[Client Column Name] = @ColName
RETURN;
END
The problem is when I call the function:
select * from dbo.func_RAW_data_xref('_CD');
I get no results. What I do get are the columns referenced in the function
but no data. If I copy the select statement out of the function and run it
with a valid parameter for @ColName, I do get results.
Not able to create partitions while installing ubuntu 13.04
Not able to create partitions while installing ubuntu 13.04
I'm not able to create partitions while installing ubuntu 13.04.
Have a lenovo G580 with 1TB HDD (which gets detected/named as "/dev/sda").
The system's got NO OPERATING SYSTEM right now!
During the installation, I'm trying to create a 490GB ext4 partition
mounted at "/", a 500GB ext4 at "/home", a 4GB swap (that's the amount of
RAM the machine has) and 299MB as EFI Boot partition. All of them are set
as primary. Also, for every partition creation/definition its asks whether
the partition should be at the Beginning of this space or the End of this
space. And I basically chose "Beginning" for all of them (my guess is that
its some sort of ordering thing)
Everytime the error is either there is some uncorrected errors in the
filesystem or simply an "input/output error occurs while writing into
/dev/sda".
What am I doing wrong?
I'm not able to create partitions while installing ubuntu 13.04.
Have a lenovo G580 with 1TB HDD (which gets detected/named as "/dev/sda").
The system's got NO OPERATING SYSTEM right now!
During the installation, I'm trying to create a 490GB ext4 partition
mounted at "/", a 500GB ext4 at "/home", a 4GB swap (that's the amount of
RAM the machine has) and 299MB as EFI Boot partition. All of them are set
as primary. Also, for every partition creation/definition its asks whether
the partition should be at the Beginning of this space or the End of this
space. And I basically chose "Beginning" for all of them (my guess is that
its some sort of ordering thing)
Everytime the error is either there is some uncorrected errors in the
filesystem or simply an "input/output error occurs while writing into
/dev/sda".
What am I doing wrong?
How to ignore empty selections in XmlStarlet?
How to ignore empty selections in XmlStarlet?
I have a script that performs many XML edit operations with xmlstarlet.
For instance, it remove all 'foo nodes if any are present:
xmlstarlet ed -d '//foo'
(except that in my script, the name of the element is not foo).
When no foo node is present, the following message is printed:
None of the XPaths matched; to match a node in the default namespace
use '_' as the prefix (see section 5.1 in the manual).
For instance, use /_:node instead of /node
I do not want to disable such warnings, but for this particular operation,
I do want to get this particular warning, as I am quite aware that no foo
nodes may be present.
How can I achieve this?
I have a script that performs many XML edit operations with xmlstarlet.
For instance, it remove all 'foo nodes if any are present:
xmlstarlet ed -d '//foo'
(except that in my script, the name of the element is not foo).
When no foo node is present, the following message is printed:
None of the XPaths matched; to match a node in the default namespace
use '_' as the prefix (see section 5.1 in the manual).
For instance, use /_:node instead of /node
I do not want to disable such warnings, but for this particular operation,
I do want to get this particular warning, as I am quite aware that no foo
nodes may be present.
How can I achieve this?
Is there point in using Sessions in this particular case?
Is there point in using Sessions in this particular case?
The client opens a website through a non-web app and thus gives an ID and
a unique security code through query strings. So the url looks smth like
this: .../Default.aspx?uI=21&sc=b2r#67!kl
For different clients, the website has different content. The users are
not more than 10 (considering that 1 client is 1 company that has many
employees(users) and for all users of 1 company the security code is the
same). So 10 users from the same company will have different IDs (uI) but
the same security code (sc) and so on for the different companies.
So is there point in using Sessions or it is sufficient to use just the
query string values for distinguishing the users? Why/why not?
Suggestion of any other, better way of implementation is welcome.
The client opens a website through a non-web app and thus gives an ID and
a unique security code through query strings. So the url looks smth like
this: .../Default.aspx?uI=21&sc=b2r#67!kl
For different clients, the website has different content. The users are
not more than 10 (considering that 1 client is 1 company that has many
employees(users) and for all users of 1 company the security code is the
same). So 10 users from the same company will have different IDs (uI) but
the same security code (sc) and so on for the different companies.
So is there point in using Sessions or it is sufficient to use just the
query string values for distinguishing the users? Why/why not?
Suggestion of any other, better way of implementation is welcome.
Use the same sql Server table to do different updates, is there a way to do that?
Use the same sql Server table to do different updates, is there a way to
do that?
Im using Asp.net (VB.net), in my Database :
have One table called (Trade), the same rows of this table are used from 3
different users, These users can make different updates on this table,
they should see the basic informations of the table (I mean by the Basic,
before the table (trade) has been updated)
The problem is here when the fist user wants to modify the table's rows,
the second and third user can not see the basic informations any more, and
if they decide to change or update some data, the fist will lose his
updated rows..
The data will be overwritten every time the users make updates on the table.
What I want, is to know if there is a way to do like a copy, or an image
of the table for the 3 users, and every user can update normally, without
creating the same Table with the same rows 3 times??!
Thank you..
do that?
Im using Asp.net (VB.net), in my Database :
have One table called (Trade), the same rows of this table are used from 3
different users, These users can make different updates on this table,
they should see the basic informations of the table (I mean by the Basic,
before the table (trade) has been updated)
The problem is here when the fist user wants to modify the table's rows,
the second and third user can not see the basic informations any more, and
if they decide to change or update some data, the fist will lose his
updated rows..
The data will be overwritten every time the users make updates on the table.
What I want, is to know if there is a way to do like a copy, or an image
of the table for the 3 users, and every user can update normally, without
creating the same Table with the same rows 3 times??!
Thank you..
When loadNibName used in init, ViewController can't recieve viewDidLoad event
When loadNibName used in init, ViewController can't recieve viewDidLoad event
When I put "loadNibNamed" in init, the UIViewController can't recieve
ViewDiDload Event. But I put "loadNibNamed" somewhere else , it works
fine. So, why?
-(id)init { self=[super init];
if(self){
[[NSBundle mainBundle]loadNibNamed:@"MainView" owner:self options:nil];
}
return self;
}
(void)viewDidLoad {
[super viewDidLoad];
}
When I put "loadNibNamed" in init, the UIViewController can't recieve
ViewDiDload Event. But I put "loadNibNamed" somewhere else , it works
fine. So, why?
-(id)init { self=[super init];
if(self){
[[NSBundle mainBundle]loadNibNamed:@"MainView" owner:self options:nil];
}
return self;
}
(void)viewDidLoad {
[super viewDidLoad];
}
Sunday, 25 August 2013
Processing user request in a separete activity
Processing user request in a separete activity
I want to have a loading activity that processes log in and register
requests ,I tried to start loading activity from log in and register
activities ,and start processing in onstart() function,but if screen goes
off and on onstart() calls again and process repeats ,I don't know
oncreate() method is good place for this or not,and if there is another
approach.
I want to have a loading activity that processes log in and register
requests ,I tried to start loading activity from log in and register
activities ,and start processing in onstart() function,but if screen goes
off and on onstart() calls again and process repeats ,I don't know
oncreate() method is good place for this or not,and if there is another
approach.
V8 Interceptors code not working
V8 Interceptors code not working
I started learning V8, but i have been stuck at implementing Interceptors.
I am having run time error in this code.
#include "..\v8\\v8.h"
#include "..\common\common.h"
#include <iostream>
#include "JsPoint.h"
#include "GlobalVar.h"
int main(int argc, char *argv[]) {
if( argc != 2 ) {
std::cout << "Usage: " << argv[0] << " < js file name > \n";
return 1;
}
using namespace v8;
v8::Locker locker;
v8::HandleScope scope;
v8::Handle<ObjectTemplate> globalTemplate = v8::ObjectTemplate::New();
Local<FunctionTemplate> pointTemplate;
Local<ObjectTemplate> instanceTemplate;
// ----------- Accessor
-------------------------------------------------------------------------------
pointTemplate = FunctionTemplate::New(PointConstructor);
pointTemplate->SetClassName(String::New("Point"));
instanceTemplate = pointTemplate->InstanceTemplate();
instanceTemplate->SetInternalFieldCount(1);
instanceTemplate->SetAccessor(String::New("x"),
AccessorGetter(PointGetX), AccessorSetter(PointSetX));
instanceTemplate->SetAccessor(String::New("y"),
AccessorGetter(PointGetY), AccessorSetter(PointSetY));
// --------------end Accessor
-------------------------------------------------------------------------
// In accessor we know what is the name after . like .x and .y
// but when you do not, use interceptors.
// ----------- Interceptor
----------------------------------------------------------------------------
Handle<ObjectTemplate> globalVarTemplate = ObjectTemplate::New();
//globalVarTemplate->NewInstance();
globalVarTemplate->SetInternalFieldCount(1);
globalVarTemplate->SetNamedPropertyHandler(GetGlobalVar, SetGlobalVar);
auto it = Persistent<ObjectTemplate>::New(globalVarTemplate);
Handle<ObjectTemplate> hit = it;
Handle<Object> gv_instance = hit->NewInstance(); // **Failing HERE
!!!**
Handle<External> gv_to_set = External::New(MyGlobalVar::getInstance());
gv_instance->SetInternalField(0, gv_to_set);
//-------------- end Interceptor
----------------------------------------------------------------------
globalTemplate->Set(String::New("Global"), gv_instance, ReadOnly);
globalTemplate->Set(String::New("Point"), pointTemplate, ReadOnly);
Persistent<v8::Context> context = v8::Context::New(NULL, globalTemplate);
Context::Scope cscope = Context::Scope(context);
executeScript( argv[1], context );
context.Dispose();
v8::V8::Dispose();
return 0;
}
when i comment out the interceptor part, it works perfectly. It fails at
NewInstance() call of Interceptor. Since i am new to V8, if you find any
other mistake, point them out too.
Thanks.
I started learning V8, but i have been stuck at implementing Interceptors.
I am having run time error in this code.
#include "..\v8\\v8.h"
#include "..\common\common.h"
#include <iostream>
#include "JsPoint.h"
#include "GlobalVar.h"
int main(int argc, char *argv[]) {
if( argc != 2 ) {
std::cout << "Usage: " << argv[0] << " < js file name > \n";
return 1;
}
using namespace v8;
v8::Locker locker;
v8::HandleScope scope;
v8::Handle<ObjectTemplate> globalTemplate = v8::ObjectTemplate::New();
Local<FunctionTemplate> pointTemplate;
Local<ObjectTemplate> instanceTemplate;
// ----------- Accessor
-------------------------------------------------------------------------------
pointTemplate = FunctionTemplate::New(PointConstructor);
pointTemplate->SetClassName(String::New("Point"));
instanceTemplate = pointTemplate->InstanceTemplate();
instanceTemplate->SetInternalFieldCount(1);
instanceTemplate->SetAccessor(String::New("x"),
AccessorGetter(PointGetX), AccessorSetter(PointSetX));
instanceTemplate->SetAccessor(String::New("y"),
AccessorGetter(PointGetY), AccessorSetter(PointSetY));
// --------------end Accessor
-------------------------------------------------------------------------
// In accessor we know what is the name after . like .x and .y
// but when you do not, use interceptors.
// ----------- Interceptor
----------------------------------------------------------------------------
Handle<ObjectTemplate> globalVarTemplate = ObjectTemplate::New();
//globalVarTemplate->NewInstance();
globalVarTemplate->SetInternalFieldCount(1);
globalVarTemplate->SetNamedPropertyHandler(GetGlobalVar, SetGlobalVar);
auto it = Persistent<ObjectTemplate>::New(globalVarTemplate);
Handle<ObjectTemplate> hit = it;
Handle<Object> gv_instance = hit->NewInstance(); // **Failing HERE
!!!**
Handle<External> gv_to_set = External::New(MyGlobalVar::getInstance());
gv_instance->SetInternalField(0, gv_to_set);
//-------------- end Interceptor
----------------------------------------------------------------------
globalTemplate->Set(String::New("Global"), gv_instance, ReadOnly);
globalTemplate->Set(String::New("Point"), pointTemplate, ReadOnly);
Persistent<v8::Context> context = v8::Context::New(NULL, globalTemplate);
Context::Scope cscope = Context::Scope(context);
executeScript( argv[1], context );
context.Dispose();
v8::V8::Dispose();
return 0;
}
when i comment out the interceptor part, it works perfectly. It fails at
NewInstance() call of Interceptor. Since i am new to V8, if you find any
other mistake, point them out too.
Thanks.
Using autocomplete dropdown list item as new autocomplete search term
Using autocomplete dropdown list item as new autocomplete search term
I have an autocomplete box that uses a database for its source. If the
search term finds more than 20 item, I want to put a "more ..." as the
last item's label with the last displayed item as the "more ..." value. I
then want to allow the user to click on the "more ..." and have
autocomplete reload, using the last displayed item as the search term. I
have tried:
$(event.target).autocomplete("search", params);
where params is a variable containing the last displayed item. Doesn't work.
Any suggestions?
I have an autocomplete box that uses a database for its source. If the
search term finds more than 20 item, I want to put a "more ..." as the
last item's label with the last displayed item as the "more ..." value. I
then want to allow the user to click on the "more ..." and have
autocomplete reload, using the last displayed item as the search term. I
have tried:
$(event.target).autocomplete("search", params);
where params is a variable containing the last displayed item. Doesn't work.
Any suggestions?
[ Religion & Spirituality ] Open Question : Do you think a mordern man should just be called that and a atheist should just be called an...
[ Religion & Spirituality ] Open Question : Do you think a mordern man
should just be called that and a atheist should just be called an...
A modern man= No proof of God, only believe in science. Atheist = I dont
believe in anything. That gives me a reason to hate everyone, and treat
everyone like they are a idiot. I believe there is a difference.
should just be called that and a atheist should just be called an...
A modern man= No proof of God, only believe in science. Atheist = I dont
believe in anything. That gives me a reason to hate everyone, and treat
everyone like they are a idiot. I believe there is a difference.
Hollowing out a shape in bender?
Hollowing out a shape in bender?
I'm using blender to make a basic model of my house and I want to hollow
out the inside of the house so that the walls are slightly thicker and
there are normals facing both ways, I'm not realy show I can achieve this.
I think it's called shelling?
Also, has anyone got any tips on working on the interior of buildings,
because I find it nearly impossible to do so :/
I'm using blender to make a basic model of my house and I want to hollow
out the inside of the house so that the walls are slightly thicker and
there are normals facing both ways, I'm not realy show I can achieve this.
I think it's called shelling?
Also, has anyone got any tips on working on the interior of buildings,
because I find it nearly impossible to do so :/
Prove that a function $f$ from a set $A$ to a set $B$ is onto if and only if it is right cancellable
Prove that a function $f$ from a set $A$ to a set $B$ is onto if and only
if it is right cancellable
Prove that a function $f$ from a set $A$ to a set $B$ is onto if and only
if it is right cancellable.
I know that a function $f$ from a set $A$ to a set $B$ is injective if and
only if it is left cancellable.
if it is right cancellable
Prove that a function $f$ from a set $A$ to a set $B$ is onto if and only
if it is right cancellable.
I know that a function $f$ from a set $A$ to a set $B$ is injective if and
only if it is left cancellable.
Saturday, 24 August 2013
get @keyframe current value in css3 with javascript
get @keyframe current value in css3 with javascript
below i link a demo for u ! what i want is when i click on the middle
raindrop , it rotate to the current position of the spining circle! i try
below JS code but it doesn't work! and the next thing i want to do is the
raindrop rotate with spining circle!
$(function() {
$('#center').click(function() {
var pos = $('#circle').css('transform')
$(this).css('transform', 'pos')
});
});
http://jsfiddle.net/hamidrezabstn/fgcPa/5/
below i link a demo for u ! what i want is when i click on the middle
raindrop , it rotate to the current position of the spining circle! i try
below JS code but it doesn't work! and the next thing i want to do is the
raindrop rotate with spining circle!
$(function() {
$('#center').click(function() {
var pos = $('#circle').css('transform')
$(this).css('transform', 'pos')
});
});
http://jsfiddle.net/hamidrezabstn/fgcPa/5/
ios - core data not fetching when running on device
ios - core data not fetching when running on device
My app is running ok in the simulator, but when I run it on device, it
does not show the fetched results!
Code:
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Jobs"
inManagedObjectContext:_managedObjectContext];
[request setEntity:entity];
NSError *error = nil;
results = [_managedObjectContext executeFetchRequest:request error:&error];
My app is running ok in the simulator, but when I run it on device, it
does not show the fetched results!
Code:
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Jobs"
inManagedObjectContext:_managedObjectContext];
[request setEntity:entity];
NSError *error = nil;
results = [_managedObjectContext executeFetchRequest:request error:&error];
mysql same table calculation wrong results
mysql same table calculation wrong results
I am trying following query for calculation/reporting purpose, but its
giving error...
SELECT c.idx, c.club_name, s.sale_event_date,
COUNT(s.*) AS total_guests,
(SELECT COUNT(s*) FROM sales s WHERE t2.qr_scanned = 1 AND
t2.sale_event_date = s.sale_event_date) AS total_scanned_guests,
SUM(s.rep_sale_commission) AS total_rep_commission,
SUM(s.sale_commission) AS total_admin_fees
FROM club c
LEFT JOIN sales s ON s.club_id = c.idx
WHERE c.admin_id = 37
GROUP BY s.sale_event_date
ORDER BY sale_event_date DESC
I am trying following query for calculation/reporting purpose, but its
giving error...
SELECT c.idx, c.club_name, s.sale_event_date,
COUNT(s.*) AS total_guests,
(SELECT COUNT(s*) FROM sales s WHERE t2.qr_scanned = 1 AND
t2.sale_event_date = s.sale_event_date) AS total_scanned_guests,
SUM(s.rep_sale_commission) AS total_rep_commission,
SUM(s.sale_commission) AS total_admin_fees
FROM club c
LEFT JOIN sales s ON s.club_id = c.idx
WHERE c.admin_id = 37
GROUP BY s.sale_event_date
ORDER BY sale_event_date DESC
Rails: Route ignoring parameter
Rails: Route ignoring parameter
I am using the below to render a collection:
<%= render :partial => 'mini_release', collection: group, as: :r %>
And the following routes:
constraints(domain: /[a-zA-Z0-9-]+/i, page: /[0-9]+/, :format => 'html') do
get ':domain', :to => 'sites#show', as: :site
get ':domain/releases(/p-:page)', :to => 'sites#releases', as:
:site_releases, :constraints => { :format => /(json|html)/ }
get ':domain/release/:release_id', :to => 'sites#release', as:
:site_release
end
All good so far, the routing works and the rendering works. However, when
calling the path below inside the partial "mini_release", it builds an
incorrect url:
<%= link_to site_release_path(:domain => r.site.domain, :release_id => r),
:class => 'col-xs-6' do %>
Where r is a model of Release and has one Site (which has an attribute
domain).
The URL generated is correct in terms of the URL is builds. But the
:domain section is always incorrect and is the current models object.
For example, say the page I am currently on is:
/site-one/release/my-release/ and I am rendering the partials, all the
partials result in /site-one/release/the-correct-slugs, when they should
be /some-other-site/release/the-correct-slugs. I've tried multiple formats
for the routes - with and without the variable associations - but none
work. It seems the route is taking the current route :domain parameter
instead of the given one.
How can I ensure the route stops looking at the current :domain parameter?
I am using the below to render a collection:
<%= render :partial => 'mini_release', collection: group, as: :r %>
And the following routes:
constraints(domain: /[a-zA-Z0-9-]+/i, page: /[0-9]+/, :format => 'html') do
get ':domain', :to => 'sites#show', as: :site
get ':domain/releases(/p-:page)', :to => 'sites#releases', as:
:site_releases, :constraints => { :format => /(json|html)/ }
get ':domain/release/:release_id', :to => 'sites#release', as:
:site_release
end
All good so far, the routing works and the rendering works. However, when
calling the path below inside the partial "mini_release", it builds an
incorrect url:
<%= link_to site_release_path(:domain => r.site.domain, :release_id => r),
:class => 'col-xs-6' do %>
Where r is a model of Release and has one Site (which has an attribute
domain).
The URL generated is correct in terms of the URL is builds. But the
:domain section is always incorrect and is the current models object.
For example, say the page I am currently on is:
/site-one/release/my-release/ and I am rendering the partials, all the
partials result in /site-one/release/the-correct-slugs, when they should
be /some-other-site/release/the-correct-slugs. I've tried multiple formats
for the routes - with and without the variable associations - but none
work. It seems the route is taking the current route :domain parameter
instead of the given one.
How can I ensure the route stops looking at the current :domain parameter?
Converting a suspended Google+ profile to a Page, without affecting YouTube name?
Converting a suspended Google+ profile to a Page, without affecting
YouTube name?
A year ago I created this YouTube user called CmisSync CMIS Synchronizer
and uploaded some video tutorials about my product called "CmisSync".
Somehow I also got an associated Google+ account with the same name
CmisSync CMIS Synchronizer.
Unfortunately, the Google+ account recently got disabled:
Apparently I should have created a Google+ Page instead, as product names
are not accepted as Google+ profile names.
Fair enough, my bad, then let's destroy my profile and create a Page
instead, I thought.
So I click Take action, a popup appears:
Looks good, what I want is Create a Google+ Page, so I click on it and get:
PROBLEM:
In the screenshot above I am told that I need to provide a person name,
and this name will be used for all associated products, including YouTube
as explained by the Learn more link.
I don't want the YouTube user to have the name of a real person, as it is
about a product.
QUESTION:
Should I give my real name in the dialog above, then I will be able to
change the YouTube-visible name back to the name of the product?
Should I abandon this Google+ profile, and create a different new Google+
page for the product, from scratch, separate from the YouTube account? No
drawback doing this?
Any better alternative?
YouTube name?
A year ago I created this YouTube user called CmisSync CMIS Synchronizer
and uploaded some video tutorials about my product called "CmisSync".
Somehow I also got an associated Google+ account with the same name
CmisSync CMIS Synchronizer.
Unfortunately, the Google+ account recently got disabled:
Apparently I should have created a Google+ Page instead, as product names
are not accepted as Google+ profile names.
Fair enough, my bad, then let's destroy my profile and create a Page
instead, I thought.
So I click Take action, a popup appears:
Looks good, what I want is Create a Google+ Page, so I click on it and get:
PROBLEM:
In the screenshot above I am told that I need to provide a person name,
and this name will be used for all associated products, including YouTube
as explained by the Learn more link.
I don't want the YouTube user to have the name of a real person, as it is
about a product.
QUESTION:
Should I give my real name in the dialog above, then I will be able to
change the YouTube-visible name back to the name of the product?
Should I abandon this Google+ profile, and create a different new Google+
page for the product, from scratch, separate from the YouTube account? No
drawback doing this?
Any better alternative?
jQuery for removing rows of a table
jQuery for removing rows of a table
I have a javascript for checking if the table has the same number of rows
as that in the select option, if not then delete those rows, so i wrote
the following
if(segmentTable.rows.length > counter){
var rowLen = segmentTable.rows.length;
var delIndex = 1;
for(i = 0; i <= rowLen ; i++ ){
if(i > counter){
segmentTable.deleteRow(i-delIndex);
delIndex++;
}
}
}
but i want a jQuery for doing same, can you help me write one ? thanks in
advance.
I have a javascript for checking if the table has the same number of rows
as that in the select option, if not then delete those rows, so i wrote
the following
if(segmentTable.rows.length > counter){
var rowLen = segmentTable.rows.length;
var delIndex = 1;
for(i = 0; i <= rowLen ; i++ ){
if(i > counter){
segmentTable.deleteRow(i-delIndex);
delIndex++;
}
}
}
but i want a jQuery for doing same, can you help me write one ? thanks in
advance.
Friday, 23 August 2013
Why Constructors are not inherited?
Why Constructors are not inherited?
I have been learning constructors in Inheritance using Eclipse Juno.
When I press ctrl+O twice in the childClass, It shows inherited members.
But I happen to see even the Constructor of super class in the inherited
members
But it is said that constructors are not inherited...
Can someone please explain this behaviour?
I have been learning constructors in Inheritance using Eclipse Juno.
When I press ctrl+O twice in the childClass, It shows inherited members.
But I happen to see even the Constructor of super class in the inherited
members
But it is said that constructors are not inherited...
Can someone please explain this behaviour?
Java URLEncode giving different results
Java URLEncode giving different results
I have this code stub
System.out.println(param+"="+value);
param = URLEncoder.encode(param, "UTF-8");
value = URLEncoder.encode(value, "UTF-8");
System.out.println(param+"="+value);
This gives this result in eclipse
p=wb–û
p=%E6%8C%87%E7%94%B2%E6%B2%B9
But when I run the same code from command line, I get the following output
p=wb–û
p=%C3%8A%C3%A5%C3%A1%C3%81%C3%AE%E2%89%A4%C3%8A%E2%89%A4%CF%80
What could be the problem
I have this code stub
System.out.println(param+"="+value);
param = URLEncoder.encode(param, "UTF-8");
value = URLEncoder.encode(value, "UTF-8");
System.out.println(param+"="+value);
This gives this result in eclipse
p=wb–û
p=%E6%8C%87%E7%94%B2%E6%B2%B9
But when I run the same code from command line, I get the following output
p=wb–û
p=%C3%8A%C3%A5%C3%A1%C3%81%C3%AE%E2%89%A4%C3%8A%E2%89%A4%CF%80
What could be the problem
How to replace word in notepad++ that begins with certain word plus number of bytes
How to replace word in notepad++ that begins with certain word plus number
of bytes
I want to replace that number with format of YYYYMMDDHHMMSS with "".
For example: 20130618100147 SOME TEXT HERE
I tried the to find the "2013(.*)$" in notepad++ (Regular Exp, Wraparound)
but every word that next to 2013 deleted in the same line. How can I able
to replace only the word starting with "2013" plus the 10 bytes?
of bytes
I want to replace that number with format of YYYYMMDDHHMMSS with "".
For example: 20130618100147 SOME TEXT HERE
I tried the to find the "2013(.*)$" in notepad++ (Regular Exp, Wraparound)
but every word that next to 2013 deleted in the same line. How can I able
to replace only the word starting with "2013" plus the 10 bytes?
linq-to-sql asp mvc - where access to the data context?
linq-to-sql asp mvc - where access to the data context?
good day for everyone!
Currently working on a project in asp-mvc 2 with Linq to Sql to handle the
database.
I see many documentation about Linq to sql in asp mvc, My question is,
exactly where I access my data context? What is the place with better
performance?
For example, i have MyDBDataContext Class
I can define in my controllers
public class ImaginaryController : Controller
{
MyDBDataContext context = new MyDBDataContext ();
public ActionResult Index()
{
var list = // some code to read context
return View(list);
}
}
.......
Or, in action methods
public class ImaginaryController : Controller
{
public ActionResult Index()
{
MyDBDataContext context = new MyDBDataContext ();
var list = /* some code to read context */;
return View(list);
}
public ActionResult Create()
{
//but create need reference
MyDBDataContext context = new MyDBDataContext ();
var list = /* some code to read context /*;
return View(list);
}
}
Another option would be to create a class to access the data
public class AccesToBD{
//maybe
private MyDBDataContext current;
public static MyDBDataContext GetContext(){
return current;
}
}
Or something more complex like Implementing the Singleton Pattern in C#
What would be the best solution? and why?. Thanks for your answers.
good day for everyone!
Currently working on a project in asp-mvc 2 with Linq to Sql to handle the
database.
I see many documentation about Linq to sql in asp mvc, My question is,
exactly where I access my data context? What is the place with better
performance?
For example, i have MyDBDataContext Class
I can define in my controllers
public class ImaginaryController : Controller
{
MyDBDataContext context = new MyDBDataContext ();
public ActionResult Index()
{
var list = // some code to read context
return View(list);
}
}
.......
Or, in action methods
public class ImaginaryController : Controller
{
public ActionResult Index()
{
MyDBDataContext context = new MyDBDataContext ();
var list = /* some code to read context */;
return View(list);
}
public ActionResult Create()
{
//but create need reference
MyDBDataContext context = new MyDBDataContext ();
var list = /* some code to read context /*;
return View(list);
}
}
Another option would be to create a class to access the data
public class AccesToBD{
//maybe
private MyDBDataContext current;
public static MyDBDataContext GetContext(){
return current;
}
}
Or something more complex like Implementing the Singleton Pattern in C#
What would be the best solution? and why?. Thanks for your answers.
Vector doesn't create objects properly
Vector doesn't create objects properly
I've created a class with some static datas. Something like this:
class Object
{
public:
Object();
Object( Point center, double area );
Object( int cx, int cy, double area );
~Object();
public stuffs here...
private:
Point center;
double area;
static double totalArea;
static int objCounter;
static double areaMean;
};
than in it's constructor and destructor I made:
Object::Object()
{
this->setCenter( Point() );
this->setArea( 0.0 );
objCounter++;
totalArea += 0;
areaMean = totalArea / objCounter;
}
Object::~Object()
{
//cout << "Destructor called!\n"; //put it just to test
objCounter--;
totalArea -= this->area;
areaMean = totalArea / objCounter;
}
So my intention was to know how many Objects were created, it's total area
and the mean area. I tested it with simple statements like:
Object first;
Object first;
cout << Object::getObjCounter() << "\n";
///I have the get method implement origanally
And everything it's ok. Object class count number of instaces correctly. I
tested using simple arrays:
Object test[ 10 ];
cout << Object::getObjCounter() << "\n";
Amazing... it works, as it should; I tested with dynamic allocation:
Object *test = new Object[ 10 ];
cout << Object::getObjCounter() << "\n";
delete [] test;
Again... it works. But when i try:
vector< Object > test( 10, Object() );
cout << Object::getObjCounter() << "\n";
It gives me zero in the stdout... I put flags in constructor and
destructor to see why it's happening. And it shows me that when I use the
vector statement shown, constructor is called just on, than the destructor
is called in sequence!!!! Why???? Doesn't make sense to me! Could anybody
explain this to me? In addition, could anybody help me in using vector to
achieve the same effect that I have with simple arrays, which means: has a
bunch of objects inside something, and counting it correctly? The thing is
I need vectors functionality like remove and add elements, and resizing,
but I don't want to reinvent wheel. Thank's in advance
I've created a class with some static datas. Something like this:
class Object
{
public:
Object();
Object( Point center, double area );
Object( int cx, int cy, double area );
~Object();
public stuffs here...
private:
Point center;
double area;
static double totalArea;
static int objCounter;
static double areaMean;
};
than in it's constructor and destructor I made:
Object::Object()
{
this->setCenter( Point() );
this->setArea( 0.0 );
objCounter++;
totalArea += 0;
areaMean = totalArea / objCounter;
}
Object::~Object()
{
//cout << "Destructor called!\n"; //put it just to test
objCounter--;
totalArea -= this->area;
areaMean = totalArea / objCounter;
}
So my intention was to know how many Objects were created, it's total area
and the mean area. I tested it with simple statements like:
Object first;
Object first;
cout << Object::getObjCounter() << "\n";
///I have the get method implement origanally
And everything it's ok. Object class count number of instaces correctly. I
tested using simple arrays:
Object test[ 10 ];
cout << Object::getObjCounter() << "\n";
Amazing... it works, as it should; I tested with dynamic allocation:
Object *test = new Object[ 10 ];
cout << Object::getObjCounter() << "\n";
delete [] test;
Again... it works. But when i try:
vector< Object > test( 10, Object() );
cout << Object::getObjCounter() << "\n";
It gives me zero in the stdout... I put flags in constructor and
destructor to see why it's happening. And it shows me that when I use the
vector statement shown, constructor is called just on, than the destructor
is called in sequence!!!! Why???? Doesn't make sense to me! Could anybody
explain this to me? In addition, could anybody help me in using vector to
achieve the same effect that I have with simple arrays, which means: has a
bunch of objects inside something, and counting it correctly? The thing is
I need vectors functionality like remove and add elements, and resizing,
but I don't want to reinvent wheel. Thank's in advance
Dpkg was interrupted, you must manually run 'dpkg-configure-a' to correct the problem
Dpkg was interrupted, you must manually run 'dpkg-configure-a' to correct
the problem
I was updating from 11.04 to 12.04 and I got this message:
Dpkg was interrupted, you must manually run 'dpkg-configure-a' to correct
the problem
now I can't connect to the net nor can I use a cursor on my laptop?
the problem
I was updating from 11.04 to 12.04 and I got this message:
Dpkg was interrupted, you must manually run 'dpkg-configure-a' to correct
the problem
now I can't connect to the net nor can I use a cursor on my laptop?
Thursday, 22 August 2013
How to customize dataprovider in cgridview in yii
How to customize dataprovider in cgridview in yii
I have a query to find duplicate as:
SELECT *
FROM tbl_normalized_data_view y
INNER JOIN (SELECT column_1, column_2, COUNT(1) AS CountOf
FROM tbl_normalized_data_view
GROUP BY column_1, column_2
HAVING COUNT(1)>1 ) dt
ON y.column_1=dt.column_1 and y.column_2=dt.column_2
now I want to show only records that contain the data of above stated
query, SO please guide me how to use data provider for this purpose.
I have a query to find duplicate as:
SELECT *
FROM tbl_normalized_data_view y
INNER JOIN (SELECT column_1, column_2, COUNT(1) AS CountOf
FROM tbl_normalized_data_view
GROUP BY column_1, column_2
HAVING COUNT(1)>1 ) dt
ON y.column_1=dt.column_1 and y.column_2=dt.column_2
now I want to show only records that contain the data of above stated
query, SO please guide me how to use data provider for this purpose.
check the exit code inside a if statement before existing script
check the exit code inside a if statement before existing script
I want to check the exit code of the second condition before existing the
script
if [ -f "/var/lock/myproc/agentlock" ] && \
[ $(ps ax | grep "myproc" | grep -v "grep" | awk '{print $1}' | xargs
kill -9) ]; then
echo "Exiting without running the rest of the script" | sendmail $myemail
exit
fi
I want to exit the script if the exit status of the second command is
non-zero.
I want to check the exit code of the second condition before existing the
script
if [ -f "/var/lock/myproc/agentlock" ] && \
[ $(ps ax | grep "myproc" | grep -v "grep" | awk '{print $1}' | xargs
kill -9) ]; then
echo "Exiting without running the rest of the script" | sendmail $myemail
exit
fi
I want to exit the script if the exit status of the second command is
non-zero.
Spanish Forum? anyone can help me?
Spanish Forum? anyone can help me?
can anyone recommend me a forum in Spanish?, i need some info, but i dont
know how to explain it
<xsd:complexType> <xsd:sequence> <xsd:element
name="idTransaccion" type="xsd:string"/> <xsd:element
name="codigoRespuestaProveedor" type="xsd:string"/>
<xsd:element name="mensajeRespuestaProveedor" type="xsd:string"/>
</xsd:sequence> </xsd:complexType> </xsd:element> pero el
resultado que obtengo es el siguiente:
<s:element name="resultadoEntregarBonoResponse">
can anyone recommend me a forum in Spanish?, i need some info, but i dont
know how to explain it
<xsd:complexType> <xsd:sequence> <xsd:element
name="idTransaccion" type="xsd:string"/> <xsd:element
name="codigoRespuestaProveedor" type="xsd:string"/>
<xsd:element name="mensajeRespuestaProveedor" type="xsd:string"/>
</xsd:sequence> </xsd:complexType> </xsd:element> pero el
resultado que obtengo es el siguiente:
<s:element name="resultadoEntregarBonoResponse">
Start thinking sphinx on Ubuntu startup
Start thinking sphinx on Ubuntu startup
I need run this rails command automatically, from my project folder, every
time my server starts up:
rake ts:start
I put a file called run_ts.sh in my rails project folder:
#!/bin/bash
rake ts:start
In /etc/rc.local I added:
/usr/local/ispmgr/sbin/eximquota
/usr/local/ispmgr/sbin/ihttpd iphidden
/etc/init.d/apache2 start
/home/prog/OnlineAuto/Shop/run_ts.sh
exit 0
But my command is not executing, so rake ts:start is not executed.
How can I start thinking sphinx on each system startup?
I need run this rails command automatically, from my project folder, every
time my server starts up:
rake ts:start
I put a file called run_ts.sh in my rails project folder:
#!/bin/bash
rake ts:start
In /etc/rc.local I added:
/usr/local/ispmgr/sbin/eximquota
/usr/local/ispmgr/sbin/ihttpd iphidden
/etc/init.d/apache2 start
/home/prog/OnlineAuto/Shop/run_ts.sh
exit 0
But my command is not executing, so rake ts:start is not executed.
How can I start thinking sphinx on each system startup?
Is it possible to save a variable value in Android (in memory), even after closing the application? If so, how?
Is it possible to save a variable value in Android (in memory), even after
closing the application? If so, how?
How is it possible to save a variable value in an Android app? Can the
value be saved in memory? I am planning to save a float value in my
application, so the next time the app is opened, the previous value will
be loaded. How do I go about this? Shared Preferences or something else?
closing the application? If so, how?
How is it possible to save a variable value in an Android app? Can the
value be saved in memory? I am planning to save a float value in my
application, so the next time the app is opened, the previous value will
be loaded. How do I go about this? Shared Preferences or something else?
Jasper Chart Theme without Java knowledge
Jasper Chart Theme without Java knowledge
I found some older (outdated) solutions extending a special Java class to
build a new theme. I am using Jasper without Java knowledge and wonder if
(since version 5.3 of the server is out) there is an easier way of
applying new colors to the charts.
Is there a ResourceDescriptor able to hol a color theme? Like the
properties' one?
I use the REST (2) API, but no Java at all. Did possibilities change now
in the last 4 years?
Basically I want to use the aegean theme but apply some different colors.
I found some older (outdated) solutions extending a special Java class to
build a new theme. I am using Jasper without Java knowledge and wonder if
(since version 5.3 of the server is out) there is an easier way of
applying new colors to the charts.
Is there a ResourceDescriptor able to hol a color theme? Like the
properties' one?
I use the REST (2) API, but no Java at all. Did possibilities change now
in the last 4 years?
Basically I want to use the aegean theme but apply some different colors.
How to make inner function to return inner variable in javascript
How to make inner function to return inner variable in javascript
Forgive me for asking this simple question.
I want to get the inner variable through method.In java, I can achieve it
as below code.
class MyClass{
String words = "hello";
MyClass(){
// constructor
}
String getWords(){
return this.words;
}
}
Then, I can get the words (inner variable) by calling the method getWords().
MyClass myClass = new MyClass(); // object instance
System.out.println(myClass.getWords()); // get the words
My question is, how can i achieve such thing in javascript.
Forgive me for asking this simple question.
I want to get the inner variable through method.In java, I can achieve it
as below code.
class MyClass{
String words = "hello";
MyClass(){
// constructor
}
String getWords(){
return this.words;
}
}
Then, I can get the words (inner variable) by calling the method getWords().
MyClass myClass = new MyClass(); // object instance
System.out.println(myClass.getWords()); // get the words
My question is, how can i achieve such thing in javascript.
Wednesday, 21 August 2013
Opening password protected rar file without password
Opening password protected rar file without password
How to unrar a password protected rar file in Linux without password??
Since I forgot the password, I don't know what to do? Any ways there?
How to unrar a password protected rar file in Linux without password??
Since I forgot the password, I don't know what to do? Any ways there?
Question about dual-booting 13.04 and Windows 8/8.1
Question about dual-booting 13.04 and Windows 8/8.1
So, after learning that in order to boot into Ubuntu from a usb drive, I
had to go into my bios and change the boot setting from UEFI to Legacy, I
managed to install Ubuntu 13.04. Now, when I restart my laptop, it pops up
the GRUB menu thing, and I can load Ubuntu no problem. But if I try to
select Windows, I get an error saying windows can't be booted, and I need
the recovery disc to repair this. but, since I don't have one, I thought
it'd be a good idea to look around the boot settings again. Changing the
boot settings from Legacy back to UEFI lets me boot into windows normally,
but there is no option to get into Ubuntu unless I change it back to
Legacy, which locks me out of Windows again. My question is, how can I
make these options bot available to me without having to mash f2 to get
into the bios every time I want to change my OS? Thank you in advance.
So, after learning that in order to boot into Ubuntu from a usb drive, I
had to go into my bios and change the boot setting from UEFI to Legacy, I
managed to install Ubuntu 13.04. Now, when I restart my laptop, it pops up
the GRUB menu thing, and I can load Ubuntu no problem. But if I try to
select Windows, I get an error saying windows can't be booted, and I need
the recovery disc to repair this. but, since I don't have one, I thought
it'd be a good idea to look around the boot settings again. Changing the
boot settings from Legacy back to UEFI lets me boot into windows normally,
but there is no option to get into Ubuntu unless I change it back to
Legacy, which locks me out of Windows again. My question is, how can I
make these options bot available to me without having to mash f2 to get
into the bios every time I want to change my OS? Thank you in advance.
Case sensitive cmd autocompletion
Case sensitive cmd autocompletion
How do I disable case insensitive cmd autocompletion, but keep search case
insensitive (ignorecase and smartcase)?
For example, if I enter :e li in a directory with two candidates - LICENSE
and lib/ and hit tab, I'll get :e LICENSE instead of :e lib/ I would like
to get...
How do I disable case insensitive cmd autocompletion, but keep search case
insensitive (ignorecase and smartcase)?
For example, if I enter :e li in a directory with two candidates - LICENSE
and lib/ and hit tab, I'll get :e LICENSE instead of :e lib/ I would like
to get...
Changing badge logo for notifications on lock screen in Windows Store app.
Changing badge logo for notifications on lock screen in Windows Store app.
In the Package.appxmanifest under Notifications I have changed the badge
logo to a new 24x24 pixel logo, but it seems like I'm stuck with the old
logo on the lock screen no matter what.
In the manifest the new logo is declared:
<LockScreen Notification="badgeAndTileText"
BadgeLogo="Assets/BadgeLogoNew.png" />
But it is still the old logo that is shown in the lock screen.
I have even searched my computer and deleted all instances of the old
logo, but it is still shown in the lock screen.
Any hints would be appreciated.
In the Package.appxmanifest under Notifications I have changed the badge
logo to a new 24x24 pixel logo, but it seems like I'm stuck with the old
logo on the lock screen no matter what.
In the manifest the new logo is declared:
<LockScreen Notification="badgeAndTileText"
BadgeLogo="Assets/BadgeLogoNew.png" />
But it is still the old logo that is shown in the lock screen.
I have even searched my computer and deleted all instances of the old
logo, but it is still shown in the lock screen.
Any hints would be appreciated.
append jquery mobile textarea not expendable in multiline input
append jquery mobile textarea not expendable in multiline input
Im just added jQueryMobile on my project, and the auto expending textarea
is rock. However, when i change my method, i append a textarea into a div,
and the textarea not expending anymore. Do i miss out something or other
code can help to solve this?
<div id="text"></div>
Javascript
$("#text").append('<div data-role="fieldcontain"><textarea id="msg_input"
cols="30" rows="1" name="textarea"></textarea></div>');
The textarea is display out, but not growing on next line.
Any help?
Steven
Im just added jQueryMobile on my project, and the auto expending textarea
is rock. However, when i change my method, i append a textarea into a div,
and the textarea not expending anymore. Do i miss out something or other
code can help to solve this?
<div id="text"></div>
Javascript
$("#text").append('<div data-role="fieldcontain"><textarea id="msg_input"
cols="30" rows="1" name="textarea"></textarea></div>');
The textarea is display out, but not growing on next line.
Any help?
Steven
How to change the default 404 page while using python SimpleHTTPServer
How to change the default 404 page while using python SimpleHTTPServer
When I start a http server using a command:
python -m SimpleHTTPServer
How can i change the default 404 page?
When I start a http server using a command:
python -m SimpleHTTPServer
How can i change the default 404 page?
Tuesday, 20 August 2013
Ugly Subsets: Weirdness Within the Axioms of Probability Theory
Ugly Subsets: Weirdness Within the Axioms of Probability Theory
I'm watching this video now, and at $36:53$ John Tsitsiklis mentions that
for some sets there is no way to assign probabilities to events which
occur in them. I'm wondering what sets he is talking about. Tsitsiklis
says that one will only encounter them doing doctoral work, but I imagine
that the "theoretical aspects of probability theory" are more tangible
than Tsitsiklis makes them out to be.
I'm watching this video now, and at $36:53$ John Tsitsiklis mentions that
for some sets there is no way to assign probabilities to events which
occur in them. I'm wondering what sets he is talking about. Tsitsiklis
says that one will only encounter them doing doctoral work, but I imagine
that the "theoretical aspects of probability theory" are more tangible
than Tsitsiklis makes them out to be.
git alias not working properly
git alias not working properly
I have a git alias that is supposed to do a git checkout -b <branchname>
(basically create the branch and check it out). My alias looks like:
newbranch = !sh -c 'git checkout -b "$1"'
But when I try git newbranch mytestbbranch I get an error saying that the
"b" switch requires an argument.
I have a similar alias for rename that looks like:
rename = !sh -c 'git branch -m "$1" "$2"'
And that one works just fine. I'm confused why the newbranch alias isn't
working.
I have a git alias that is supposed to do a git checkout -b <branchname>
(basically create the branch and check it out). My alias looks like:
newbranch = !sh -c 'git checkout -b "$1"'
But when I try git newbranch mytestbbranch I get an error saying that the
"b" switch requires an argument.
I have a similar alias for rename that looks like:
rename = !sh -c 'git branch -m "$1" "$2"'
And that one works just fine. I'm confused why the newbranch alias isn't
working.
how modify url of database by jframe?
how modify url of database by jframe?
how modify url of database by jframe?
I want change the name from run application >>>>> // public static final
String URL="jdbc:mysql://localhost:3306/airline"; // private static final
String drive="com.mysql.jdbc.Driver";
// public static final String useernam="husam";
// public static final String password="123456";
/localhost:3306 this title of server I want making variable
how modify url of database by jframe?
I want change the name from run application >>>>> // public static final
String URL="jdbc:mysql://localhost:3306/airline"; // private static final
String drive="com.mysql.jdbc.Driver";
// public static final String useernam="husam";
// public static final String password="123456";
/localhost:3306 this title of server I want making variable
How to access Oracle Database Trigger code from C# code
How to access Oracle Database Trigger code from C# code
How can I access a Oracle database Trigger from within C# Code?
I want to create a program that checks tables, and compares them to that
table's trigger in Oracle. I want to then see if every column in the table
has a corresponding 'section' in the trigger code. I need read/write
access to the trigger via C# code.
Is this possible? How can i access DB triggers from C# code?
Example: TableA have 2 columns, Type and Value. Trigger_TableA only has
the following code:
....
IF (:OLD.TYPE IS NULL AND :NEW.TYPE IS NOT NULL) OR
(:OLD.TYPE<> :NEW.TYPE) THEN
vWhat_Changed := vWhat_Changed || ',TYPE='||:OLD.TYPE;
END IF;
.....
Trigger_TableA is incomplete, as it only is monitoring Type, and not
Value. The Trigger needs to be edited from its original state to include
code to monitor the Value column //end example
How can I access a Oracle database Trigger from within C# Code?
I want to create a program that checks tables, and compares them to that
table's trigger in Oracle. I want to then see if every column in the table
has a corresponding 'section' in the trigger code. I need read/write
access to the trigger via C# code.
Is this possible? How can i access DB triggers from C# code?
Example: TableA have 2 columns, Type and Value. Trigger_TableA only has
the following code:
....
IF (:OLD.TYPE IS NULL AND :NEW.TYPE IS NOT NULL) OR
(:OLD.TYPE<> :NEW.TYPE) THEN
vWhat_Changed := vWhat_Changed || ',TYPE='||:OLD.TYPE;
END IF;
.....
Trigger_TableA is incomplete, as it only is monitoring Type, and not
Value. The Trigger needs to be edited from its original state to include
code to monitor the Value column //end example
how o increment an array element in matlab?
how o increment an array element in matlab?
If A is an array of zeros of length 5 in matlab and I increment it's 3rd
element by 1 like shown below
A=zeros(1,5);
A[3]++;
It gives me an error, I want the output to be
A=
0 0 1 0 0
Thanks in advance for your time and help
If A is an array of zeros of length 5 in matlab and I increment it's 3rd
element by 1 like shown below
A=zeros(1,5);
A[3]++;
It gives me an error, I want the output to be
A=
0 0 1 0 0
Thanks in advance for your time and help
Items/Records re-ordering?
Items/Records re-ordering?
Assume that on a multiple-user application that the same request may be
initiated by multiple users at the same time, which these requests at the
end will be some ajax calls to some server-side action we have a routine
executed by that action/method on server as below:
routine task : it is responsible to do the reordering such that, imagine
items are not connected to each other, there is no doubly linked-list data
structure in place but all items have an assumed ordering by default and
represented to users by that order, when an add item , or delete item , or
update item operation is initiated by those ajax calls, ordering will be
different as the entry is like FIFO.
currently I need to update all the records, orderNumber column to keep
track of all the changed, On an update operation because items are movable
in the user interface and users have the facility of a drag and drop
interaction, items can go up or down the original ordered list and change
those orderings.
what would you suggest as the most efficient method for keeping track of
these ordering changes in which will have the least performance cost on
server as well as keeping an acceptable user interaction for users?
Development Platform is ASP.NET MVC4 , Persistence using SQL Server
Assume that on a multiple-user application that the same request may be
initiated by multiple users at the same time, which these requests at the
end will be some ajax calls to some server-side action we have a routine
executed by that action/method on server as below:
routine task : it is responsible to do the reordering such that, imagine
items are not connected to each other, there is no doubly linked-list data
structure in place but all items have an assumed ordering by default and
represented to users by that order, when an add item , or delete item , or
update item operation is initiated by those ajax calls, ordering will be
different as the entry is like FIFO.
currently I need to update all the records, orderNumber column to keep
track of all the changed, On an update operation because items are movable
in the user interface and users have the facility of a drag and drop
interaction, items can go up or down the original ordered list and change
those orderings.
what would you suggest as the most efficient method for keeping track of
these ordering changes in which will have the least performance cost on
server as well as keeping an acceptable user interaction for users?
Development Platform is ASP.NET MVC4 , Persistence using SQL Server
Internal functioning of Type Erasure in Generics
Internal functioning of Type Erasure in Generics
In How Generics works in Java section of this it says
Java compiler, when it sees code written using Generics it completely
erases that code
and covert it into raw type i.e. code without Generics. All type related
information is
removed during erasing. So your ArrayList<Gold> becomes plain old
ArrayList prior to
JDK 1.5, formal type parameters e.g. <K, V> or <E> gets replaced by either
Object or
Super Class of the Type.
My question is about the last line - formal type parameters e.g. <K, V> or
<E> gets replaced by either Object or Super Class of the Type.
In which case are they replaced by Object and in which case they are
replaced by the Super Class of the object type?
In How Generics works in Java section of this it says
Java compiler, when it sees code written using Generics it completely
erases that code
and covert it into raw type i.e. code without Generics. All type related
information is
removed during erasing. So your ArrayList<Gold> becomes plain old
ArrayList prior to
JDK 1.5, formal type parameters e.g. <K, V> or <E> gets replaced by either
Object or
Super Class of the Type.
My question is about the last line - formal type parameters e.g. <K, V> or
<E> gets replaced by either Object or Super Class of the Type.
In which case are they replaced by Object and in which case they are
replaced by the Super Class of the object type?
Monday, 19 August 2013
Android: Unfortunately the app has stopped
Android: Unfortunately the app has stopped
Here is the code. I have made another activity StartActivity.java When i
click on the button but it gives the erro that : "Unfortunately, test has
stopped". Please help me! thank everyone! MainACtivity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button button = (Button)findViewById(R.id.changeButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intents = new Intent (v.getContext(),
StartActivity.class);
startActivity(intents);
}
});
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top"
android:orientation="horizontal" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#00FFFF">
<ImageView
android:id="@+id/ImgSinger"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignBottom="@+id/TxtSinger"
android:baselineAlignBottom="true"
android:maxHeight="10dp"
android:maxWidth="10dp"
android:src="@drawable/taylor" />
<TextView
android:id="@+id/TxtTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/ImgSinger"
android:text="You Belong With Me"
android:textSize="16sp" />
<TextView
android:id="@+id/TxtSinger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/TxtTitle"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/ImgSinger"
android:text="Taylor Swift"
android:textSize="12sp" />
<TextView
android:id="@+id/TxtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/TxtTitle"
android:text="4:30"
android:textSize="12sp" />
</RelativeLayout>
<Button
android:id="@+id/changeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Test" />
</RelativeLayout>
Androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testandroid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.testandroid.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".StartActicity"></activity>
<activity android:name=".PlayActivity"></activity>
</application>
</manifest>
Here is the code. I have made another activity StartActivity.java When i
click on the button but it gives the erro that : "Unfortunately, test has
stopped". Please help me! thank everyone! MainACtivity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button button = (Button)findViewById(R.id.changeButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intents = new Intent (v.getContext(),
StartActivity.class);
startActivity(intents);
}
});
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top"
android:orientation="horizontal" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#00FFFF">
<ImageView
android:id="@+id/ImgSinger"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignBottom="@+id/TxtSinger"
android:baselineAlignBottom="true"
android:maxHeight="10dp"
android:maxWidth="10dp"
android:src="@drawable/taylor" />
<TextView
android:id="@+id/TxtTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/ImgSinger"
android:text="You Belong With Me"
android:textSize="16sp" />
<TextView
android:id="@+id/TxtSinger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/TxtTitle"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/ImgSinger"
android:text="Taylor Swift"
android:textSize="12sp" />
<TextView
android:id="@+id/TxtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/TxtTitle"
android:text="4:30"
android:textSize="12sp" />
</RelativeLayout>
<Button
android:id="@+id/changeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Test" />
</RelativeLayout>
Androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testandroid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.testandroid.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".StartActicity"></activity>
<activity android:name=".PlayActivity"></activity>
</application>
</manifest>
TikZ: compilation time performance of decorations
TikZ: compilation time performance of decorations
I want to produce a picture that contains lots of cylinder-kind shapes
(maybe about 200) along certain paths. Here is an example of such a shape:
\documentclass{standalone}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%%%%% H-O bond between atom 1 and atom 3
%%% O half of the bond
% O half bond shading
\pgfdeclareverticalshading{1_3_O3_BondShading}{100bp}{
color(0.000bp)=(Black!75!Red);
color(22.773bp)=(Black!75!Red);
color(45.525bp)=(Black!3.893!Red);
color(53.986bp)=(White!26.261!Red);
color(59.561bp)=(White!26.261!Red);
color(68.022bp)=(Black!3.893!Red);
color(90.773bp)=(Black!75!Red);
color(100.000bp)=(Black!75!Red)}
% O half bond drawing
\begin{scope}
\pgfsetadditionalshadetransform{\pgftransformyscale{0.0856124622417}}
\pgfpathmoveto{\pgfpoint{3.107cm}{-5.942cm}}
\pgfpathlineto{\pgfpoint{2.998cm}{-5.816cm}}
\pgfpatharcaxes{0}{180}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}
\pgfpathlineto{\pgfpoint{2.936cm}{-6.088cm}}
\pgfpatharcaxes{180}{0}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}
\pgfusepath{clip}
\pgfpathcircle{\pgfpoint{2.968cm}{-5.952cm}}{1.168cm}
\pgfshadepath{1_3_O3_BondShading}{-49.384}
\pgfusepath{}
\end{scope}
%%% H half of the bond
% H half bond shading
\pgfdeclareverticalshading{1_3_H1_BondShading}{100bp}{
color(0.000bp)=(Black!75!White);
color(22.773bp)=(Black!75!White);
color(45.525bp)=(Black!20.000!White);
color(53.986bp)=(White!26.261!White);
color(59.561bp)=(White!26.261!White);
color(68.022bp)=(Black!20.000!White);
color(90.773bp)=(Black!75!White);
color(100.000bp)=(Black!75!White)}
% H half bond drawing
\begin{scope}
\pgfsetadditionalshadetransform{\pgftransformyscale{0.0856124622417}}
\pgfpathmoveto{\pgfpoint{2.936cm}{-6.088cm}}
\pgfpathlineto{\pgfpoint{3.026cm}{-6.193cm}}
\pgfpatharcaxes{180}{0}{\pgfpoint{0.086cm}{0.073cm}}{\pgfpoint{0.034cm}{-0.040cm}}
\pgfpathlineto{\pgfpoint{3.107cm}{-5.942cm}}
\pgfpatharcaxes{0}{180}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}
\pgfusepath{clip}
\pgfpathcircle{\pgfpoint{3.066cm}{-6.067cm}}{1.168cm}
\pgfshadepath{1_3_H1_BondShading}{-49.384}
\pgfusepath{}
\end{scope}
\end{tikzpicture}
\end{document}
Since this makes the code unreadably long I thought of putting this into a
decoration. The decoration will have to take a lot of arguments: the
names, colors and positions of the shadings, as well as the coordinates
for the \pgfpatharcaxes commands. Unfortunately, I have very little
experience with TeX and pgf programming so that this will take up some
time. Since I want to be sure that this time investment is not wasted I'd
like to know whether it is to be expected that TikZ decorations come with
any penalty for the compilation time compared to the normal code shown
above (I would refrain from using a decoration if the compilation would
take more than twice as long)? Is it advisable to use a decoration in my
case or might there be reasons against it?
I want to produce a picture that contains lots of cylinder-kind shapes
(maybe about 200) along certain paths. Here is an example of such a shape:
\documentclass{standalone}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%%%%% H-O bond between atom 1 and atom 3
%%% O half of the bond
% O half bond shading
\pgfdeclareverticalshading{1_3_O3_BondShading}{100bp}{
color(0.000bp)=(Black!75!Red);
color(22.773bp)=(Black!75!Red);
color(45.525bp)=(Black!3.893!Red);
color(53.986bp)=(White!26.261!Red);
color(59.561bp)=(White!26.261!Red);
color(68.022bp)=(Black!3.893!Red);
color(90.773bp)=(Black!75!Red);
color(100.000bp)=(Black!75!Red)}
% O half bond drawing
\begin{scope}
\pgfsetadditionalshadetransform{\pgftransformyscale{0.0856124622417}}
\pgfpathmoveto{\pgfpoint{3.107cm}{-5.942cm}}
\pgfpathlineto{\pgfpoint{2.998cm}{-5.816cm}}
\pgfpatharcaxes{0}{180}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}
\pgfpathlineto{\pgfpoint{2.936cm}{-6.088cm}}
\pgfpatharcaxes{180}{0}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}
\pgfusepath{clip}
\pgfpathcircle{\pgfpoint{2.968cm}{-5.952cm}}{1.168cm}
\pgfshadepath{1_3_O3_BondShading}{-49.384}
\pgfusepath{}
\end{scope}
%%% H half of the bond
% H half bond shading
\pgfdeclareverticalshading{1_3_H1_BondShading}{100bp}{
color(0.000bp)=(Black!75!White);
color(22.773bp)=(Black!75!White);
color(45.525bp)=(Black!20.000!White);
color(53.986bp)=(White!26.261!White);
color(59.561bp)=(White!26.261!White);
color(68.022bp)=(Black!20.000!White);
color(90.773bp)=(Black!75!White);
color(100.000bp)=(Black!75!White)}
% H half bond drawing
\begin{scope}
\pgfsetadditionalshadetransform{\pgftransformyscale{0.0856124622417}}
\pgfpathmoveto{\pgfpoint{2.936cm}{-6.088cm}}
\pgfpathlineto{\pgfpoint{3.026cm}{-6.193cm}}
\pgfpatharcaxes{180}{0}{\pgfpoint{0.086cm}{0.073cm}}{\pgfpoint{0.034cm}{-0.040cm}}
\pgfpathlineto{\pgfpoint{3.107cm}{-5.942cm}}
\pgfpatharcaxes{0}{180}{\pgfpoint{0.085cm}{0.073cm}}{\pgfpoint{-0.034cm}{0.040cm}}
\pgfusepath{clip}
\pgfpathcircle{\pgfpoint{3.066cm}{-6.067cm}}{1.168cm}
\pgfshadepath{1_3_H1_BondShading}{-49.384}
\pgfusepath{}
\end{scope}
\end{tikzpicture}
\end{document}
Since this makes the code unreadably long I thought of putting this into a
decoration. The decoration will have to take a lot of arguments: the
names, colors and positions of the shadings, as well as the coordinates
for the \pgfpatharcaxes commands. Unfortunately, I have very little
experience with TeX and pgf programming so that this will take up some
time. Since I want to be sure that this time investment is not wasted I'd
like to know whether it is to be expected that TikZ decorations come with
any penalty for the compilation time compared to the normal code shown
above (I would refrain from using a decoration if the compilation would
take more than twice as long)? Is it advisable to use a decoration in my
case or might there be reasons against it?
If $G$ contains normal subgroups of prime orders $p$ and $q$, then $G$ contains an element of order $pq$.
If $G$ contains normal subgroups of prime orders $p$ and $q$, then $G$
contains an element of order $pq$.
Let $G$ be a group that contains normal subgroups of prime orders $p$ and
$q$, respectively. Prove that $G$ contains an element of order $pq$.
I tried using Lagrange's theorem but I'm not sure if it applies since it
isn't said that $G$ is finite. Can it be shown that this is the case? i.e.
Does a group with non-trivial subgroups of finite order necessarily have
finite order itself?
If it does hold, using Lagrange's theorem I could say that $pq$ divides
$|G|$, but I'm not sure what follows. Can I then somehow show that there
exists a subgroup in $G$ of order $pq$, and so there must be some element
in $G$ of order $pq$ (since the group operation for the subgroup is the
same as that of $G$)?
contains an element of order $pq$.
Let $G$ be a group that contains normal subgroups of prime orders $p$ and
$q$, respectively. Prove that $G$ contains an element of order $pq$.
I tried using Lagrange's theorem but I'm not sure if it applies since it
isn't said that $G$ is finite. Can it be shown that this is the case? i.e.
Does a group with non-trivial subgroups of finite order necessarily have
finite order itself?
If it does hold, using Lagrange's theorem I could say that $pq$ divides
$|G|$, but I'm not sure what follows. Can I then somehow show that there
exists a subgroup in $G$ of order $pq$, and so there must be some element
in $G$ of order $pq$ (since the group operation for the subgroup is the
same as that of $G$)?
iPhone Vs browser : CSS for right align clear icon in text box
iPhone Vs browser : CSS for right align clear icon in text box
I have seen same kind of issues in stack overflow itself. Still asking it
because I am facing the following issue.
I have a textbox which has a clear icon on the right side.
And in the textbox there is a smartfill (autofilling data).
Need this to work fine in desktop browser / iphone browser / or in any
mobile browser. !
HTML
<div class="outerWrapper">
<div id="mainContainer">
<label>Smartfill box
<span class="ui-icon-delete"></span>
<input type="text" placeholder="" onkeydown="smartfill()"
autocomplete="off" />
<div id="smartFill1" class="smartFillBox">
<li><a href="#"><div>first</div>starts here</a></li>
<li><a href="#"><div>Second</div>Goes here</a></li>
<li><a href="#"><div>Third</div>Goes here</a></li>
<li><a href="#"><div>Fourth</div>Goes here</a></li>
</div>
</label>
</div>
</div>
CSS
/* Main css --------------------*/
.outerWrapper label input[type="text"], .outerWrapper label
input[type="url"], .outerWrapper label input[type="email"], .outerWrapper
label input[type="password"], .outerWrapper label input[type="tel"] {
margin-top: 0.3em;
padding: 0;
}
input[type="text"], input[type="url"], input[type="email"],
input[type="password"], input[type="tel"] {
-moz-appearance: none;
border: 1px solid #CECECE;
border-radius: 4px 4px 4px 4px;
box-shadow: 0 4px 8px #E1E1E1 inset;
display: block;
font-size: 20px;
margin: 0;
min-height: 40px;
width: 98%;
}
.outerWrapper label {
display: block;
font-size: 16px;
padding-bottom: 7px;
}
#mainContainer {
font-size: 14px;
margin-bottom: 30px;
margin-left: 15px;
margin-right: 15px;
}
/* site css --------------------*/
.ui-icon-delete {
background-attachment: scroll;
background-image:
url("http://www.autoweek.com/assets/losangeles/closeButton.png");
background-origin: padding-box;
background-position: 0 50%;
background-repeat: no-repeat;
cursor: pointer;
display: none;
float: right;
height: 29px;
margin: 0 3px;
padding: 0;
position: relative;
right: 0.3%;
top: 36px;
width: 4%;
display: inline;
}
.smartFillBox {
height: 50px;
margin: -1px 0 0;
width: 98%;
display: block;
}
.smartFillBox li {
border-bottom: 1px solid #CECECE;
border-left: 1px solid #CECECE;
border-right: 1px solid #CECECE;
float: left;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
width: 100%;
}
JsFiddle link for my issue is here : http://jsfiddle.net/smilyface/ze3sA/
Here is a related link: http://jsfiddle.net/PJZmv/801/
I have seen same kind of issues in stack overflow itself. Still asking it
because I am facing the following issue.
I have a textbox which has a clear icon on the right side.
And in the textbox there is a smartfill (autofilling data).
Need this to work fine in desktop browser / iphone browser / or in any
mobile browser. !
HTML
<div class="outerWrapper">
<div id="mainContainer">
<label>Smartfill box
<span class="ui-icon-delete"></span>
<input type="text" placeholder="" onkeydown="smartfill()"
autocomplete="off" />
<div id="smartFill1" class="smartFillBox">
<li><a href="#"><div>first</div>starts here</a></li>
<li><a href="#"><div>Second</div>Goes here</a></li>
<li><a href="#"><div>Third</div>Goes here</a></li>
<li><a href="#"><div>Fourth</div>Goes here</a></li>
</div>
</label>
</div>
</div>
CSS
/* Main css --------------------*/
.outerWrapper label input[type="text"], .outerWrapper label
input[type="url"], .outerWrapper label input[type="email"], .outerWrapper
label input[type="password"], .outerWrapper label input[type="tel"] {
margin-top: 0.3em;
padding: 0;
}
input[type="text"], input[type="url"], input[type="email"],
input[type="password"], input[type="tel"] {
-moz-appearance: none;
border: 1px solid #CECECE;
border-radius: 4px 4px 4px 4px;
box-shadow: 0 4px 8px #E1E1E1 inset;
display: block;
font-size: 20px;
margin: 0;
min-height: 40px;
width: 98%;
}
.outerWrapper label {
display: block;
font-size: 16px;
padding-bottom: 7px;
}
#mainContainer {
font-size: 14px;
margin-bottom: 30px;
margin-left: 15px;
margin-right: 15px;
}
/* site css --------------------*/
.ui-icon-delete {
background-attachment: scroll;
background-image:
url("http://www.autoweek.com/assets/losangeles/closeButton.png");
background-origin: padding-box;
background-position: 0 50%;
background-repeat: no-repeat;
cursor: pointer;
display: none;
float: right;
height: 29px;
margin: 0 3px;
padding: 0;
position: relative;
right: 0.3%;
top: 36px;
width: 4%;
display: inline;
}
.smartFillBox {
height: 50px;
margin: -1px 0 0;
width: 98%;
display: block;
}
.smartFillBox li {
border-bottom: 1px solid #CECECE;
border-left: 1px solid #CECECE;
border-right: 1px solid #CECECE;
float: left;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
width: 100%;
}
JsFiddle link for my issue is here : http://jsfiddle.net/smilyface/ze3sA/
Here is a related link: http://jsfiddle.net/PJZmv/801/
Sunday, 18 August 2013
Help in a proof in Sharp's Steps in Commutative Algebra
Help in a proof in Sharp's Steps in Commutative Algebra
I'm studying the Sharp's book of commutative algebra, and I need a help in
this proof why $S_0$ is a subalgebra of $S$, maybe because my lack of
experience of this subject, I found myself a little lost in this part of
the demonstration.
See using the definition of subalgebra, $S_0$ has to be a subring of $S$
and the image of the homomorphism related to the R-algebra $f:R\to S$ has
to be contained in $S_0$, I couldn't proof the latter statement.
Thanks in advance.
I'm studying the Sharp's book of commutative algebra, and I need a help in
this proof why $S_0$ is a subalgebra of $S$, maybe because my lack of
experience of this subject, I found myself a little lost in this part of
the demonstration.
See using the definition of subalgebra, $S_0$ has to be a subring of $S$
and the image of the homomorphism related to the R-algebra $f:R\to S$ has
to be contained in $S_0$, I couldn't proof the latter statement.
Thanks in advance.
Keep track of everybody who uses my widget
Keep track of everybody who uses my widget
I created a widget and I want to know how many webpages are using it. Is
there any javascript that I can set up that will give me the URL of every
webpage that has my widget?
I created a widget and I want to know how many webpages are using it. Is
there any javascript that I can set up that will give me the URL of every
webpage that has my widget?
View variable in the same line as the counter for
View variable in the same line as the counter for
I'm new here and I'm sure that is not sleep for days.
I want that number in the variable $parcelaX be displayed only when equal
to $i of loop "for".
below my code:
<?php
for($i = 1; $i <= $parcelas; $i++){
?>
<div><?php echo $i ?></div>
<div>
<?php
while($arrParcelas = mysql_fetch_array($sqlParcelas)){
$dataX = $arrParcelas['dataPagamento'];
$parcelasX = $arrParcelas['parcelaPaga'];
$valorX = $arrParcelas['valorPago'];
if($i == $parcelasX)
{
echo $parcelasX . " - " . $valorX . " <br /> ";
}
?>
</div>
<?php } ?>
I'm new here and I'm sure that is not sleep for days.
I want that number in the variable $parcelaX be displayed only when equal
to $i of loop "for".
below my code:
<?php
for($i = 1; $i <= $parcelas; $i++){
?>
<div><?php echo $i ?></div>
<div>
<?php
while($arrParcelas = mysql_fetch_array($sqlParcelas)){
$dataX = $arrParcelas['dataPagamento'];
$parcelasX = $arrParcelas['parcelaPaga'];
$valorX = $arrParcelas['valorPago'];
if($i == $parcelasX)
{
echo $parcelasX . " - " . $valorX . " <br /> ";
}
?>
</div>
<?php } ?>
Html form checkbox undefined behavior
Html form checkbox undefined behavior
I have the html code below:
<html>
<head><title>OPTIONS</title></head>
<body>
<p>Choose schedule to generate:</p>
<form action='cgi-bin/mp1b.cgi'>
<input type=checkbox name='tfield' value=on />Teacher<input type=text
name=teacher value=""/><br>
<input type=checkbox name='sfield' value=on />Subject<input type=text
name=subject value=""/><br>
<input type=checkbox name='rfield' value=on />Room<input type=text
name=room value=""/><br>
<input type=submit value="Generate Schedule"/>
</form>
</body>
</html>
The problem is: Whenever I type in one of those text spaces and use my C
CGI script to parse it, it gives me the right output which. But whenever I
checked one of the checkboxes, it seems to delete the string inputted in
the text space corresponding to it. For example, when I check
name='tfield' and write a string to the text name=teacher , it doesn't
give me the output for the name=teacher. What could be the possible
problem in this one? Thanks!
I have the html code below:
<html>
<head><title>OPTIONS</title></head>
<body>
<p>Choose schedule to generate:</p>
<form action='cgi-bin/mp1b.cgi'>
<input type=checkbox name='tfield' value=on />Teacher<input type=text
name=teacher value=""/><br>
<input type=checkbox name='sfield' value=on />Subject<input type=text
name=subject value=""/><br>
<input type=checkbox name='rfield' value=on />Room<input type=text
name=room value=""/><br>
<input type=submit value="Generate Schedule"/>
</form>
</body>
</html>
The problem is: Whenever I type in one of those text spaces and use my C
CGI script to parse it, it gives me the right output which. But whenever I
checked one of the checkboxes, it seems to delete the string inputted in
the text space corresponding to it. For example, when I check
name='tfield' and write a string to the text name=teacher , it doesn't
give me the output for the name=teacher. What could be the possible
problem in this one? Thanks!
How do time periods in Facebook insights work?
How do time periods in Facebook insights work?
In the example I am pasting below, I first request insights data daily for
the last month. The second one is weekly, and the third is per 28 days
(let's call it monthly). My problem is that the data for days_28 is
exactly the same as day, whereas it should at least be like the weekly
data (I.E. the data for the last 28 days should at least be 61, not just
1).
Why does this happen? Am I interpreting the data wrong?
The URLs are below:
https://graph.facebook.com/1404223219793416/insights/page_stories/day?since=-1month
https://graph.facebook.com/1404223219793416/insights/page_stories/week?since=-1month
https://graph.facebook.com/1404223219793416/insights/page_stories/days_28?since=-1month
Here is the daily data:
{
"data": [
{
"id": "1404223219793416/insights/page_stories/day",
"name": "page_stories",
"period": "day",
"values": [
{
"value": 0,
"end_time": "2013-07-19T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-20T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-21T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-22T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-23T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-25T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-26T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-27T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-28T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-29T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-30T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-31T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-01T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-02T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-03T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-04T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-05T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-06T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-07T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-08T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-09T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-10T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-11T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-12T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-13T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-14T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-15T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-16T07:00:00+0000"
}
],
"title": "Daily Page Stories",
"description": "Daily The number of stories created about your Page.
(Total Count)"
}
],
"paging": {
"previous":
"https://graph.facebook.com/1404223219793416/insights/page_stories/day?since=1371647555&until=1374153155",
"next":
"https://graph.facebook.com/1404223219793416/insights/page_stories/day?since=1376658755&until=1379164355"
}
}
Here is the weekly data:
{
"data": [
{
"id": "1404223219793416/insights/page_stories/week",
"name": "page_stories",
"period": "week",
"values": [
{
"value": 0,
"end_time": "2013-07-19T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-20T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-21T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-22T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-23T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-25T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-26T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-27T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-28T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-29T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-30T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-31T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-01T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-02T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-03T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-04T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-05T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-06T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-07T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-08T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-09T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-10T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-11T07:00:00+0000"
},
{
"value": 2,
"end_time": "2013-08-12T07:00:00+0000"
},
{
"value": 29,
"end_time": "2013-08-13T07:00:00+0000"
},
{
"value": 50,
"end_time": "2013-08-14T07:00:00+0000"
},
{
"value": 61,
"end_time": "2013-08-15T07:00:00+0000"
},
{
"value": 61,
"end_time": "2013-08-16T07:00:00+0000"
}
],
"title": "Weekly Page Stories",
"description": "Weekly The number of stories created about your
Page. (Total Count)"
}
],
"paging": {
"previous":
"https://graph.facebook.com/1404223219793416/insights/page_stories/week?since=1371647903&until=1374153503",
"next":
"https://graph.facebook.com/1404223219793416/insights/page_stories/week?since=1376659103&until=1379164703"
}
}
And here is the monthly data:
{
"data": [
{
"id": "1404223219793416/insights/page_stories/days_28",
"name": "page_stories",
"period": "days_28",
"values": [
{
"value": 0,
"end_time": "2013-07-19T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-20T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-21T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-22T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-23T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-25T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-26T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-27T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-28T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-29T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-30T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-31T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-01T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-02T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-03T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-04T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-05T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-06T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-07T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-08T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-09T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-10T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-11T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-12T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-13T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-14T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-15T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-16T07:00:00+0000"
}
],
"title": "28 Days Page Stories",
"description": "28 Days The number of stories created about your
Page. (Total Count)"
}
],
"paging": {
"previous":
"https://graph.facebook.com/1404223219793416/insights/page_stories/days_28?since=1371647956&until=1374153556",
"next":
"https://graph.facebook.com/1404223219793416/insights/page_stories/days_28?since=1376659156&until=1379164756"
}
}
In the example I am pasting below, I first request insights data daily for
the last month. The second one is weekly, and the third is per 28 days
(let's call it monthly). My problem is that the data for days_28 is
exactly the same as day, whereas it should at least be like the weekly
data (I.E. the data for the last 28 days should at least be 61, not just
1).
Why does this happen? Am I interpreting the data wrong?
The URLs are below:
https://graph.facebook.com/1404223219793416/insights/page_stories/day?since=-1month
https://graph.facebook.com/1404223219793416/insights/page_stories/week?since=-1month
https://graph.facebook.com/1404223219793416/insights/page_stories/days_28?since=-1month
Here is the daily data:
{
"data": [
{
"id": "1404223219793416/insights/page_stories/day",
"name": "page_stories",
"period": "day",
"values": [
{
"value": 0,
"end_time": "2013-07-19T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-20T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-21T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-22T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-23T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-25T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-26T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-27T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-28T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-29T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-30T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-31T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-01T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-02T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-03T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-04T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-05T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-06T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-07T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-08T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-09T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-10T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-11T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-12T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-13T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-14T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-15T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-16T07:00:00+0000"
}
],
"title": "Daily Page Stories",
"description": "Daily The number of stories created about your Page.
(Total Count)"
}
],
"paging": {
"previous":
"https://graph.facebook.com/1404223219793416/insights/page_stories/day?since=1371647555&until=1374153155",
"next":
"https://graph.facebook.com/1404223219793416/insights/page_stories/day?since=1376658755&until=1379164355"
}
}
Here is the weekly data:
{
"data": [
{
"id": "1404223219793416/insights/page_stories/week",
"name": "page_stories",
"period": "week",
"values": [
{
"value": 0,
"end_time": "2013-07-19T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-20T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-21T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-22T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-23T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-25T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-26T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-27T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-28T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-29T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-30T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-31T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-01T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-02T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-03T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-04T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-05T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-06T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-07T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-08T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-09T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-10T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-11T07:00:00+0000"
},
{
"value": 2,
"end_time": "2013-08-12T07:00:00+0000"
},
{
"value": 29,
"end_time": "2013-08-13T07:00:00+0000"
},
{
"value": 50,
"end_time": "2013-08-14T07:00:00+0000"
},
{
"value": 61,
"end_time": "2013-08-15T07:00:00+0000"
},
{
"value": 61,
"end_time": "2013-08-16T07:00:00+0000"
}
],
"title": "Weekly Page Stories",
"description": "Weekly The number of stories created about your
Page. (Total Count)"
}
],
"paging": {
"previous":
"https://graph.facebook.com/1404223219793416/insights/page_stories/week?since=1371647903&until=1374153503",
"next":
"https://graph.facebook.com/1404223219793416/insights/page_stories/week?since=1376659103&until=1379164703"
}
}
And here is the monthly data:
{
"data": [
{
"id": "1404223219793416/insights/page_stories/days_28",
"name": "page_stories",
"period": "days_28",
"values": [
{
"value": 0,
"end_time": "2013-07-19T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-20T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-21T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-22T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-23T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-24T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-25T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-26T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-27T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-28T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-29T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-30T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-07-31T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-01T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-02T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-03T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-04T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-05T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-06T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-07T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-08T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-09T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-10T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-11T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-12T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-13T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-14T07:00:00+0000"
},
{
"value": 0,
"end_time": "2013-08-15T07:00:00+0000"
},
{
"value": 1,
"end_time": "2013-08-16T07:00:00+0000"
}
],
"title": "28 Days Page Stories",
"description": "28 Days The number of stories created about your
Page. (Total Count)"
}
],
"paging": {
"previous":
"https://graph.facebook.com/1404223219793416/insights/page_stories/days_28?since=1371647956&until=1374153556",
"next":
"https://graph.facebook.com/1404223219793416/insights/page_stories/days_28?since=1376659156&until=1379164756"
}
}
dont alow enter in android textbox
dont alow enter in android textbox
how could i dont let user enter or new line in textbox?
i prefer to use xml than java code...
any help appreciated!
how could i dont let user enter or new line in textbox?
i prefer to use xml than java code...
any help appreciated!
Saturday, 17 August 2013
keys for subway surfer through Google play [on hold]
keys for subway surfer through Google play [on hold]
I Manoj Aggarwal, bought keys for INR 307 from Google play for subway
surfer game. The amount was debited and the keys were not added to my
game.
Request you to either refund the amount or else add the key to my game
account.
Request to you to consider it on priority.
Regard, Manoj Aggarwal.
I Manoj Aggarwal, bought keys for INR 307 from Google play for subway
surfer game. The amount was debited and the keys were not added to my
game.
Request you to either refund the amount or else add the key to my game
account.
Request to you to consider it on priority.
Regard, Manoj Aggarwal.
How to make a lite version of an app stop working(some functionality)?
How to make a lite version of an app stop working(some functionality)?
I want to stop some functionality in my lite version after few days. If
the user reinstalls the app,still it shouldn't work. Is this possible?
Thanks in advance!
I want to stop some functionality in my lite version after few days. If
the user reinstalls the app,still it shouldn't work. Is this possible?
Thanks in advance!
OpenVPN use local connection for some IPs
OpenVPN use local connection for some IPs
How would I make my OpenVPN instance 'block' certain IPs and force my
client to use it's local connection to make the connection to the
'blocked' IP addresses.
How would I make my OpenVPN instance 'block' certain IPs and force my
client to use it's local connection to make the connection to the
'blocked' IP addresses.
Calling ServiceStack with backslash in request data
Calling ServiceStack with backslash in request data
I am calling a service stack api from VB.NET that I've created - It
essentially looks up the default language spoken as you pass the
nationality of a person.
Dim response As BindingList(Of
Symphony_SystemFunctionsDefaultLanguageResponse)
Dim client As New JsonServiceClient(BASEURI)
response = client.[Get](New Symphony_SystemFunctionsDefaultLanguage()
With {.NationalityCode = strNationality})
strNationality is a code from a database called "ME/Kuw" (Kuwaiti which
would return Arabic"
Any code that does not have a "/" or a "\" in it returns correctly so I
know the service and calls work however if I use a code ie . "ME/Kuw" I
get a service not found - its sort of interpreting the / as a route, I've
tried making the string URLencoded , but its the same issue.
This is my service and response code - which works fine as long as no "/"
is in the .NationalityCode.
<Route("/SystemFunctions/DefaultLanguage/{NationalityCode}", "GET")>
Public Class Symphony_SystemFunctionsDefaultLanguage
Implements IReturn(Of BindingList(Of
ymphony_SystemFunctionsDefaultLanguageResponse))
Private mvarNationalityCode As String
Public Property NationalityCode() As String
Get
NationalityCode = mvarNationalityCode
End Get
Set(ByVal Value As String)
mvarNationalityCode = Value
End Set
End Property
End Class
Public Class Symphony_SystemFunctionsDefaultLanguageResponse
Private mvarDefaultLanguage As String
Public Property DefaultLanguage() As String
Get
DefaultLanguage = mvarDefaultLanguage
End Get
Set(ByVal Value As String)
mvarDefaultLanguage = Value
End Set
End Property
End Class
and my class that gets the data.
public Class Symphony_SystemFunctionsService
Inherits Service Public Function [get](request As
Symphony_SystemFunctionsDefaultLanguage) As Object
Using dbcontext As New EntitiesModel1
Dim sqlQueryString As String = "proc_s_GetDefaultLanguage '" &
request.NationalityCode & "'"
Dim response As IEnumerable(Of
Symphony_SystemFunctionsDefaultLanguageResponse) =
dbcontext.ExecuteQuery(Of
Symphony_SystemFunctionsDefaultLanguageResponse)(sqlQueryString)
Return response
End Using
End Function
End Class
Any suggestions how I might call this and allow the passing of "/" in that
data?
I am calling a service stack api from VB.NET that I've created - It
essentially looks up the default language spoken as you pass the
nationality of a person.
Dim response As BindingList(Of
Symphony_SystemFunctionsDefaultLanguageResponse)
Dim client As New JsonServiceClient(BASEURI)
response = client.[Get](New Symphony_SystemFunctionsDefaultLanguage()
With {.NationalityCode = strNationality})
strNationality is a code from a database called "ME/Kuw" (Kuwaiti which
would return Arabic"
Any code that does not have a "/" or a "\" in it returns correctly so I
know the service and calls work however if I use a code ie . "ME/Kuw" I
get a service not found - its sort of interpreting the / as a route, I've
tried making the string URLencoded , but its the same issue.
This is my service and response code - which works fine as long as no "/"
is in the .NationalityCode.
<Route("/SystemFunctions/DefaultLanguage/{NationalityCode}", "GET")>
Public Class Symphony_SystemFunctionsDefaultLanguage
Implements IReturn(Of BindingList(Of
ymphony_SystemFunctionsDefaultLanguageResponse))
Private mvarNationalityCode As String
Public Property NationalityCode() As String
Get
NationalityCode = mvarNationalityCode
End Get
Set(ByVal Value As String)
mvarNationalityCode = Value
End Set
End Property
End Class
Public Class Symphony_SystemFunctionsDefaultLanguageResponse
Private mvarDefaultLanguage As String
Public Property DefaultLanguage() As String
Get
DefaultLanguage = mvarDefaultLanguage
End Get
Set(ByVal Value As String)
mvarDefaultLanguage = Value
End Set
End Property
End Class
and my class that gets the data.
public Class Symphony_SystemFunctionsService
Inherits Service Public Function [get](request As
Symphony_SystemFunctionsDefaultLanguage) As Object
Using dbcontext As New EntitiesModel1
Dim sqlQueryString As String = "proc_s_GetDefaultLanguage '" &
request.NationalityCode & "'"
Dim response As IEnumerable(Of
Symphony_SystemFunctionsDefaultLanguageResponse) =
dbcontext.ExecuteQuery(Of
Symphony_SystemFunctionsDefaultLanguageResponse)(sqlQueryString)
Return response
End Using
End Function
End Class
Any suggestions how I might call this and allow the passing of "/" in that
data?
YUI3 and socket.io
YUI3 and socket.io
Just a simple question:
I am using YUI3 framework for my website and want to use socket.io framework.
Now challenge is to use socket.io with YUI3. As of now I am using
socket.io logic inside YUI sandbox and its working fine.
BUT can there be any fallback of this approach ? If yes, then how should I
integerate both ?
Here is the snippet of code:
<script type="text/javascript">
YUI().use('my-slide' , 'node', 'event','transition', function (Y) {
// connecting to nodejs server running on 7001 port for dynamic updates
var broadcast = io.connect('http://localhost:7001/getlatestbroadcast');
broadcast.on('status',function(data){
// some socket logic here
});
// Setting Listener
broadcast.on('moreData',function(data){
// some socket logic here
});
});
</script>
Just a simple question:
I am using YUI3 framework for my website and want to use socket.io framework.
Now challenge is to use socket.io with YUI3. As of now I am using
socket.io logic inside YUI sandbox and its working fine.
BUT can there be any fallback of this approach ? If yes, then how should I
integerate both ?
Here is the snippet of code:
<script type="text/javascript">
YUI().use('my-slide' , 'node', 'event','transition', function (Y) {
// connecting to nodejs server running on 7001 port for dynamic updates
var broadcast = io.connect('http://localhost:7001/getlatestbroadcast');
broadcast.on('status',function(data){
// some socket logic here
});
// Setting Listener
broadcast.on('moreData',function(data){
// some socket logic here
});
});
</script>
How to optimize loading of markers on GMap v3 map?
How to optimize loading of markers on GMap v3 map?
I'd like to know what is the best way to refresh markers on a GMap v3 map.
Basically, here is what I have :
I get all the stores located in the part of the map displayed at screen
with a stored procedure.
In JavaScript, I put them in an array.
A JavaScript method put markers on the map based on this array.
Each time the user moves on the map, the stored procedure will be called
and the JavaScript array will have new stores (ie new markers) to display.
I need to fully optimize this operation, and JavaScript is not my favorite
language.
So, each time the stored produre is call, what is the best way to do this :
Delete all markers on the map and recreate them ?
Get the result of the SP, and for each location, look in my array if the
location is already on the map and add only the ones which are not still
on the map ? (But I'm afraid the array became very very large after 10 or
20 minutes moving on the map)
Get the result of the SP, and for each location, look in my array if the
location is already on the map, add only the ones which are not still on
the map and delete the ones which are no longer on the map ?
Any other solution ?
Thank you !
I'd like to know what is the best way to refresh markers on a GMap v3 map.
Basically, here is what I have :
I get all the stores located in the part of the map displayed at screen
with a stored procedure.
In JavaScript, I put them in an array.
A JavaScript method put markers on the map based on this array.
Each time the user moves on the map, the stored procedure will be called
and the JavaScript array will have new stores (ie new markers) to display.
I need to fully optimize this operation, and JavaScript is not my favorite
language.
So, each time the stored produre is call, what is the best way to do this :
Delete all markers on the map and recreate them ?
Get the result of the SP, and for each location, look in my array if the
location is already on the map and add only the ones which are not still
on the map ? (But I'm afraid the array became very very large after 10 or
20 minutes moving on the map)
Get the result of the SP, and for each location, look in my array if the
location is already on the map, add only the ones which are not still on
the map and delete the ones which are no longer on the map ?
Any other solution ?
Thank you !
Sencha touch IndexBar - get tapped index value
Sencha touch IndexBar - get tapped index value
Am using indexbar in my contact list. I have a list of more than 100
contact so am using pagination plugin to display the contacts. my problem
is when a user tap on index B i have to call an api to get the contacts
starting from letter B, i dont know how to get the tapped index value..
please help me to solve this issue.. I dont have much code to paste..
list = Ext.create('Ext.dataview.List', Ext.Object.merge({
itemTpl: itemTpl,
id:'ctsitemheighttest',
variableHeights: true,
itemHeight : 'auto',
scrollToTopOnRefresh: false,
indexBar : true,
indexBar: {
itemId:'ctsindex',
id:'ctsindex',
margin:1,
handler:function(){
console.log('index tapped'); // can i do this way?
its not working
}
},
}
Please help me..thanks in advance
Am using indexbar in my contact list. I have a list of more than 100
contact so am using pagination plugin to display the contacts. my problem
is when a user tap on index B i have to call an api to get the contacts
starting from letter B, i dont know how to get the tapped index value..
please help me to solve this issue.. I dont have much code to paste..
list = Ext.create('Ext.dataview.List', Ext.Object.merge({
itemTpl: itemTpl,
id:'ctsitemheighttest',
variableHeights: true,
itemHeight : 'auto',
scrollToTopOnRefresh: false,
indexBar : true,
indexBar: {
itemId:'ctsindex',
id:'ctsindex',
margin:1,
handler:function(){
console.log('index tapped'); // can i do this way?
its not working
}
},
}
Please help me..thanks in advance
Friday, 16 August 2013
Syntax Error in Android = expected
Syntax Error in Android = expected
playButton.setOnClickListener(new OnClickListener() { //LINE16
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Starting to play",
Toast.LENGTH_SHORT).show();
} //LINE19
}); //LINE20
Error:: LINE 16--Syntax error on token "setOnClickListener", = expected
after this token
LINE 16--Syntax error on token(s), misplaced construct(s)
LINE 19--Syntax error, insert "}" to complete ClassBody LINE 20--Syntax
error on token "}", delete this token
playButton.setOnClickListener(new OnClickListener() { //LINE16
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Starting to play",
Toast.LENGTH_SHORT).show();
} //LINE19
}); //LINE20
Error:: LINE 16--Syntax error on token "setOnClickListener", = expected
after this token
LINE 16--Syntax error on token(s), misplaced construct(s)
LINE 19--Syntax error, insert "}" to complete ClassBody LINE 20--Syntax
error on token "}", delete this token
Saturday, 10 August 2013
Can we use "dynamism" as a noun for describing the amount of change and changeability?
Can we use "dynamism" as a noun for describing the amount of change and
changeability?
According to dictionaries, one of the meanings of the word dynamic is:
a system with continuous change
http://www.thefreedictionary.com/dynamic
http://www.merriam-webster.com/dictionary/dynamic
However, it's used as adjective. I'm writing a text in which I need to
refer to continuous change and changeability and I thought of the word
dynamism. In other words, I need the noun form of the dynamic. However,
seems that dynamism is not used as that meaning.
For example, instead of the level of changeability and the amount of
change in a system, I'd like to write system's dynamism level.
Can I use dynamism in that meaning? If not, what word should I use?
changeability?
According to dictionaries, one of the meanings of the word dynamic is:
a system with continuous change
http://www.thefreedictionary.com/dynamic
http://www.merriam-webster.com/dictionary/dynamic
However, it's used as adjective. I'm writing a text in which I need to
refer to continuous change and changeability and I thought of the word
dynamism. In other words, I need the noun form of the dynamic. However,
seems that dynamism is not used as that meaning.
For example, instead of the level of changeability and the amount of
change in a system, I'd like to write system's dynamism level.
Can I use dynamism in that meaning? If not, what word should I use?
Google drive application
Google drive application
This is what i tried from google for Multiple account selector
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
credential = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE);
startActivityForResult(credential.newChooseAccountIntent(),
REQUEST_ACCOUNT_PICKER);
}
But i am making an app in which i am using my Drive free space to upload
the data and i want that when user click he shoud be able to view or
download the files stored in my account.
i dont want to user select account and login. i want to give my fixed
account so on one click user can download it. It shoud automatically login
to that account so where do i specify my mail id and password.
Please suggest the code.
This is what i tried from google for Multiple account selector
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
credential = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE);
startActivityForResult(credential.newChooseAccountIntent(),
REQUEST_ACCOUNT_PICKER);
}
But i am making an app in which i am using my Drive free space to upload
the data and i want that when user click he shoud be able to view or
download the files stored in my account.
i dont want to user select account and login. i want to give my fixed
account so on one click user can download it. It shoud automatically login
to that account so where do i specify my mail id and password.
Please suggest the code.
Friday, 9 August 2013
Join two tables with one table haas multiple rows matching
Join two tables with one table haas multiple rows matching
Trying to figure out if it is possible to create a query where you join
tables, table one is smaller than table two, table two has multiple
references matching table one entries, the query would output a joining
where table one length is preserved but you just add more columns. Not
sure if that makes sense so here is a example of what I am after
Table One Table two
+-----------------------------+ +-----------------------------+
| id | english | definition | | id | word_id | sentence |
+-----------------------------+ +-----------------------------+
|1 | A1 | blah | |1 | 1 | blahblah1 |
|2 | B4 | blah2 | |2 | 1 | blahblah2 |
+-----------------------------+ |3 | 1 | blahblah3 |
|4 | 2 | blahblah4 |
|5 | 2 | blahblah5 |
+-----------------------------+
********* Query should return something like *****************
+----------------------------------------------------------------+
| id | english | definition | sentence | sentence2 | sentence3 |
+----------------------------------------------------------------+
|1 | A1 | blah | blahblah1| blahblah2| blahblah3 |
|2 | B4 | blah2 | blahblah4| blahblah5| |
+----------------------------------------------------------------+
My Current query looks like this and results in
$query = "SELECT * FROM T1 INNER JOIN T2 ON T1.id = T2.word_id";
Resulting in
+----------------------------------------+
| id | english | definition | sentence |
+----------------------------------------+
|1 | A1 | blah | blahblah1|
|1 | A1 | blah | blahblah2|
|1 | A1 | blah | blahblah3|
|2 | B4 | blah2 | blahblah4|
|2 | B4 | blah2 | blahblah5|
+----------------------------------------+
I am working with PHP and MySql.
Trying to figure out if it is possible to create a query where you join
tables, table one is smaller than table two, table two has multiple
references matching table one entries, the query would output a joining
where table one length is preserved but you just add more columns. Not
sure if that makes sense so here is a example of what I am after
Table One Table two
+-----------------------------+ +-----------------------------+
| id | english | definition | | id | word_id | sentence |
+-----------------------------+ +-----------------------------+
|1 | A1 | blah | |1 | 1 | blahblah1 |
|2 | B4 | blah2 | |2 | 1 | blahblah2 |
+-----------------------------+ |3 | 1 | blahblah3 |
|4 | 2 | blahblah4 |
|5 | 2 | blahblah5 |
+-----------------------------+
********* Query should return something like *****************
+----------------------------------------------------------------+
| id | english | definition | sentence | sentence2 | sentence3 |
+----------------------------------------------------------------+
|1 | A1 | blah | blahblah1| blahblah2| blahblah3 |
|2 | B4 | blah2 | blahblah4| blahblah5| |
+----------------------------------------------------------------+
My Current query looks like this and results in
$query = "SELECT * FROM T1 INNER JOIN T2 ON T1.id = T2.word_id";
Resulting in
+----------------------------------------+
| id | english | definition | sentence |
+----------------------------------------+
|1 | A1 | blah | blahblah1|
|1 | A1 | blah | blahblah2|
|1 | A1 | blah | blahblah3|
|2 | B4 | blah2 | blahblah4|
|2 | B4 | blah2 | blahblah5|
+----------------------------------------+
I am working with PHP and MySql.
Subscribe to:
Comments (Atom)