how to remove keyboard when user click any where in window?
can you please tell me how to hide the keyboard in IOS when user click
anywhere in window.I used blur() on button click it work but when i used
in view it not work..:(
I check if user click any where other than textfield it hide the keyboard
my my logic fail..:(
Here is my code..
//FirstView Component Constructor
function FirstView() {
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView({
layout:"vertical"
});
var self1 = Ti.UI.createView({
layout:"horizontal",
top:20,
height:Ti.UI.SIZE
});
var self2 = Ti.UI.createView({
layout:"horizontal",
top:10,
height:Ti.UI.SIZE
});
//label using localization-ready strings from <app
dir>/i18n/en/strings.xml
var nameLabel=Ti.UI.createLabel({
text:"Name",
left:15,
width:100,
height:35
});
var nameTextField=Ti.UI.createTextField({
height:35,
width:140,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
self1.add(nameLabel);
self1.add(nameTextField);
self.add(self1);
var passwordLabel=Ti.UI.createLabel({
text:"Password",
left:15,
width:100,
height:35
});
var passwordTextField=Ti.UI.createTextField({
height:35,
width:140,
passwordMask:true,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
var loginButton =Ti.UI.createButton({
title:"LOGIN",
top: 120,
width:200,
height:40
});
loginButton.addEventListener('click',function(e){
passwordTextField.blur();
nameTextField.blur();
});
self2.add(passwordLabel);
self2.add(passwordTextField);//
self.backgroundImage="http://bluebackground.com/__oneclick_uploads/2008/04/blue_background_03.jpg";
self.add(self2);
self.add(loginButton);
self.addEventListener('click',function(e){
if(e.source != [Ti.UI.TextField]){
alert("window click");
passwordTextField.blur();
nameTextField.blur();
}
});
return self;
}
module.exports = FirstView;
Saturday, 31 August 2013
Delete Function of a Class
Delete Function of a Class
I'm having trouble with the delete function. I have everything working
except the delete function.
Any help would be appreciated. I've tried to change it a bit but it still
doesn't delete. I have no idea what the problem is with my remove
function.
public class Person
{
private string name;
private string phoneNumber;
public string Name
{
set { name = value; }
get { return name; }
}
public string PhoneNumber
{
set { phoneNumber = value; }
get { return phoneNumber; }
}
public void PrintInfo()
{
Console.WriteLine();
Console.WriteLine(" Name: {0}", name);
Console.WriteLine(" Phone Number: {0}", phoneNumber);
Console.WriteLine();
}
public void SaveASCII(ref StreamWriter output)
{
output.WriteLine(name);
output.WriteLine(phoneNumber);
}
public void LoadASCII(ref StreamReader input)
{
name = input.ReadLine();
phoneNumber = input.ReadLine();
}
}
public class membershipList
{
public Person[] ML = null;
public void AddMember(Person p)
{
if (ML == null)
{
ML = new Person[1];
ML[0] = p;
}
else
{
Person[] temp = ML;
ML = new Person[temp.Length + 1];
for (int i = 0; i < temp.Length; ++i)
{
ML[i] = new Person();
ML[i] = temp[i];
}
ML[temp.Length] = new Person();
ML[temp.Length] = p;
temp = null;
}
}
public void DeleteMember(string p)
{
if (ML != null)
{
foreach (Person pers in ML)
{
if (pers.Name.ToLower().CompareTo(p.ToLower()) == 0)
{
pers.Remove();
break;
}
}
}
else Console.WriteLine("Then list is empty.");
}
// {
// int memberIndex = Array.FindIndex(ML, p => p.Name
== name);
// if (memberIndex == -1)
// {
// Console.WriteLine(name + " had not been added
before.");
// return;
// }
// else
// {
// List<Person> tmp = new List<Person>(ML);
// tmp.RemoveAt(memberIndex);
// ML = tmp.ToArray();
// }
// }
// }
public void PrintAll()
{
if (ML != null)
foreach (Person pers in ML)
pers.PrintInfo();
else Console.WriteLine("Then list is empty");
}
public void Search(string p)
{
if (ML != null)
{
foreach (Person pers in ML)
{
if (pers.Name.ToLower().CompareTo(p.ToLower()) == 0)
{
Console.WriteLine("1 Record Found:");
pers.PrintInfo();
break;
}
}
}
else Console.WriteLine("Then list is empty.");
}
public void ReadASCIIFile()
{
StreamReader input = new StreamReader("memberlist.dat"); ;
try
{
int num = Convert.ToInt32(input.ReadLine());
ML = new Person[num];
for (int i = 0; i < num; ++i)
{
ML[i] = new Person();
ML[i].LoadASCII(ref input);
}
input.Close();
}
catch (FormatException e)
{
Console.WriteLine(e.Message);
input.Close();
}
}
public void SaveASCIIFile()
{
StreamWriter output = new StreamWriter("memberlist.dat");
output.WriteLine(ML.Length);
foreach (Person pers in ML)
{
pers.SaveASCII(ref output);
}
output.Close();
}
}
class Program
{
static void Main(string[] args)
{
membershipList ML = new membershipList();
ML.ReadASCIIFile();
string option;
do
{
// Console.Clear();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("MemberShip List MENU");
Console.WriteLine();
Console.WriteLine(" a. Add");
Console.WriteLine(" b. Seach");
Console.WriteLine(" c. Delete");
Console.WriteLine(" d. Print All");
Console.WriteLine(" e. Exit");
Console.WriteLine();
Console.Write("option: ");
option = Console.ReadLine().ToLower();
switch (option)
{
case "a":
Person np = new Person();
Console.Write("Enter Name: ");
np.Name = Console.ReadLine();
Console.Write("Enter PhoneNumber: ");
np.PhoneNumber = Console.ReadLine();
ML.AddMember(np);
break;
case "b":
Console.Write("Enter Name: ");
string name = Console.ReadLine();
ML.Search(name);
break;
case "c":
Console.Write("Enter Name to be Deleted:");
string pers = Console.ReadLine();
ML.DeleteMember(pers);
break;
case "d":
ML.PrintAll();
break;
case "e":
ML.SaveASCIIFile();
Console.WriteLine("BYE...... ");
break;
default:
Console.WriteLine("Invalid Option");
break;
}
} while (option.ToLower() != "d");
}
}
I'm having trouble with the delete function. I have everything working
except the delete function.
Any help would be appreciated. I've tried to change it a bit but it still
doesn't delete. I have no idea what the problem is with my remove
function.
public class Person
{
private string name;
private string phoneNumber;
public string Name
{
set { name = value; }
get { return name; }
}
public string PhoneNumber
{
set { phoneNumber = value; }
get { return phoneNumber; }
}
public void PrintInfo()
{
Console.WriteLine();
Console.WriteLine(" Name: {0}", name);
Console.WriteLine(" Phone Number: {0}", phoneNumber);
Console.WriteLine();
}
public void SaveASCII(ref StreamWriter output)
{
output.WriteLine(name);
output.WriteLine(phoneNumber);
}
public void LoadASCII(ref StreamReader input)
{
name = input.ReadLine();
phoneNumber = input.ReadLine();
}
}
public class membershipList
{
public Person[] ML = null;
public void AddMember(Person p)
{
if (ML == null)
{
ML = new Person[1];
ML[0] = p;
}
else
{
Person[] temp = ML;
ML = new Person[temp.Length + 1];
for (int i = 0; i < temp.Length; ++i)
{
ML[i] = new Person();
ML[i] = temp[i];
}
ML[temp.Length] = new Person();
ML[temp.Length] = p;
temp = null;
}
}
public void DeleteMember(string p)
{
if (ML != null)
{
foreach (Person pers in ML)
{
if (pers.Name.ToLower().CompareTo(p.ToLower()) == 0)
{
pers.Remove();
break;
}
}
}
else Console.WriteLine("Then list is empty.");
}
// {
// int memberIndex = Array.FindIndex(ML, p => p.Name
== name);
// if (memberIndex == -1)
// {
// Console.WriteLine(name + " had not been added
before.");
// return;
// }
// else
// {
// List<Person> tmp = new List<Person>(ML);
// tmp.RemoveAt(memberIndex);
// ML = tmp.ToArray();
// }
// }
// }
public void PrintAll()
{
if (ML != null)
foreach (Person pers in ML)
pers.PrintInfo();
else Console.WriteLine("Then list is empty");
}
public void Search(string p)
{
if (ML != null)
{
foreach (Person pers in ML)
{
if (pers.Name.ToLower().CompareTo(p.ToLower()) == 0)
{
Console.WriteLine("1 Record Found:");
pers.PrintInfo();
break;
}
}
}
else Console.WriteLine("Then list is empty.");
}
public void ReadASCIIFile()
{
StreamReader input = new StreamReader("memberlist.dat"); ;
try
{
int num = Convert.ToInt32(input.ReadLine());
ML = new Person[num];
for (int i = 0; i < num; ++i)
{
ML[i] = new Person();
ML[i].LoadASCII(ref input);
}
input.Close();
}
catch (FormatException e)
{
Console.WriteLine(e.Message);
input.Close();
}
}
public void SaveASCIIFile()
{
StreamWriter output = new StreamWriter("memberlist.dat");
output.WriteLine(ML.Length);
foreach (Person pers in ML)
{
pers.SaveASCII(ref output);
}
output.Close();
}
}
class Program
{
static void Main(string[] args)
{
membershipList ML = new membershipList();
ML.ReadASCIIFile();
string option;
do
{
// Console.Clear();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("MemberShip List MENU");
Console.WriteLine();
Console.WriteLine(" a. Add");
Console.WriteLine(" b. Seach");
Console.WriteLine(" c. Delete");
Console.WriteLine(" d. Print All");
Console.WriteLine(" e. Exit");
Console.WriteLine();
Console.Write("option: ");
option = Console.ReadLine().ToLower();
switch (option)
{
case "a":
Person np = new Person();
Console.Write("Enter Name: ");
np.Name = Console.ReadLine();
Console.Write("Enter PhoneNumber: ");
np.PhoneNumber = Console.ReadLine();
ML.AddMember(np);
break;
case "b":
Console.Write("Enter Name: ");
string name = Console.ReadLine();
ML.Search(name);
break;
case "c":
Console.Write("Enter Name to be Deleted:");
string pers = Console.ReadLine();
ML.DeleteMember(pers);
break;
case "d":
ML.PrintAll();
break;
case "e":
ML.SaveASCIIFile();
Console.WriteLine("BYE...... ");
break;
default:
Console.WriteLine("Invalid Option");
break;
}
} while (option.ToLower() != "d");
}
}
capturing with parentheses - what went wrong?
capturing with parentheses - what went wrong?
415-555-1234
650-555-2345
(416)555-3456
202 555 4567
4035555678
1 416 555 9292
Good sirs: For my regex lessons, I'm trying to capture the area code of
the above numbers. Now I've got the expression below which matches all the
numbers, but my first pair of parentheses is not capturing anything.
1?\s?\(?(\d{3})\s?-?\)?(\d{3})\s?-?(\d{4})
Have I somehow converted them into a non-capturing group? How to fix?
RegexOne.com just ran off and left me alone on this one.
415-555-1234
650-555-2345
(416)555-3456
202 555 4567
4035555678
1 416 555 9292
Good sirs: For my regex lessons, I'm trying to capture the area code of
the above numbers. Now I've got the expression below which matches all the
numbers, but my first pair of parentheses is not capturing anything.
1?\s?\(?(\d{3})\s?-?\)?(\d{3})\s?-?(\d{4})
Have I somehow converted them into a non-capturing group? How to fix?
RegexOne.com just ran off and left me alone on this one.
CKEditor 4 and nonstandard HTML element
CKEditor 4 and nonstandard HTML element
Here is a nonstandard HTML element that I defined (AngularJS makes this
easy):
<exercise id="Sample Exercise" language="Scala" lectureId="5437"> This is
the text of the lecture </exercise>
If I use this element in an HTML document, each time I switch from
CKEditor's rendered mode to source mode a new empty paragraph is added
between each of the block elements in the document:
<p> </p>
The 2nd time I switch, I get two insertions:
<p> </p>
<p> </p>
The 3rd time I switch, I get three insertions between each block-level
element, etc:
<p> </p>
<p> </p>
<p> </p>
Can anyone suggest a workaround?
Here is a nonstandard HTML element that I defined (AngularJS makes this
easy):
<exercise id="Sample Exercise" language="Scala" lectureId="5437"> This is
the text of the lecture </exercise>
If I use this element in an HTML document, each time I switch from
CKEditor's rendered mode to source mode a new empty paragraph is added
between each of the block elements in the document:
<p> </p>
The 2nd time I switch, I get two insertions:
<p> </p>
<p> </p>
The 3rd time I switch, I get three insertions between each block-level
element, etc:
<p> </p>
<p> </p>
<p> </p>
Can anyone suggest a workaround?
Hibernate Inheritance SingleTable Subclass Joins
Hibernate Inheritance SingleTable Subclass Joins
Ive been working with Hibernate since a couple of weeks. Well its a very
helpful tool but i cannot resolve following task:
Table:
Create Table `Product`
(
`product_id` INT(10) PRIMARY KEY,
`package_id` INT(10) NULL,
`product_type` VARCHAR(50) NOT NULL,
`title` VARCHAR(255) NOT NULL,
`desc` VARCHAR(255) NULL,
`price` REAL(10) NOT NULL,
...
);
in Java i have 3 Classes
@Entity
@Table(name = "Product")
@DiscriminatorColumn(name = "product_type")
public abstract class Product {
...
}
there are two types of instances, where an "Item" could but may not always
deserve to a "Bundle". "Bundles" have at least one "Item"
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorValue(value = "Item")
public class Item extends Product {
Bundle bundle;
....
@ManyToOne (fetch=FetchType.LAZY, targetEntity=Bundle.class)
@JoinColumn (name="album_id")
public Bundle getBundle() {...}
public void setBundle(Bundle bundle) {...}
....
}
and:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorValue(value = "Bundle")
public class Bundle extends Product {
Set<Item> items;
....
@OneToMany (mappedBy="album", targetEntity=MusicSong.class)
@OrderBy ("track")
public Set<Item> getItems() {...}
public void setItems(Set<Item> items) {...}
....
}
At Runtime its not possible to call any data, error: Expected type:
org.blah.Bundle, actual value: org.blah.Item
does anyone have an idea or hint. isearching google up&down but i cannot
find this specific issue.
Ive been working with Hibernate since a couple of weeks. Well its a very
helpful tool but i cannot resolve following task:
Table:
Create Table `Product`
(
`product_id` INT(10) PRIMARY KEY,
`package_id` INT(10) NULL,
`product_type` VARCHAR(50) NOT NULL,
`title` VARCHAR(255) NOT NULL,
`desc` VARCHAR(255) NULL,
`price` REAL(10) NOT NULL,
...
);
in Java i have 3 Classes
@Entity
@Table(name = "Product")
@DiscriminatorColumn(name = "product_type")
public abstract class Product {
...
}
there are two types of instances, where an "Item" could but may not always
deserve to a "Bundle". "Bundles" have at least one "Item"
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorValue(value = "Item")
public class Item extends Product {
Bundle bundle;
....
@ManyToOne (fetch=FetchType.LAZY, targetEntity=Bundle.class)
@JoinColumn (name="album_id")
public Bundle getBundle() {...}
public void setBundle(Bundle bundle) {...}
....
}
and:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorValue(value = "Bundle")
public class Bundle extends Product {
Set<Item> items;
....
@OneToMany (mappedBy="album", targetEntity=MusicSong.class)
@OrderBy ("track")
public Set<Item> getItems() {...}
public void setItems(Set<Item> items) {...}
....
}
At Runtime its not possible to call any data, error: Expected type:
org.blah.Bundle, actual value: org.blah.Item
does anyone have an idea or hint. isearching google up&down but i cannot
find this specific issue.
Linker fails due to duplicate symbol
Linker fails due to duplicate symbol
Using the code below, when I try to compile
clang++ -std=c++11 -stdlib=libc++ -o test sales_function.cpp sales_prog.cpp
I get the following error
duplicate symbol __ZN10Sales_data7combineERKS_ in:
/var/folders/7f/9r4z5bs90bjfm3dy1k_g03xc0000gn/T/sales_functions-5G1FRA.o
/var/folders/7f/9r4z5bs90bjfm3dy1k_g03xc0000gn/T/sales_prog-82wDRv.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Now to get the non member functions in the file sales_functions.cpp to
work, I included the "sales_dat.h" header since struct Sales_data that the
functions uses is defined there. In that file though, I have the non
member function 'read', that is called in one of the constructors of the
struct Sales_data. So to circumvent that I forward declared struct and
declared the read function before the struct definition in sales_dat.h.
I've been trying different things like putting the definition of struct in
it's own file and putting the declaration only in the header file. But
that gave me other problems where the compiler couldn't use it's objects
in my non member function file.
That error I get, but I don't understand why I get the above error. I'm
thinking maybe it has something to do with "sales_dat.h" header being in
both sales_prog.cpp and sales_function.cpp but it seems like I had to put
it in sales_function.cpp in order for the non member function to use the
struct Sales_data objects.
What exactly is going on here? sales_functions.cpp
#include <iostream>
#include "sales_dat.h"
std::istream &read(std::istream &is, Sales_data &item)
{
double price = 0;
is >> item.bookName >> item.books_sold >> price;
item.revenue = price * item.books_sold;
return is;
}
std::ostream &print(std::ostream &os, Sales_data &item)
{
os << item.isbn() << " " << item.books_sold << " " << item.revenue;
return os;
}
Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
{
Sales_data sum = lhs;
sum.combine(rhs);
return sum;
}
sales_dat.h
#ifndef SALES_DAT_H
#define SALES_DAT_H
#include <iostream>
#include <string>
struct Sales_data;
std::istream &read(std::istream &, Sales_data &);
struct Sales_data {
std::string bookName;
std::string isbn() const { return bookName; }
Sales_data &combine(const Sales_data &);
unsigned books_available = 10;
unsigned books_sold = 0;
double revenue = 0;
unsigned total_sold = 0;
unsigned count = 1;
Sales_data() = default;
Sales_data(unsigned c) : count(c) {}
Sales_data(const std::string &s) : bookName(s) {}
Sales_data(const std::string &s, unsigned m, unsigned n, double p) :
bookName(s), books_sold(m), books_available(n), revenue(p*m) {}
Sales_data(std::istream &inpst) { read(inpst, *this); }
};
std::ostream &print(std::ostream &, Sales_data &);
Sales_data add(const Sales_data &, const Sales_data &);
Sales_data &Sales_data::combine(const Sales_data &rs)
{
count += rs.count;
books_sold += rs.books_sold;
revenue += rs.revenue;
return *this;
}
Using the code below, when I try to compile
clang++ -std=c++11 -stdlib=libc++ -o test sales_function.cpp sales_prog.cpp
I get the following error
duplicate symbol __ZN10Sales_data7combineERKS_ in:
/var/folders/7f/9r4z5bs90bjfm3dy1k_g03xc0000gn/T/sales_functions-5G1FRA.o
/var/folders/7f/9r4z5bs90bjfm3dy1k_g03xc0000gn/T/sales_prog-82wDRv.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Now to get the non member functions in the file sales_functions.cpp to
work, I included the "sales_dat.h" header since struct Sales_data that the
functions uses is defined there. In that file though, I have the non
member function 'read', that is called in one of the constructors of the
struct Sales_data. So to circumvent that I forward declared struct and
declared the read function before the struct definition in sales_dat.h.
I've been trying different things like putting the definition of struct in
it's own file and putting the declaration only in the header file. But
that gave me other problems where the compiler couldn't use it's objects
in my non member function file.
That error I get, but I don't understand why I get the above error. I'm
thinking maybe it has something to do with "sales_dat.h" header being in
both sales_prog.cpp and sales_function.cpp but it seems like I had to put
it in sales_function.cpp in order for the non member function to use the
struct Sales_data objects.
What exactly is going on here? sales_functions.cpp
#include <iostream>
#include "sales_dat.h"
std::istream &read(std::istream &is, Sales_data &item)
{
double price = 0;
is >> item.bookName >> item.books_sold >> price;
item.revenue = price * item.books_sold;
return is;
}
std::ostream &print(std::ostream &os, Sales_data &item)
{
os << item.isbn() << " " << item.books_sold << " " << item.revenue;
return os;
}
Sales_data add(const Sales_data &lhs, const Sales_data &rhs)
{
Sales_data sum = lhs;
sum.combine(rhs);
return sum;
}
sales_dat.h
#ifndef SALES_DAT_H
#define SALES_DAT_H
#include <iostream>
#include <string>
struct Sales_data;
std::istream &read(std::istream &, Sales_data &);
struct Sales_data {
std::string bookName;
std::string isbn() const { return bookName; }
Sales_data &combine(const Sales_data &);
unsigned books_available = 10;
unsigned books_sold = 0;
double revenue = 0;
unsigned total_sold = 0;
unsigned count = 1;
Sales_data() = default;
Sales_data(unsigned c) : count(c) {}
Sales_data(const std::string &s) : bookName(s) {}
Sales_data(const std::string &s, unsigned m, unsigned n, double p) :
bookName(s), books_sold(m), books_available(n), revenue(p*m) {}
Sales_data(std::istream &inpst) { read(inpst, *this); }
};
std::ostream &print(std::ostream &, Sales_data &);
Sales_data add(const Sales_data &, const Sales_data &);
Sales_data &Sales_data::combine(const Sales_data &rs)
{
count += rs.count;
books_sold += rs.books_sold;
revenue += rs.revenue;
return *this;
}
Database login doesn't seem to be working when password is correct
Database login doesn't seem to be working when password is correct
just wondering if someone can look at this code and tell me where I am
making my mistake. What the code is supposed to do is check username and
password with a database and then run an if statement to either allow the
user to view the page or just show them a "Please login" message. At this
point it is only returning the false values even if the passwords are ==.
I know I can pick up code for this on the internet, but I want to figure
out where my logic (only in my head) is going wrong. I also know I haven't
sanitized the data, but this is just a tutorial for grade 10 students just
learning HTML and CSS with a little bit of PHP. I will get to that
protecting data later. (one concept at a time)
Thanks for the help!
<?php
// connects to server
include('includes/connect2.php');
// sets post to variables, don't know if this is needed
$user=$_POST[username];
$pass=$_POST[password];
?>
<?php
// query to find information in database
$result = mysqli_query($con, "SELECT * FROM social_register WHERE
Login='$user'" );
if ($pass == $result['Password']){?>
<div id="container">
<div id="banner">
The social Site
<div id="site_logo">
<img src="images/logo_thumb.gif" />
<?php
while($row = mysqli_fetch_array($result))
{
echo $row['First_Name'] . " " . $row['Last_Name'];
echo "<br>";
}
mysqli_close($con);
?>
</div>
</div>
<div id="person">
<h1>Welcome to your test web site</h1>
</div>
</div>
<?php
}
// else part of code to display result if user is not logged in
else
{
?>
<div id="container">
<div id="banner">
The social Site
<div id="site_logo">
<img src="images/logo_thumb.gif" />
</div>
</div>
<div id="person">
<h1>You have not loged into the site, please login.</h1>
</div>
<?php
}
?>
just wondering if someone can look at this code and tell me where I am
making my mistake. What the code is supposed to do is check username and
password with a database and then run an if statement to either allow the
user to view the page or just show them a "Please login" message. At this
point it is only returning the false values even if the passwords are ==.
I know I can pick up code for this on the internet, but I want to figure
out where my logic (only in my head) is going wrong. I also know I haven't
sanitized the data, but this is just a tutorial for grade 10 students just
learning HTML and CSS with a little bit of PHP. I will get to that
protecting data later. (one concept at a time)
Thanks for the help!
<?php
// connects to server
include('includes/connect2.php');
// sets post to variables, don't know if this is needed
$user=$_POST[username];
$pass=$_POST[password];
?>
<?php
// query to find information in database
$result = mysqli_query($con, "SELECT * FROM social_register WHERE
Login='$user'" );
if ($pass == $result['Password']){?>
<div id="container">
<div id="banner">
The social Site
<div id="site_logo">
<img src="images/logo_thumb.gif" />
<?php
while($row = mysqli_fetch_array($result))
{
echo $row['First_Name'] . " " . $row['Last_Name'];
echo "<br>";
}
mysqli_close($con);
?>
</div>
</div>
<div id="person">
<h1>Welcome to your test web site</h1>
</div>
</div>
<?php
}
// else part of code to display result if user is not logged in
else
{
?>
<div id="container">
<div id="banner">
The social Site
<div id="site_logo">
<img src="images/logo_thumb.gif" />
</div>
</div>
<div id="person">
<h1>You have not loged into the site, please login.</h1>
</div>
<?php
}
?>
Directory Getfiles retrieve wrong files path
Directory Getfiles retrieve wrong files path
I'm trying to access to the path in my application.From
frm_VerifyIndentity.aspx.cs to Imgs folder.
I'm using next below code:
string pathRepositories = Request.ApplicationPath + "/IVT/Imgs/";
where the value of Request.ApplicationPath is
/IVT
And I pass this parameter to
DirectoryInfo directory = new DirectoryInfo(pathRepositories);
FileInfo[] files = directory.GetFiles("*.jpg");
Where the pathRepositories is concatenation:
/IVT/IVT/Imgs/
But, the strange, because when I check the value where the directory is
looking for, the values is next below
C:\IVT\IVT\Imgs\ instead of my pathapplication.
Thta's why I get next below error:
Somebody know why?
I'm trying to access to the path in my application.From
frm_VerifyIndentity.aspx.cs to Imgs folder.
I'm using next below code:
string pathRepositories = Request.ApplicationPath + "/IVT/Imgs/";
where the value of Request.ApplicationPath is
/IVT
And I pass this parameter to
DirectoryInfo directory = new DirectoryInfo(pathRepositories);
FileInfo[] files = directory.GetFiles("*.jpg");
Where the pathRepositories is concatenation:
/IVT/IVT/Imgs/
But, the strange, because when I check the value where the directory is
looking for, the values is next below
C:\IVT\IVT\Imgs\ instead of my pathapplication.
Thta's why I get next below error:
Somebody know why?
Friday, 30 August 2013
Python HTTP Exception Handling
Python HTTP Exception Handling
I'm running a program that downloads files from a web sit. I've introduced
one exception handling urllib.error.HTTPError, but now I'm getting from
time to time additional errors that I'm not sure how to capture:
http.client.IncompleteRead. Do I just add the following to the code at the
bottom?
except http.client.IncompleteRead:
How many exceptions do I have to add to make sure the program doesn't
stop? And do I have to add them all in the same Except statement or in
several Except statements.
try:
# Open a file object for the webpage
f = urllib.request.urlopen(imageURL)
# Open the local file where you will store the image
imageF = open('{0}{1}{2}{3}'.format(dirImages, imageName, imageNumber,
extension), 'wb')
# Write the image to the local file
imageF.write(f.read())
# Clean up
imageF.close()
f.close()
except urllib.error.HTTPError: # The 'except' block executes if an
HTTPError is thrown by the try block, then the program continues as usual.
print ("Image fetch failed.")
I'm running a program that downloads files from a web sit. I've introduced
one exception handling urllib.error.HTTPError, but now I'm getting from
time to time additional errors that I'm not sure how to capture:
http.client.IncompleteRead. Do I just add the following to the code at the
bottom?
except http.client.IncompleteRead:
How many exceptions do I have to add to make sure the program doesn't
stop? And do I have to add them all in the same Except statement or in
several Except statements.
try:
# Open a file object for the webpage
f = urllib.request.urlopen(imageURL)
# Open the local file where you will store the image
imageF = open('{0}{1}{2}{3}'.format(dirImages, imageName, imageNumber,
extension), 'wb')
# Write the image to the local file
imageF.write(f.read())
# Clean up
imageF.close()
f.close()
except urllib.error.HTTPError: # The 'except' block executes if an
HTTPError is thrown by the try block, then the program continues as usual.
print ("Image fetch failed.")
Thursday, 29 August 2013
javascript - document.GetElementByid in very easy script doesn't work
javascript - document.GetElementByid in very easy script doesn't work
I have this simple javascript/html script, but i dont'know why the
"GetElementByID" function dosen'work, anybody can help me?
The function:
function Disabilita(control)
{
if (control.checked)
{
alert ("checkbox ceccata");
document.getElementById(rag_soc_spedizione).disabled=TRUE;
document.getElementById(nome_spedizione).disabled=TRUE;
document.getElementById(cognome_spedizione).disabled=TRUE;
document.getElementById(nazione_spedizione).disabled=TRUE;
document.getElementById(provincia_spedizione).disabled=TRUE;
document.getElementById(comune_spedizione).disabled=TRUE;
}
else
alert ("checkbox non ceccata");
{
document.getElementById(rag_soc_spedizione).disabled=FALSE;
document.getElementById(nome_spedizione).disabled=FALSE;
document.getElementById(cognome_spedizione).disabled=FALSE;
document.getElementById(nazione_spedizione).disabled=FALSE;
document.getElementById(provincia_spedizione).disabled=FALSE;
document.getElementById(comune_spedizione).disabled=FALSE;
}
}
</script>
The element who the function has assigned
<input type="checkbox" value="true" name="dati-sped-fatt"
id="dati-sped-fatt" onClick="Disabilita(this)">
both allert appears but no one of controls get disabled. thanks for the
help and sorry for my poor english
I have this simple javascript/html script, but i dont'know why the
"GetElementByID" function dosen'work, anybody can help me?
The function:
function Disabilita(control)
{
if (control.checked)
{
alert ("checkbox ceccata");
document.getElementById(rag_soc_spedizione).disabled=TRUE;
document.getElementById(nome_spedizione).disabled=TRUE;
document.getElementById(cognome_spedizione).disabled=TRUE;
document.getElementById(nazione_spedizione).disabled=TRUE;
document.getElementById(provincia_spedizione).disabled=TRUE;
document.getElementById(comune_spedizione).disabled=TRUE;
}
else
alert ("checkbox non ceccata");
{
document.getElementById(rag_soc_spedizione).disabled=FALSE;
document.getElementById(nome_spedizione).disabled=FALSE;
document.getElementById(cognome_spedizione).disabled=FALSE;
document.getElementById(nazione_spedizione).disabled=FALSE;
document.getElementById(provincia_spedizione).disabled=FALSE;
document.getElementById(comune_spedizione).disabled=FALSE;
}
}
</script>
The element who the function has assigned
<input type="checkbox" value="true" name="dati-sped-fatt"
id="dati-sped-fatt" onClick="Disabilita(this)">
both allert appears but no one of controls get disabled. thanks for the
help and sorry for my poor english
ASP.NET MVC4 "Getting Started" Configuration Error
ASP.NET MVC4 "Getting Started" Configuration Error
I wanted to get started with ASP.NET MVC but everytime I try the following
error appears:
https://gist.github.com/Mythli/fd2010373157b819bf23
Is there any easy solution to this error?
I wanted to get started with ASP.NET MVC but everytime I try the following
error appears:
https://gist.github.com/Mythli/fd2010373157b819bf23
Is there any easy solution to this error?
Wednesday, 28 August 2013
How can I fetch records whose column is not 0
How can I fetch records whose column is not 0
I'm trying to add scope, in which all the records whose sign_in_count
column is not 0
How can I?
scope :confirmed, where("sign_in_count" => 0)
This probably fetches all the records whose sign_in_count is 0.
I want opposite. How can I?
I'm trying to add scope, in which all the records whose sign_in_count
column is not 0
How can I?
scope :confirmed, where("sign_in_count" => 0)
This probably fetches all the records whose sign_in_count is 0.
I want opposite. How can I?
assigning write permission to /proc/sys/vm
assigning write permission to /proc/sys/vm
I asked my sysadmin if he can do the following:
echo 0 > /proc/sys/vm/zone_reclaim_mode
He came back to me saying that he doesn't have the necessary permissions
(as root) to create a file in that directory and that directory doesn't
have write permissions (only has xr) and also that he cannot change the
permissions.
How can we add write permissions to that directory and create the required
file?
Thank you in advance.
I asked my sysadmin if he can do the following:
echo 0 > /proc/sys/vm/zone_reclaim_mode
He came back to me saying that he doesn't have the necessary permissions
(as root) to create a file in that directory and that directory doesn't
have write permissions (only has xr) and also that he cannot change the
permissions.
How can we add write permissions to that directory and create the required
file?
Thank you in advance.
Can UNION and WITH play together?
Can UNION and WITH play together?
Is there any way to use the results of a UNION in another sub-query using
a WITH clause?
Is there any way to use the results of a UNION in another sub-query using
a WITH clause?
How to handle timeouts with WebClient.UploadDataAsync method?
How to handle timeouts with WebClient.UploadDataAsync method?
Using the UploadDataAsync method of the WebClient class, how can I handle
timeouts erros properly?
I've little googled about this issue and saw that you can derive from
WebClient class and override the GetWebRequest method in order to sets
your prefered timeout period in the WebRequest.Timeout property, but on
the other hand, I saw that with Async methods like I'm using right
now(UploadDataAsync), this property is irrelevant and I should use the
WebRequest.Abort() method with custom code to handle timeouts events.
Anyone have encountered with such an issue in the past or have any idea
about how to solve it?
Using the UploadDataAsync method of the WebClient class, how can I handle
timeouts erros properly?
I've little googled about this issue and saw that you can derive from
WebClient class and override the GetWebRequest method in order to sets
your prefered timeout period in the WebRequest.Timeout property, but on
the other hand, I saw that with Async methods like I'm using right
now(UploadDataAsync), this property is irrelevant and I should use the
WebRequest.Abort() method with custom code to handle timeouts events.
Anyone have encountered with such an issue in the past or have any idea
about how to solve it?
Tuesday, 27 August 2013
Implementing multiple viewport using vtkImageViewer to display dicom images
Implementing multiple viewport using vtkImageViewer to display dicom images
hey please need another help, kinda stuck while trying to implement
multiple viewports on vtkImageViewer class to read DICOM files.
vtkActor2D *Actors[500];
vtkImageMapper *ImageMap[500];
vtkSmartPointer<vtkDICOMImageReader> reader =
vtkSmartPointer<vtkDICOMImageReader>::New();
vtkSmartPointer<vtkImageActor> viewer =
vtkSmartPointer<vtkImageActor>::New();
reader->Update();
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
// Defining the viewport ranges
double xmins[4] = {0,.5,0,.5};
double xmaxs[4] = {0.5,1,0.5,1};
double ymins[4] = {0,0,.5,.5};
double ymaxs[4]= {0.5,0.5,1,1};
for(unsigned i = 0; i < 4; i++)
{
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
renderWindow->AddRenderer(renderer);
renderer->SetViewport(xmins[i],ymins[i],xmaxs[i],ymaxs[i]);
ImageMap [i] = vtkImageMapper::New();
ImageMap[i]->SetInputConnection(resize->GetOutputPort());
Actors[i] = vtkActor2D::New();
Actors[i]->SetMapper(ImageMap[i]);
renderer->AddActor(Actors[i]);
renderer->ResetCamera();
renderWindow->Render();
renderWindow->SetWindowName("Multiple ViewPorts");
}
renderWindowInteractor->Start();
}
with this i am able to partially view the dicom images but the
renderWindowInteractor is not working. kindly help resolving this problem.
Thank you
hey please need another help, kinda stuck while trying to implement
multiple viewports on vtkImageViewer class to read DICOM files.
vtkActor2D *Actors[500];
vtkImageMapper *ImageMap[500];
vtkSmartPointer<vtkDICOMImageReader> reader =
vtkSmartPointer<vtkDICOMImageReader>::New();
vtkSmartPointer<vtkImageActor> viewer =
vtkSmartPointer<vtkImageActor>::New();
reader->Update();
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
// Defining the viewport ranges
double xmins[4] = {0,.5,0,.5};
double xmaxs[4] = {0.5,1,0.5,1};
double ymins[4] = {0,0,.5,.5};
double ymaxs[4]= {0.5,0.5,1,1};
for(unsigned i = 0; i < 4; i++)
{
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
renderWindow->AddRenderer(renderer);
renderer->SetViewport(xmins[i],ymins[i],xmaxs[i],ymaxs[i]);
ImageMap [i] = vtkImageMapper::New();
ImageMap[i]->SetInputConnection(resize->GetOutputPort());
Actors[i] = vtkActor2D::New();
Actors[i]->SetMapper(ImageMap[i]);
renderer->AddActor(Actors[i]);
renderer->ResetCamera();
renderWindow->Render();
renderWindow->SetWindowName("Multiple ViewPorts");
}
renderWindowInteractor->Start();
}
with this i am able to partially view the dicom images but the
renderWindowInteractor is not working. kindly help resolving this problem.
Thank you
MySQL join to correlate 2 fields in one Table to different records in second table
MySQL join to correlate 2 fields in one Table to different records in
second table
Relevant fields from each table:
Table 1 named crac_info: ACName, AmperageHistoryID, TemperatureHistoryID
Table 2 named julydata3: TimeStamp, HistoryID, Value
I need to correlate each AC's AmperageHistory with its TemperatureHistory
by TimeStamp (in a given minute, what are this unit's values for each?).
All values are stored in Table2, differentiated by HistoryID. The query's
purpose is to build a flat file for a BI software.
The Query I have so far gets me everything I need except the correlated
TemperatureHistoryID. My issues reside in getting the nested select\join
to make the correlation. No offense taken if I'm way off here either; I'm
the accidental DBA and I haven't gotten inside MySQLs head yet to know how
it thinks. I just need it to work sooner than my learning curve will let
me work it out on my own, and I need an efficient way to do it, so any
assistance is most welcome:
SELECT julydata3.TimeStamp AS TimeStamp, crac_info.ACName AS ACName,
julydata3.Value AS Amperage,
( SELECT historyDupe.value FROM julydata3 as historyDupe INNER JOIN
crac_info ON crac_info.history_ID = historyDupe.HISTORY_ID INNER JOIN
julydata3 on historyDupe.TIMESTAMP = julydata3.TIMESTAMP WHERE
historyDupe.TIMESTAMP = julydata3.TIMESTAMP
) AS Temperature
FROM julydata3 INNER JOIN crac_info ON julydata3.HISTORY_ID =
crac_info.AmperageHistoryID
second table
Relevant fields from each table:
Table 1 named crac_info: ACName, AmperageHistoryID, TemperatureHistoryID
Table 2 named julydata3: TimeStamp, HistoryID, Value
I need to correlate each AC's AmperageHistory with its TemperatureHistory
by TimeStamp (in a given minute, what are this unit's values for each?).
All values are stored in Table2, differentiated by HistoryID. The query's
purpose is to build a flat file for a BI software.
The Query I have so far gets me everything I need except the correlated
TemperatureHistoryID. My issues reside in getting the nested select\join
to make the correlation. No offense taken if I'm way off here either; I'm
the accidental DBA and I haven't gotten inside MySQLs head yet to know how
it thinks. I just need it to work sooner than my learning curve will let
me work it out on my own, and I need an efficient way to do it, so any
assistance is most welcome:
SELECT julydata3.TimeStamp AS TimeStamp, crac_info.ACName AS ACName,
julydata3.Value AS Amperage,
( SELECT historyDupe.value FROM julydata3 as historyDupe INNER JOIN
crac_info ON crac_info.history_ID = historyDupe.HISTORY_ID INNER JOIN
julydata3 on historyDupe.TIMESTAMP = julydata3.TIMESTAMP WHERE
historyDupe.TIMESTAMP = julydata3.TIMESTAMP
) AS Temperature
FROM julydata3 INNER JOIN crac_info ON julydata3.HISTORY_ID =
crac_info.AmperageHistoryID
header data-position='fixed' is not working in jquery mobile using phonegap for blackberry
header data-position='fixed' is not working in jquery mobile using
phonegap for blackberry
Header is scrolling(flickring) with contents in jquery mobile application
build in phonegap for blackberry OS 7.1 and 6.0 I have set viewport
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1,user-scalable=no" />
and in page header
<div data-role="header" data-theme="f" data-position="fixed" class="blue"
data-tap-toggle="false">
phonegap for blackberry
Header is scrolling(flickring) with contents in jquery mobile application
build in phonegap for blackberry OS 7.1 and 6.0 I have set viewport
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1,user-scalable=no" />
and in page header
<div data-role="header" data-theme="f" data-position="fixed" class="blue"
data-tap-toggle="false">
bootstrap modal popup not closing
bootstrap modal popup not closing
I'm having trouble using a bootstrap modal popup. Calling a popup is no
issue, but trying to close it yields strange results. Instead of just
hiding the popup and removing the backdrop, the popup gets hidden but
another backdrop gets added, turning the screen almost black. the original
backdrop does not get removed.
Below is the html code I've tried to use
<div id="popupDelete" class="modal hide fade" role="dialog">
<div class="modal-header">delete transaction line?</div>
<div class="moda-body">
<button id="deleteYes">yes</button>
<button class="cancelButton" data-dismiss="modal">no</button>
</div>
</div>
this is what I got from the bootstrap 2.3 docs and should work out of teh
bix, like everything else from bootstrap.
I've also tried using javascript with the $('#popupDelete').modal('hide');
function, which had the same effect.
I'm having trouble using a bootstrap modal popup. Calling a popup is no
issue, but trying to close it yields strange results. Instead of just
hiding the popup and removing the backdrop, the popup gets hidden but
another backdrop gets added, turning the screen almost black. the original
backdrop does not get removed.
Below is the html code I've tried to use
<div id="popupDelete" class="modal hide fade" role="dialog">
<div class="modal-header">delete transaction line?</div>
<div class="moda-body">
<button id="deleteYes">yes</button>
<button class="cancelButton" data-dismiss="modal">no</button>
</div>
</div>
this is what I got from the bootstrap 2.3 docs and should work out of teh
bix, like everything else from bootstrap.
I've also tried using javascript with the $('#popupDelete').modal('hide');
function, which had the same effect.
Make temporary Files downloadable from Website
Make temporary Files downloadable from Website
On a webservice I'm developing, a user should be able to download his data
in a HTML file. This file contains everything (including images as
base64).
Now to make the user download this, I would have to create the file and
save it on my webserver. Afterwards, I'd have to delete it using a
cronjob, because I can't figure out when the download is complete.
Is there another way? Would it be possible to download a file to the user
which does not physically exist on my webserver, but gets somehow created
temporarily?
Thank you for your help!
On a webservice I'm developing, a user should be able to download his data
in a HTML file. This file contains everything (including images as
base64).
Now to make the user download this, I would have to create the file and
save it on my webserver. Afterwards, I'd have to delete it using a
cronjob, because I can't figure out when the download is complete.
Is there another way? Would it be possible to download a file to the user
which does not physically exist on my webserver, but gets somehow created
temporarily?
Thank you for your help!
Monday, 26 August 2013
GNU make: suffix rule combined with custom rule
GNU make: suffix rule combined with custom rule
Suppose I have the following:
myfile.xyz: myfile.abc
mycommand
.SUFFIXES:
.SUFFIXES: .xyz .abc
.abc.xyz:
flip -e abc "$<" > "logs/$*.log"
Now suppose I want to have mycommand be a custom rule (as it is currently)
but also have the suffix rule run afterward (or before). That is, I do not
want my custom rule to replace the suffix rule.
Suppose I have the following:
myfile.xyz: myfile.abc
mycommand
.SUFFIXES:
.SUFFIXES: .xyz .abc
.abc.xyz:
flip -e abc "$<" > "logs/$*.log"
Now suppose I want to have mycommand be a custom rule (as it is currently)
but also have the suffix rule run afterward (or before). That is, I do not
want my custom rule to replace the suffix rule.
What would cause a 404 error for a file that definitely exists?
What would cause a 404 error for a file that definitely exists?
I just moved a Wordpress installation to a new server. Everything works
aside from all the content in the wp-content/themes directory. All the
images/css/js files contained in my themese are returning 404 errors but
the files are definitely there.
I have checked file ownership and permissions (both OK) and deleted my
.htaccess just in case but it still wont work.
I just moved a VBulletin forum in the process too and that works
perfectly. The issue is strictly with my Wordpress theme dir.
The site is http://www.hachiroku.com.au
A CSS file for example,
http://www.hachiroku.com.au/wp-content/themes/hachiroku2/style.css returns
a 404.
Thanks for your help!
I just moved a Wordpress installation to a new server. Everything works
aside from all the content in the wp-content/themes directory. All the
images/css/js files contained in my themese are returning 404 errors but
the files are definitely there.
I have checked file ownership and permissions (both OK) and deleted my
.htaccess just in case but it still wont work.
I just moved a VBulletin forum in the process too and that works
perfectly. The issue is strictly with my Wordpress theme dir.
The site is http://www.hachiroku.com.au
A CSS file for example,
http://www.hachiroku.com.au/wp-content/themes/hachiroku2/style.css returns
a 404.
Thanks for your help!
Finding a character at a specific position of a string
Finding a character at a specific position of a string
Since I am still new to PHP, I am looking for a way to find out how to get
a specific character from a string.
Example:
$word = "master";
$length = strlen($word);
$random = rand(1,$length);
So let's say the $random value is 3, then I would like to find out what
character the third one is, so in this case the character "s". If $random
was 2 I would like to know that it's a "a".
I am sure this is really easy, but I tried some substr ideas for nearly an
hour now and it always fails.
Your help would be greatly appreciated.
Since I am still new to PHP, I am looking for a way to find out how to get
a specific character from a string.
Example:
$word = "master";
$length = strlen($word);
$random = rand(1,$length);
So let's say the $random value is 3, then I would like to find out what
character the third one is, so in this case the character "s". If $random
was 2 I would like to know that it's a "a".
I am sure this is really easy, but I tried some substr ideas for nearly an
hour now and it always fails.
Your help would be greatly appreciated.
how to access client's web cam through web app
how to access client's web cam through web app
Is there any methods or library for asp.net/c# that allows users to take
picture and record video through their web cam and then directly upload to
server via web app? thanks!
Is there any methods or library for asp.net/c# that allows users to take
picture and record video through their web cam and then directly upload to
server via web app? thanks!
How to automatically keep the indentation level when a line has to be broken
How to automatically keep the indentation level when a line has to be broken
I'm using the algpseudocode package with two custom commands, \Let and
\LongState to handle automatic indentation of (broken) long lines in the
spirit of Werner's answer, which uses \parbox to wrap the long line's
content.
However, the following approach does not work well when the indentation
level is more than one. Here is an example:
\documentclass{article}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{calc}
% A command for defining assignments within the algorithmic environment which
% supports automatic indentation when the second argument is too long to fit
% on one line
\newcommand*{\Let}[2]{\State #1 $\gets$
\parbox[t]{\linewidth-\algorithmicindent-\widthof{ #1 $\gets$}}{#2\strut}}
% A \State command that supports automatic indentation when the argument's
% content is too long to fit on one line
\newcommand*{\LongState}[1]{\State
\parbox[t]{\linewidth-\algorithmicindent}{#1\strut}}
\begin{document}
\begin{algorithm}
\caption{This is some testing pseudo-code showing what happens with nested
long
lines}
\begin{algorithmic}[1]
\Function{test}{$(x, y)$}
\Let{$a$}{some math expression}
\Let{$b$}{some very very long expression that doesn't fit on one line
and is
even longer and longer}
\For{each $e$ in a list}
\Let{$l(e)$}{the length of element $e$}
\If{some condition on $l(e)$}
\LongState{run some complex sub-routine and get the result and
this
description is very very long, long indeed...}
\Let{$a$}{some math expression}
\Let{$b$}{some very very long expression that doesn't fit on one
line and is even longer and longer}
\If{some other condition}
\Let{$c$}{another math expression}
\EndIf
\EndIf
\EndFor
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{document}
The following renders as:
Line 3 is an example of a well broken long line, whereas lines 7 and 9
stretch out too far.
I'm using the algpseudocode package with two custom commands, \Let and
\LongState to handle automatic indentation of (broken) long lines in the
spirit of Werner's answer, which uses \parbox to wrap the long line's
content.
However, the following approach does not work well when the indentation
level is more than one. Here is an example:
\documentclass{article}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{calc}
% A command for defining assignments within the algorithmic environment which
% supports automatic indentation when the second argument is too long to fit
% on one line
\newcommand*{\Let}[2]{\State #1 $\gets$
\parbox[t]{\linewidth-\algorithmicindent-\widthof{ #1 $\gets$}}{#2\strut}}
% A \State command that supports automatic indentation when the argument's
% content is too long to fit on one line
\newcommand*{\LongState}[1]{\State
\parbox[t]{\linewidth-\algorithmicindent}{#1\strut}}
\begin{document}
\begin{algorithm}
\caption{This is some testing pseudo-code showing what happens with nested
long
lines}
\begin{algorithmic}[1]
\Function{test}{$(x, y)$}
\Let{$a$}{some math expression}
\Let{$b$}{some very very long expression that doesn't fit on one line
and is
even longer and longer}
\For{each $e$ in a list}
\Let{$l(e)$}{the length of element $e$}
\If{some condition on $l(e)$}
\LongState{run some complex sub-routine and get the result and
this
description is very very long, long indeed...}
\Let{$a$}{some math expression}
\Let{$b$}{some very very long expression that doesn't fit on one
line and is even longer and longer}
\If{some other condition}
\Let{$c$}{another math expression}
\EndIf
\EndIf
\EndFor
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{document}
The following renders as:
Line 3 is an example of a well broken long line, whereas lines 7 and 9
stretch out too far.
WooCommerce Payment Gateway Credit Card Edit
WooCommerce Payment Gateway Credit Card Edit
I am using Stripe Payment Gateway for my Woo-commerce website and in my
customer profile i want to make his credit card number editable, currently
there is no any default option i have found as there is only one option a
user can delete and then can add a new card but can't edit the credit card
information like card number and expiry date.
Is there any way i can do it manually?
I am using Stripe Payment Gateway for my Woo-commerce website and in my
customer profile i want to make his credit card number editable, currently
there is no any default option i have found as there is only one option a
user can delete and then can add a new card but can't edit the credit card
information like card number and expiry date.
Is there any way i can do it manually?
LibreOffice does not detects my fonts
LibreOffice does not detects my fonts
I installed some truetype fonts in following folder:
/usr/share/fonts/truetype/bfonts
Some softwares such as thunderbird detect my fonts and I can use them in
those softwares, but LibreOffice does not detect newly installed fonts.
I tried restarting LibreOffice and restarting Ubuntu as well, but no
success. Any one could help me?
I installed some truetype fonts in following folder:
/usr/share/fonts/truetype/bfonts
Some softwares such as thunderbird detect my fonts and I can use them in
those softwares, but LibreOffice does not detect newly installed fonts.
I tried restarting LibreOffice and restarting Ubuntu as well, but no
success. Any one could help me?
Sunday, 25 August 2013
C# split string into textboxes
C# split string into textboxes
I have a textbox with a list of data:
TextBox 1
A
A1
A2
A3
A4
A5
B
B1
B2
B3
B4
B5
I want to split them into 2 textboxes:
TextBox A TextBoxB
A1 B1
A2 B2
A3 B3
A4 B4
A5 B5
How can I do that? Please advise, Thanks!
I have a textbox with a list of data:
TextBox 1
A
A1
A2
A3
A4
A5
B
B1
B2
B3
B4
B5
I want to split them into 2 textboxes:
TextBox A TextBoxB
A1 B1
A2 B2
A3 B3
A4 B4
A5 B5
How can I do that? Please advise, Thanks!
How to bind nodejs with my application?
How to bind nodejs with my application?
I have a project that uses Chromium Embedded Framework (CEF). I use
chromium_dll_wrapper_project only in my project. I have binded certain
javascript functions using it. I was trying to implement filesystem now.
Since nodejs is such good i/o framework build on V8, the same engine
behind CEF, Can i somehow bind nodejs with my application so that i can
access nodejs async file system modules using my application instead of
running node.exe.
What i want is that when i process any javascript and if it has code of
nodejs, it would run ? What is the approach that i should take to do this
?
I have a project that uses Chromium Embedded Framework (CEF). I use
chromium_dll_wrapper_project only in my project. I have binded certain
javascript functions using it. I was trying to implement filesystem now.
Since nodejs is such good i/o framework build on V8, the same engine
behind CEF, Can i somehow bind nodejs with my application so that i can
access nodejs async file system modules using my application instead of
running node.exe.
What i want is that when i process any javascript and if it has code of
nodejs, it would run ? What is the approach that i should take to do this
?
Copying files into asset folder in android
Copying files into asset folder in android
I couldn't find any way to copy some files into asset folder in android. I
have to read one file over internet and save it into asset folder in
android. All the examples/tutorials talk about copying files from asset
folder but none talks about the other way round.
I will appreciate any example for this. Thanks in advance.
I couldn't find any way to copy some files into asset folder in android. I
have to read one file over internet and save it into asset folder in
android. All the examples/tutorials talk about copying files from asset
folder but none talks about the other way round.
I will appreciate any example for this. Thanks in advance.
How to add variable degree of dithering to a color bitmap with floyd-steinberg using a custom palette in C#
How to add variable degree of dithering to a color bitmap with
floyd-steinberg using a custom palette in C#
I know I'm asking a lot here, but... I have seen plenty of C# code
postings for floyd-steinberg dithering. Most don't work due to bugs. Most
of them turn the image into greyscale, which I can't allow. None of them
allow for a variable degree of dithering... it's always 100% maximum
dithering. And absolutely none of them allow me any options to specify a
custom palette / color table to be used in the final image.
What I'm looking for is working C# code that will allow me to call a
function such as:
DitherImage(mypic, ditheramount, custompalette)
..which will accept the following variables:
mypic, which is a bitmap() of any pixelformat, to be dithered.
ditheramount, which is an integer from 0 to 100. And custompalette, which
is an array of colors.
The function should simply return the dithered bitmap. The returned bitmap
should not contain any colors that were not in the custompalette array.
Again, I know I'm asking a lot, but if anyone happens to have code like
this and would like to share it, or you know where code like this is
already posted online, I would be most grateful.
floyd-steinberg using a custom palette in C#
I know I'm asking a lot here, but... I have seen plenty of C# code
postings for floyd-steinberg dithering. Most don't work due to bugs. Most
of them turn the image into greyscale, which I can't allow. None of them
allow for a variable degree of dithering... it's always 100% maximum
dithering. And absolutely none of them allow me any options to specify a
custom palette / color table to be used in the final image.
What I'm looking for is working C# code that will allow me to call a
function such as:
DitherImage(mypic, ditheramount, custompalette)
..which will accept the following variables:
mypic, which is a bitmap() of any pixelformat, to be dithered.
ditheramount, which is an integer from 0 to 100. And custompalette, which
is an array of colors.
The function should simply return the dithered bitmap. The returned bitmap
should not contain any colors that were not in the custompalette array.
Again, I know I'm asking a lot, but if anyone happens to have code like
this and would like to share it, or you know where code like this is
already posted online, I would be most grateful.
I want to create a chat or rtc system
I want to create a chat or rtc system
Chat System
Hello best learners,
I am creating a chat system. I am sending a form data through ajax method
in jquery. My first problem is ajax method is not sending data to
proccess.php and page goes to redirect to its self.
<div id="chatOutput"></div>
<form id="myform">
<textarea id="chatInput" name="chatInput"></textarea>
<input type="submit" id="send" name="send" value="send" />
</form>
and script is :
$('#send').click( function() {
$('#myform').submit();
$.ajax({
url: 'process.php',
type: 'post',
dataType: 'json',
data: $('#myform').serialize(),
success: function() {
alert("Submitted!"); // for testing
}
});
return false;
});
but script is not working and page goes to refresh and i see the variables
and its values in the address bar like get method.
if this problem goes to solve, process.php will create a chat.txt and
append data from #chatInput into it. and then will append chat.txt 's data
to #chatOutput.
After appending data, div#chatOutput 's size goes to change. I want to
fixed/specified width and height of this div. After the fixing size, how
to scroll to bottom to see the last chatting?
Chat System
Hello best learners,
I am creating a chat system. I am sending a form data through ajax method
in jquery. My first problem is ajax method is not sending data to
proccess.php and page goes to redirect to its self.
<div id="chatOutput"></div>
<form id="myform">
<textarea id="chatInput" name="chatInput"></textarea>
<input type="submit" id="send" name="send" value="send" />
</form>
and script is :
$('#send').click( function() {
$('#myform').submit();
$.ajax({
url: 'process.php',
type: 'post',
dataType: 'json',
data: $('#myform').serialize(),
success: function() {
alert("Submitted!"); // for testing
}
});
return false;
});
but script is not working and page goes to refresh and i see the variables
and its values in the address bar like get method.
if this problem goes to solve, process.php will create a chat.txt and
append data from #chatInput into it. and then will append chat.txt 's data
to #chatOutput.
After appending data, div#chatOutput 's size goes to change. I want to
fixed/specified width and height of this div. After the fixing size, how
to scroll to bottom to see the last chatting?
Saturday, 24 August 2013
Google map in visual-force component
Google map in visual-force component
The bellow component is giving returning blank(but its printing the value
"Hellow all") when used in a visualforce page ..but when used in a plain
html in my local machine is returning the map. Please advice
<apex:component >
Hello all
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
</style>
<head>
<meta name="viewport" content="initial-scale=1.0,
user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=KeyXXXX&sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"/>
</body>
</apex:component>
Thanks, Sandy
The bellow component is giving returning blank(but its printing the value
"Hellow all") when used in a visualforce page ..but when used in a plain
html in my local machine is returning the map. Please advice
<apex:component >
Hello all
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
</style>
<head>
<meta name="viewport" content="initial-scale=1.0,
user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=KeyXXXX&sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"/>
</body>
</apex:component>
Thanks, Sandy
PHP prepared statement fails to add to mysql table; Same INSERT query via CLI mysql works. Frustration ensues
PHP prepared statement fails to add to mysql table; Same INSERT query via
CLI mysql works. Frustration ensues
This is so noobish, it's driving me absolutely mad. I've been working with
mysql for about a week now so I'm reliant upon looking up error messages
and reading man pages.
I have a table imaginatively called ... 'table'. The first field is a
record ID field (INT), the next field is the date (DATETIME) and then a
user id field (INT). Everything else is a unsigned TINYINT.
I made sure that all the fields lined up properly. Making sure that I
wasn't trying to force a DATE into an INT field. Also made sure there was
a ; at the end of my query.
Here's the php, and it generates no error:
function saveEvaluation($query) {
$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
or die ('mysqli failure');
echo "<p>Attempting query: {$query}</p>";
if ($stmt = $conn->prepare($query))
$stmt->execute();
echo "error: {$mysqli->error}";
}
The query that's passed is a simple string.
INSERT INTO table VALUES (NULL, "2013-08-24 22:08:30", 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
If entered directly via mysql> it adds to the table, otherwise when the
php executes, nothing is added to the table and seeing no error.
mysql> INSERT INTO table VALUES (NULL, "2013-08-24 22:08:33", 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM table;
... table too long to add but the only entry added was from mysql> use.
Now, I have tried to bindparam() as well by simply changing the query to
$query = "INSERT INTO table VALUES (NULL, {$date}, 0, ..., 1);";
then using a
$stmt ->bindparam('s', $date);
$stmt ->execute();
That fails to add to the table and also fails silently. I have to be
missing something basic but I can't see what. Everything I've read tells
me these should be working.
The one thing I'm not sure how to verify is whether or not my DB_USER has
the rights to alter/insert on a table but I'm not sure if I should expet
that mysql would tell me that via error. I guess I'll be looking into this
while awaiting suggestions.
CLI mysql works. Frustration ensues
This is so noobish, it's driving me absolutely mad. I've been working with
mysql for about a week now so I'm reliant upon looking up error messages
and reading man pages.
I have a table imaginatively called ... 'table'. The first field is a
record ID field (INT), the next field is the date (DATETIME) and then a
user id field (INT). Everything else is a unsigned TINYINT.
I made sure that all the fields lined up properly. Making sure that I
wasn't trying to force a DATE into an INT field. Also made sure there was
a ; at the end of my query.
Here's the php, and it generates no error:
function saveEvaluation($query) {
$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
or die ('mysqli failure');
echo "<p>Attempting query: {$query}</p>";
if ($stmt = $conn->prepare($query))
$stmt->execute();
echo "error: {$mysqli->error}";
}
The query that's passed is a simple string.
INSERT INTO table VALUES (NULL, "2013-08-24 22:08:30", 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
If entered directly via mysql> it adds to the table, otherwise when the
php executes, nothing is added to the table and seeing no error.
mysql> INSERT INTO table VALUES (NULL, "2013-08-24 22:08:33", 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM table;
... table too long to add but the only entry added was from mysql> use.
Now, I have tried to bindparam() as well by simply changing the query to
$query = "INSERT INTO table VALUES (NULL, {$date}, 0, ..., 1);";
then using a
$stmt ->bindparam('s', $date);
$stmt ->execute();
That fails to add to the table and also fails silently. I have to be
missing something basic but I can't see what. Everything I've read tells
me these should be working.
The one thing I'm not sure how to verify is whether or not my DB_USER has
the rights to alter/insert on a table but I'm not sure if I should expet
that mysql would tell me that via error. I guess I'll be looking into this
while awaiting suggestions.
WebAPI not found
WebAPI not found
Sadly, I cannot get the most basic of things working with WebAPI
$.ajax({
url: "https://192.168.1.100/Api/Authentication/LogIn",
type: "POST",
contentType: "application/json",
data: "{ 'username': 'admin', 'password': 'MyPass' }",
error: function (r, s, e) { alert(e); },
success: function (d, s, r) { alert(s); }
});
I get "Not found"
API controller definition
public class AuthenticationController : ApiController
{
[HttpPost]
public bool LogIn(string username, string password)
{
return true;
}
}
If I remove HttpPost and replace it with HttpGet and then do
$.ajax({
url:
"https://192.168.1.100/Api/Authentication/LogIn?username=admin&password=MyPass",
type: "GET",
error: function (r, s, e) { alert(e); },
success: function (d, s, r) { alert(s); }
});
That works fine.
What's wrong with WebAPI?
Sadly, I cannot get the most basic of things working with WebAPI
$.ajax({
url: "https://192.168.1.100/Api/Authentication/LogIn",
type: "POST",
contentType: "application/json",
data: "{ 'username': 'admin', 'password': 'MyPass' }",
error: function (r, s, e) { alert(e); },
success: function (d, s, r) { alert(s); }
});
I get "Not found"
API controller definition
public class AuthenticationController : ApiController
{
[HttpPost]
public bool LogIn(string username, string password)
{
return true;
}
}
If I remove HttpPost and replace it with HttpGet and then do
$.ajax({
url:
"https://192.168.1.100/Api/Authentication/LogIn?username=admin&password=MyPass",
type: "GET",
error: function (r, s, e) { alert(e); },
success: function (d, s, r) { alert(s); }
});
That works fine.
What's wrong with WebAPI?
MVC Bundling - Failed to load resource
MVC Bundling - Failed to load resource
What could be causing this? I'm working with a DurandalJS project that
builds and runs locally just fine. When I try to deploy to an Azure
Website, the app publishes but fails in the browser with:
Failed to load resource: the server responded with a status of 404 (Not
Found)
http://appsite.azurewebsites.net/Scripts/vendor.js?v=KJCisWMhJYMzhLi_jWQXizLj9vHeNGfm_1c-uTOfBOM1
my bundle configs:
public class BundleConfig
{
// For more information on Bundling, visit
http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and
learn from. Then, when you're
// ready for production, use the build tool at
http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new
StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
}
}
DurandalBundleConfig:
public class DurandalBundleConfig {
public static void RegisterBundles(BundleCollection bundles) {
bundles.IgnoreList.Clear();
AddDefaultIgnorePatterns(bundles.IgnoreList);
bundles.Add(
new ScriptBundle("~/Scripts/vendor.js")
.Include("~/Scripts/jquery-{version}.js")
.Include("~/Scripts/jquery-ui-{version}.js")
.Include("~/Scripts/bootstrap.js")
.Include("~/Scripts/knockout-{version}.js")
.Include("~/Scripts/knockout.mapping-latest.js")
.Include("~/Scripts/isotope.js")
.Include("~/Scripts/toastr.js")
.Include("~/Scripts/tag-it.js")
);
bundles.Add(
new StyleBundle("~/Content/css")
.Include("~/Content/ie10mobile.css")
.Include("~/Content/app.css")
.Include("~/Content/bootstrap.min.css")
.Include("~/Content/bootstrap-responsive.min.css")
.Include("~/Content/font-awesome.min.css")
.Include("~/Content/durandal.css")
.Include("~/Content/starterkit.css")
.Include("~/Content/toastr.css")
.Include("~/Content/tag-it.css")
.Include("~/Content/zen-theme.css")
);
}
public static void AddDefaultIgnorePatterns(IgnoreList ignoreList) {
if(ignoreList == null) {
throw new ArgumentNullException("ignoreList");
}
ignoreList.Ignore("*.intellisense.js");
ignoreList.Ignore("*-vsdoc.js");
ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
//ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
//ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
}
}
In my html page I use this:
@Scripts.Render("~/Scripts/vendor.js")
This is preventing required libraries (like knockout) from loading. Could
it be something in my web.comfig? Any tips would be awesome.
What could be causing this? I'm working with a DurandalJS project that
builds and runs locally just fine. When I try to deploy to an Azure
Website, the app publishes but fails in the browser with:
Failed to load resource: the server responded with a status of 404 (Not
Found)
http://appsite.azurewebsites.net/Scripts/vendor.js?v=KJCisWMhJYMzhLi_jWQXizLj9vHeNGfm_1c-uTOfBOM1
my bundle configs:
public class BundleConfig
{
// For more information on Bundling, visit
http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and
learn from. Then, when you're
// ready for production, use the build tool at
http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new
StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
}
}
DurandalBundleConfig:
public class DurandalBundleConfig {
public static void RegisterBundles(BundleCollection bundles) {
bundles.IgnoreList.Clear();
AddDefaultIgnorePatterns(bundles.IgnoreList);
bundles.Add(
new ScriptBundle("~/Scripts/vendor.js")
.Include("~/Scripts/jquery-{version}.js")
.Include("~/Scripts/jquery-ui-{version}.js")
.Include("~/Scripts/bootstrap.js")
.Include("~/Scripts/knockout-{version}.js")
.Include("~/Scripts/knockout.mapping-latest.js")
.Include("~/Scripts/isotope.js")
.Include("~/Scripts/toastr.js")
.Include("~/Scripts/tag-it.js")
);
bundles.Add(
new StyleBundle("~/Content/css")
.Include("~/Content/ie10mobile.css")
.Include("~/Content/app.css")
.Include("~/Content/bootstrap.min.css")
.Include("~/Content/bootstrap-responsive.min.css")
.Include("~/Content/font-awesome.min.css")
.Include("~/Content/durandal.css")
.Include("~/Content/starterkit.css")
.Include("~/Content/toastr.css")
.Include("~/Content/tag-it.css")
.Include("~/Content/zen-theme.css")
);
}
public static void AddDefaultIgnorePatterns(IgnoreList ignoreList) {
if(ignoreList == null) {
throw new ArgumentNullException("ignoreList");
}
ignoreList.Ignore("*.intellisense.js");
ignoreList.Ignore("*-vsdoc.js");
ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
//ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
//ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
}
}
In my html page I use this:
@Scripts.Render("~/Scripts/vendor.js")
This is preventing required libraries (like knockout) from loading. Could
it be something in my web.comfig? Any tips would be awesome.
Change text of ActionBar when switching tabs
Change text of ActionBar when switching tabs
I hava an ActionBar with tabs on it.
actionBar = getActionBar();
// Hide Actionbar Icon
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
// Create Actionbar Tabs
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// Create first Tab
tab = actionBar.newTab().setTabListener(new BusinessActivity());
// Create your own custom icon
// tab.setIcon(R.drawable.business);
tab.setText("Business");
actionBar.addTab(tab);
The BusinessActivity class in my example is extends Fragment.
How can i change the ActionBar title when switching tabs?
Thanks.
I hava an ActionBar with tabs on it.
actionBar = getActionBar();
// Hide Actionbar Icon
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
// Create Actionbar Tabs
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// Create first Tab
tab = actionBar.newTab().setTabListener(new BusinessActivity());
// Create your own custom icon
// tab.setIcon(R.drawable.business);
tab.setText("Business");
actionBar.addTab(tab);
The BusinessActivity class in my example is extends Fragment.
How can i change the ActionBar title when switching tabs?
Thanks.
What to choose between Computer Science / Engineering? [on hold]
What to choose between Computer Science / Engineering? [on hold]
I'm from electronics background (UG), I've intense interest in
programming. Now planning for Masters.
I've written a 300+ lines of code for the purpose of school management in
BASIC. I mention it because I've logical ability to write a code. Since,
my UG was in electronics background will is it safe to jump to Computer
science, or stay back with electronics pursuing Computer engineering.
What to choose between Computer Science / Engineering?
I'm from electronics background (UG), I've intense interest in
programming. Now planning for Masters.
I've written a 300+ lines of code for the purpose of school management in
BASIC. I mention it because I've logical ability to write a code. Since,
my UG was in electronics background will is it safe to jump to Computer
science, or stay back with electronics pursuing Computer engineering.
What to choose between Computer Science / Engineering?
Final cut auto split on black frames
Final cut auto split on black frames
i'm new to Final Cut Pro X. I'm wondering if there's a function that
automatically splits a clip into pieces every time there's a black scene.
It's quite common to cover the camera after each scene. for example, this
video: http://www.youtube.com/watch?v=Vkjt5QR1lmU i would like that final
cut splits it every time there's a black (in this case graey) frame.
is it possible?
i'm new to Final Cut Pro X. I'm wondering if there's a function that
automatically splits a clip into pieces every time there's a black scene.
It's quite common to cover the camera after each scene. for example, this
video: http://www.youtube.com/watch?v=Vkjt5QR1lmU i would like that final
cut splits it every time there's a black (in this case graey) frame.
is it possible?
Gmail and Google Group
Gmail and Google Group
Suppose if I am using G-mail and i want to go my Google group home page.
How do i do that WITHOUT Signing out of my G-mail account. Is this
possible?? I can go from Google Group to G-mail by clicking on the G-mail
icon n the panel above but there is no such icon for google group. Please
Help
Akshay
Suppose if I am using G-mail and i want to go my Google group home page.
How do i do that WITHOUT Signing out of my G-mail account. Is this
possible?? I can go from Google Group to G-mail by clicking on the G-mail
icon n the panel above but there is no such icon for google group. Please
Help
Akshay
Change fields of case class based on map entries with simple type check in scala macros
Change fields of case class based on map entries with simple type check in
scala macros
I want to write a scala macros that can override field values of case
class based on map entries with simple type check. In case original field
type and override value type are compatible set new value otherwise keep
original value.
So far I have following code:
import language.experimental.macros
import scala.reflect.macros.Context
object ProductUtils {
def withOverrides[T](entity: T, overrides: Map[String, Any]): T =
macro withOverridesImpl[T]
def withOverridesImpl[T: c.WeakTypeTag](c: Context)
(entity: c.Expr[T],
overrides:
c.Expr[Map[String, Any]]):
c.Expr[T] = {
import c.universe._
val originalEntityTree = reify(entity.splice).tree
val originalEntityCopy =
entity.actualType.member(newTermName("copy"))
val originalEntity =
weakTypeOf[T].declarations.collect {
case m: MethodSymbol if m.isCaseAccessor =>
(m.name, c.Expr[T](Select(originalEntityTree,
m.name)), m.returnType)
}
val values =
originalEntity.map {
case (name, value, ctype) =>
AssignOrNamedArg(
Ident(name),
{
def reifyWithType[K: WeakTypeTag] = reify {
overrides
.splice
.asInstanceOf[Map[String, Any]]
.get(c.literal(name.decoded).splice)
match {
case Some(newValue : K) =>
newValue
case _ =>
value.splice
}
}
reifyWithType(c.WeakTypeTag(ctype)).tree
}
)
}.toList
originalEntityCopy match {
case s: MethodSymbol =>
c.Expr[T](
Apply(Select(originalEntityTree,
originalEntityCopy), values))
case _ => c.abort(c.enclosingPosition, "No eligible copy
method!")
}
}
}
Executed like this:
import macros.ProductUtils
case class Example(field1: String, field2: Int, filed3: String)
object MacrosTest {
def main(args: Array[String]) {
val overrides = Map("field1" -> "new value", "field2" ->
"wrong type")
println(ProductUtils.withOverrides(Example("", 0, ""),
overrides)) // Example("new value", 0, "")
}
}
As you can see, I've managed to get type of original field and now want to
pattern match on it in reifyWithType.
Unfortunately in current implementation I`m getting a warning during
compilation:
warning: abstract type pattern K is unchecked since it is eliminated by
erasure case Some(newValue : K) => newValue
and a compiler crash in IntelliJ:
Exception in thread "main" java.lang.NullPointerException
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preEraseAsInstanceOf$1(Erasure.scala:1032)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preEraseNormalApply(Erasure.scala:1083)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preEraseApply(Erasure.scala:1187)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preErase(Erasure.scala:1193)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1268)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1018)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1217)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:13)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:13)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2897)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:48)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1280)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1018)
So the questions are:
* Is it possible to make type comparison of type received in macro to
value runtime type?
* Or is there any better approach to solve this task?
scala macros
I want to write a scala macros that can override field values of case
class based on map entries with simple type check. In case original field
type and override value type are compatible set new value otherwise keep
original value.
So far I have following code:
import language.experimental.macros
import scala.reflect.macros.Context
object ProductUtils {
def withOverrides[T](entity: T, overrides: Map[String, Any]): T =
macro withOverridesImpl[T]
def withOverridesImpl[T: c.WeakTypeTag](c: Context)
(entity: c.Expr[T],
overrides:
c.Expr[Map[String, Any]]):
c.Expr[T] = {
import c.universe._
val originalEntityTree = reify(entity.splice).tree
val originalEntityCopy =
entity.actualType.member(newTermName("copy"))
val originalEntity =
weakTypeOf[T].declarations.collect {
case m: MethodSymbol if m.isCaseAccessor =>
(m.name, c.Expr[T](Select(originalEntityTree,
m.name)), m.returnType)
}
val values =
originalEntity.map {
case (name, value, ctype) =>
AssignOrNamedArg(
Ident(name),
{
def reifyWithType[K: WeakTypeTag] = reify {
overrides
.splice
.asInstanceOf[Map[String, Any]]
.get(c.literal(name.decoded).splice)
match {
case Some(newValue : K) =>
newValue
case _ =>
value.splice
}
}
reifyWithType(c.WeakTypeTag(ctype)).tree
}
)
}.toList
originalEntityCopy match {
case s: MethodSymbol =>
c.Expr[T](
Apply(Select(originalEntityTree,
originalEntityCopy), values))
case _ => c.abort(c.enclosingPosition, "No eligible copy
method!")
}
}
}
Executed like this:
import macros.ProductUtils
case class Example(field1: String, field2: Int, filed3: String)
object MacrosTest {
def main(args: Array[String]) {
val overrides = Map("field1" -> "new value", "field2" ->
"wrong type")
println(ProductUtils.withOverrides(Example("", 0, ""),
overrides)) // Example("new value", 0, "")
}
}
As you can see, I've managed to get type of original field and now want to
pattern match on it in reifyWithType.
Unfortunately in current implementation I`m getting a warning during
compilation:
warning: abstract type pattern K is unchecked since it is eliminated by
erasure case Some(newValue : K) => newValue
and a compiler crash in IntelliJ:
Exception in thread "main" java.lang.NullPointerException
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preEraseAsInstanceOf$1(Erasure.scala:1032)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preEraseNormalApply(Erasure.scala:1083)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preEraseApply(Erasure.scala:1187)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preErase(Erasure.scala:1193)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1268)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1018)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1217)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:13)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:13)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2897)
at
scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:48)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1280)
at
scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1018)
So the questions are:
* Is it possible to make type comparison of type received in macro to
value runtime type?
* Or is there any better approach to solve this task?
Friday, 23 August 2013
How to embedding ImageView class (emgucv) into c# form
How to embedding ImageView class (emgucv) into c# form
I want to embedding ImageView class (emgucv) into c# form, can I do that?
If yes, how to do that, thank you
I want to embedding ImageView class (emgucv) into c# form, can I do that?
If yes, how to do that, thank you
executing within java a commandline bash command with no output is not executed like
executing within java a commandline bash command with no output is not
executed like
using this code:
private String executeCommand(String cmd ) {
Process p;
try {
p = Runtime.getRuntime().exec(cmd);
BufferedReader br = new BufferedReader(
new InputStreamReader(p.getInputStream()));
while ((commandlineOutput = br.readLine()) != null){
System.out.println("line:" + commandlineOutput);
}
p.waitFor();
System.out.println (p.exitValue());
p.destroy();
} catch (Exception e) {}
}
return commandlineOutput;
}
I run into the following problem: all commands that generate some output
are executed normal, but some commands not generating output are not
executed for instance : rm *.jpg is not working but mkdir is, I can not
see the difference
I am quite a newbie, googled quite some time but this particular problem
is never mentioned please help me out thanks
executed like
using this code:
private String executeCommand(String cmd ) {
Process p;
try {
p = Runtime.getRuntime().exec(cmd);
BufferedReader br = new BufferedReader(
new InputStreamReader(p.getInputStream()));
while ((commandlineOutput = br.readLine()) != null){
System.out.println("line:" + commandlineOutput);
}
p.waitFor();
System.out.println (p.exitValue());
p.destroy();
} catch (Exception e) {}
}
return commandlineOutput;
}
I run into the following problem: all commands that generate some output
are executed normal, but some commands not generating output are not
executed for instance : rm *.jpg is not working but mkdir is, I can not
see the difference
I am quite a newbie, googled quite some time but this particular problem
is never mentioned please help me out thanks
Using axioms to define metric spaces
Using axioms to define metric spaces
Let $M$ be a set with three elements: $a, b,$ and $c$. Define $D$ so that
$D(x, x) = 0$ for all $x, D(x, y) = D(y, x) =$ a positive real number for
$x \not= y$. Say $D(a, b) = r, D(a, c) = s, D(b, c) = t : r <= s <= t$.
Prove D makes M a metric space iff $t <= r + s$.
I have no idea on how to begin this proof. I've taken multiple stabs at it
but to no success.
Let $M$ be a set with three elements: $a, b,$ and $c$. Define $D$ so that
$D(x, x) = 0$ for all $x, D(x, y) = D(y, x) =$ a positive real number for
$x \not= y$. Say $D(a, b) = r, D(a, c) = s, D(b, c) = t : r <= s <= t$.
Prove D makes M a metric space iff $t <= r + s$.
I have no idea on how to begin this proof. I've taken multiple stabs at it
but to no success.
Haskell QuickCheck generate random data for function with many input variables
Haskell QuickCheck generate random data for function with many input
variables
I have a function with the following type signature
rndListIndex :: Double -> Double -> Double -> Double
rndListIndex maxIdx r1 r2 = …
the first input should be a value coming from a non-negative integer
the second and third input are required to be within the closed interval
[0.0,1.0] otherwise the function makes no sense
the function has the property of
prop_alwaysLessThanMaxIdx idx r1 r2 = (rndListIndex idx r1 r2 <= idx)
how do I generate random data for maxIdx and r1,r2 separately; I know of
the function choosebut do not know how to use it with more than one input
variable.
For now I have tested the Property with fixed idx, which is not the way it
should be tested.
variables
I have a function with the following type signature
rndListIndex :: Double -> Double -> Double -> Double
rndListIndex maxIdx r1 r2 = …
the first input should be a value coming from a non-negative integer
the second and third input are required to be within the closed interval
[0.0,1.0] otherwise the function makes no sense
the function has the property of
prop_alwaysLessThanMaxIdx idx r1 r2 = (rndListIndex idx r1 r2 <= idx)
how do I generate random data for maxIdx and r1,r2 separately; I know of
the function choosebut do not know how to use it with more than one input
variable.
For now I have tested the Property with fixed idx, which is not the way it
should be tested.
Bridge between simulated network and real host
Bridge between simulated network and real host
I need to build a bridge (tap) between a simulated network (NS-3) and the
real Linux host So when the "bridged" node receive a packet in NS-3, the
real Linux host receive the packet. How i can build such bridge? Could you
give example? Thanks.
I need to build a bridge (tap) between a simulated network (NS-3) and the
real Linux host So when the "bridged" node receive a packet in NS-3, the
real Linux host receive the packet. How i can build such bridge? Could you
give example? Thanks.
A werid double calculating in VS2008
A werid double calculating in VS2008
Recently I am working on a project and encounter a werid problem in
VS2008. In my project, some calculating is needed, but after the
calculating I get an illegal value ( -1.#IND000000000000).
For example:
double a,b,c,d;
And I want to get d by:
d=a*b+c*c;
But the result is -1.#IND000000000000.
However, if I calculat a*b first:
double e=a*b;
Then I get the right value of d by:
d=e+c*c;
I have worked on this problem for a long time and hope some hospital
friends could give me some suggestion! Thanks very much.
Recently I am working on a project and encounter a werid problem in
VS2008. In my project, some calculating is needed, but after the
calculating I get an illegal value ( -1.#IND000000000000).
For example:
double a,b,c,d;
And I want to get d by:
d=a*b+c*c;
But the result is -1.#IND000000000000.
However, if I calculat a*b first:
double e=a*b;
Then I get the right value of d by:
d=e+c*c;
I have worked on this problem for a long time and hope some hospital
friends could give me some suggestion! Thanks very much.
Thursday, 22 August 2013
Vim uses system ruby and python
Vim uses system ruby and python
I have installed Python and Ruby using Homebrew and RVM respectively and
they work fine in terminal, but Vim (both system and MacVim from Homebrew)
launches system ones for some reason. :! which python returns
/usr/bin/python while which python in console returns
/usr/local/bin/python
I have installed Python and Ruby using Homebrew and RVM respectively and
they work fine in terminal, but Vim (both system and MacVim from Homebrew)
launches system ones for some reason. :! which python returns
/usr/bin/python while which python in console returns
/usr/local/bin/python
Getting Modelsim similation time instant as a string variable?
Getting Modelsim similation time instant as a string variable?
I know when using "report" and "severity" Modelsim displays the simulation
time instant as part of its message to the console. Is there anyway to
"get" this time instant as a string variable so I can print my own message
with this "time" string?
Thanks
I know when using "report" and "severity" Modelsim displays the simulation
time instant as part of its message to the console. Is there anyway to
"get" this time instant as a string variable so I can print my own message
with this "time" string?
Thanks
How To Free Watch Detroit Lions vs New England Patriots Live Broadcast Streaming preseason week 3 NFL Free Video
How To Free Watch Detroit Lions vs New England Patriots Live Broadcast
Streaming preseason week 3 NFL Free Video
Watch New England Patriots vs Detroit Lions Live preseason week 3 Stream
Online Watch your favorite New England Patriots vs Detroit Lions online
NFL streaming online Today. This event will take place in preseason week 3
Most wanted game. preseason week 3 streamers never miss this match. New
England Patriots vs Detroit Lions exciting NFL match streaming live at
7:30pm. Get instant access Here to watch New England Patriots vs Detroit
Lions Live Match.
http://watchnflliveto.blogspot.com/
http://watchnflliveto.blogspot.com/
Match Details: New England Patriots vs Detroit Lions Live preseason week 3
NFL 7:30pm AUGUST 22 Watch New England Patriots vs Detroit Lions Live Here
Watch New England Patriots vs Detroit Lions Live on PC TV Competition:
National Football League(preseason week 3 )
Who will win this New England Patriots vs Detroit Lions match?. We are
also awaiting the outcome of the preseason week 3 hottest match. Do not
wait,preseason week 3 lovers watch and enjoy New England Patriots vs
Detroit Lions Live broadcast per second. How to watch New England Patriots
vs Detroit Lions Live match?. Look at the link below and you are entitled
to access to this great NFL match. watch and enjoy New England Patriots vs
Detroit Lions game live on your PC TV. Watch preseason week 3 live NFL
free online satellite TV, cable TV to watch the pay per view online live
and in HD on the PC over the Internet. Everyone watch the live preseason
week 3 NFL matches and other sporting events live has never been so easy.
Get instant access to the widest possible coverage ofpreseason week 3
matches on the web directly to your desktop from anywhere. When you talk
about a major sporting event, this New England Patriots vs Detroit Lions
game is one of the best. preseason week 3 NFL fans, do not miss it, you
get links from the site MyliveonlinesportsTv. NFL Dreamers enjoy watching
NFL on TV game New England Patriots vs Detroit Lions Live and feel Free.
So guys, if you can not follow the New England Patriots vs Detroit Lions
game live on your PCTV, do not worry, you can still watch the preseason
week 3 game online from your PC to listen. Well sports fans, do not leave
live online for only a glance.
New England Patriots vs Detroit Lions Live New England Patriots vs Detroit
Lions Live broadcast, New England Patriots vs Detroit Lions Live feed, New
England Patriots vs Detroit Lions Live free, New England Patriots vs
Detroit Lions Live free link on pc, New England Patriots vs Detroit Lions
Live hd online, New England Patriots vs Detroit Lions Live link, New
England Patriots vs Detroit Lions Live on pc free, New England Patriots vs
Detroit Lions Live Online, New England Patriots vs Detroit Lions Live
online channel, New England Patriots vs Detroit Lions Live online
coverage, New England Patriots vs Detroit Lions Live p2p, New England
Patriots vs Detroit Lions Live sopcast, New England Patriots vs Detroit
Lions Live stream, New England Patriots vs Detroit Lions Live Streaming,
New England Patriots vs Detroit Lions Live preseason week 3 NFL, New
England Patriots vs Detroit Lions Live tv, New England Patriots vs Detroit
Lions Live Video, Free New England Patriots vs Detroit Lions Live, Free
streaming New England Patriots vs Detroit Lions Live, Live online New
England Patriots vs Detroit Lions, Live Streaming preseason week 3 NFL
channel, Live preseason week 3 NFL channel, Live preseason week 3 NFL
feed, live preseason week 3 NFL internet tv, live preseason week 3 NFL
sopcast link, live preseason week 3 NFL streaming tv, live preseason week
3 NFL tv, live tv New England Patriots vs Detroit Lions,preseason week 3
NFL live streaming link,preseason week 3 NFL Live tv, watch New England
Patriots vs Detroit Lions Live
Streaming preseason week 3 NFL Free Video
Watch New England Patriots vs Detroit Lions Live preseason week 3 Stream
Online Watch your favorite New England Patriots vs Detroit Lions online
NFL streaming online Today. This event will take place in preseason week 3
Most wanted game. preseason week 3 streamers never miss this match. New
England Patriots vs Detroit Lions exciting NFL match streaming live at
7:30pm. Get instant access Here to watch New England Patriots vs Detroit
Lions Live Match.
http://watchnflliveto.blogspot.com/
http://watchnflliveto.blogspot.com/
Match Details: New England Patriots vs Detroit Lions Live preseason week 3
NFL 7:30pm AUGUST 22 Watch New England Patriots vs Detroit Lions Live Here
Watch New England Patriots vs Detroit Lions Live on PC TV Competition:
National Football League(preseason week 3 )
Who will win this New England Patriots vs Detroit Lions match?. We are
also awaiting the outcome of the preseason week 3 hottest match. Do not
wait,preseason week 3 lovers watch and enjoy New England Patriots vs
Detroit Lions Live broadcast per second. How to watch New England Patriots
vs Detroit Lions Live match?. Look at the link below and you are entitled
to access to this great NFL match. watch and enjoy New England Patriots vs
Detroit Lions game live on your PC TV. Watch preseason week 3 live NFL
free online satellite TV, cable TV to watch the pay per view online live
and in HD on the PC over the Internet. Everyone watch the live preseason
week 3 NFL matches and other sporting events live has never been so easy.
Get instant access to the widest possible coverage ofpreseason week 3
matches on the web directly to your desktop from anywhere. When you talk
about a major sporting event, this New England Patriots vs Detroit Lions
game is one of the best. preseason week 3 NFL fans, do not miss it, you
get links from the site MyliveonlinesportsTv. NFL Dreamers enjoy watching
NFL on TV game New England Patriots vs Detroit Lions Live and feel Free.
So guys, if you can not follow the New England Patriots vs Detroit Lions
game live on your PCTV, do not worry, you can still watch the preseason
week 3 game online from your PC to listen. Well sports fans, do not leave
live online for only a glance.
New England Patriots vs Detroit Lions Live New England Patriots vs Detroit
Lions Live broadcast, New England Patriots vs Detroit Lions Live feed, New
England Patriots vs Detroit Lions Live free, New England Patriots vs
Detroit Lions Live free link on pc, New England Patriots vs Detroit Lions
Live hd online, New England Patriots vs Detroit Lions Live link, New
England Patriots vs Detroit Lions Live on pc free, New England Patriots vs
Detroit Lions Live Online, New England Patriots vs Detroit Lions Live
online channel, New England Patriots vs Detroit Lions Live online
coverage, New England Patriots vs Detroit Lions Live p2p, New England
Patriots vs Detroit Lions Live sopcast, New England Patriots vs Detroit
Lions Live stream, New England Patriots vs Detroit Lions Live Streaming,
New England Patriots vs Detroit Lions Live preseason week 3 NFL, New
England Patriots vs Detroit Lions Live tv, New England Patriots vs Detroit
Lions Live Video, Free New England Patriots vs Detroit Lions Live, Free
streaming New England Patriots vs Detroit Lions Live, Live online New
England Patriots vs Detroit Lions, Live Streaming preseason week 3 NFL
channel, Live preseason week 3 NFL channel, Live preseason week 3 NFL
feed, live preseason week 3 NFL internet tv, live preseason week 3 NFL
sopcast link, live preseason week 3 NFL streaming tv, live preseason week
3 NFL tv, live tv New England Patriots vs Detroit Lions,preseason week 3
NFL live streaming link,preseason week 3 NFL Live tv, watch New England
Patriots vs Detroit Lions Live
Turning a chain of foreach's for inserting elements from a list into another list into linq
Turning a chain of foreach's for inserting elements from a list into
another list into linq
I've been at it for a couple of hours and the only conclusion I achieved
is that I need to pick up a good book about Linq.
So here's the deal: I have three lists of objects of the following classes
(I'll refer to them as "parent lists" from now on:
public class State
{
public int IdState {get; set;}
public string NameState {get; set;}
private IList<City> cityList = new List<City>();
public void AddCity(City city)
{
cityList.Add(city);
}
}
public class City
{
public int IdCity { get; set; }
public string NameCity { get; set; }
public int IdState { get; set; }
private IList<Company> companyList = new List<Company>();
public void AddCompany(Company company)
{
companyList.Add(company);
}
}
public class Company
{
public int IdCompany { get; set; }
public string NameCompany { get; set; }
public int IdCity { get; set; }
}
I think from here is pretty straight forward to explain what I want: A
single list of States, of which cityList is populated with the appropriate
cities in that state and each companyList list in each City is populated
with the companies in that city. In other words, a list of states which
each state branches into its cities and then each city branches into the
companies in them.
So, my parent lists are:
private List<State> finalList; //This is the "parent list supreme"
which I'll send to the client-side
private List<City> cityList; //Auxiliary
private List<Company> companyList; //Auxiliary; this one does not
exist in the actual code but I'm putting it here for simplification
purposes
It really doesn't matter how but thanks to linq "magic", I'm able to fill
up those lists with the proper states, cities and companies, however, I
can't figure out how to fill up the proper cities and companies into
State.cityList and City.companyList through link. As it stands, I'm using
a very ugly chain of foreach's:
foreach (State state in finalList)
{
foreach (City city in cityList)
{
if (city.IdState == state.IdState)
{
state.AddCity(city);
foreach (Company company in companyList)
{
if (line.idCity == city.IdCity)
city.AddCompany(company);
}
}
}
}
Ugly, right? So, how do I go about achieving the same thing with linq? I
think maybe an even more valid question: is it worth using linq in this
case (it all points to "yes" but figures...)?
BTW: this way works just as I expect
another list into linq
I've been at it for a couple of hours and the only conclusion I achieved
is that I need to pick up a good book about Linq.
So here's the deal: I have three lists of objects of the following classes
(I'll refer to them as "parent lists" from now on:
public class State
{
public int IdState {get; set;}
public string NameState {get; set;}
private IList<City> cityList = new List<City>();
public void AddCity(City city)
{
cityList.Add(city);
}
}
public class City
{
public int IdCity { get; set; }
public string NameCity { get; set; }
public int IdState { get; set; }
private IList<Company> companyList = new List<Company>();
public void AddCompany(Company company)
{
companyList.Add(company);
}
}
public class Company
{
public int IdCompany { get; set; }
public string NameCompany { get; set; }
public int IdCity { get; set; }
}
I think from here is pretty straight forward to explain what I want: A
single list of States, of which cityList is populated with the appropriate
cities in that state and each companyList list in each City is populated
with the companies in that city. In other words, a list of states which
each state branches into its cities and then each city branches into the
companies in them.
So, my parent lists are:
private List<State> finalList; //This is the "parent list supreme"
which I'll send to the client-side
private List<City> cityList; //Auxiliary
private List<Company> companyList; //Auxiliary; this one does not
exist in the actual code but I'm putting it here for simplification
purposes
It really doesn't matter how but thanks to linq "magic", I'm able to fill
up those lists with the proper states, cities and companies, however, I
can't figure out how to fill up the proper cities and companies into
State.cityList and City.companyList through link. As it stands, I'm using
a very ugly chain of foreach's:
foreach (State state in finalList)
{
foreach (City city in cityList)
{
if (city.IdState == state.IdState)
{
state.AddCity(city);
foreach (Company company in companyList)
{
if (line.idCity == city.IdCity)
city.AddCompany(company);
}
}
}
}
Ugly, right? So, how do I go about achieving the same thing with linq? I
think maybe an even more valid question: is it worth using linq in this
case (it all points to "yes" but figures...)?
BTW: this way works just as I expect
Getting IDL (for TLB) from a COM+ dll when it is not provided
Getting IDL (for TLB) from a COM+ dll when it is not provided
I have a .dll that contains some directshow filters (COM) with
specific/custom interfaces to query.
Most 3rd party directshow components contain embedded .tlb files that can
be used for cross-enviroment communication (C# typelib import).
I would hate to have to attempt to manually create the interfaces needed
for c# because no idl/tlb files were provided.
Is it possible to generate a tlb (or at least, an idl, which I can MIDL
compile) from a COM .dll?
I have a .dll that contains some directshow filters (COM) with
specific/custom interfaces to query.
Most 3rd party directshow components contain embedded .tlb files that can
be used for cross-enviroment communication (C# typelib import).
I would hate to have to attempt to manually create the interfaces needed
for c# because no idl/tlb files were provided.
Is it possible to generate a tlb (or at least, an idl, which I can MIDL
compile) from a COM .dll?
c++ QT designer inactive
c++ QT designer inactive
I am new to QT and I am having a problem with it. In the design tab, the
widget box on the left is completely inactive. I tried making a new
project and the problem still exists. Any idea what would be the problem ?
I am new to QT and I am having a problem with it. In the design tab, the
widget box on the left is completely inactive. I tried making a new
project and the problem still exists. Any idea what would be the problem ?
IE10 does not support css link in iframe
IE10 does not support css link in iframe
I have iframe, which loaded dynamically. Content in this iframe should be
styled like page on which it's located. To do this I added link to css
file to iframe head. It works OK in Firefox, but it doesn't work in IE10.
Is it known issue?
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#dialogIframe').load(function(){
$('#dialogIframe')
.contents().find("body")
.html("test iframe");
$('#dialogIframe')
.contents().find("head")
.html('<link rel="stylesheet" type="text/css"
href="/css/main.css">');
});
});
</script>
</head>
<body>
Test
<iframe id="dialogIframe" style="width:300px; height:300px; border: none;">
</iframe>
</body>
</html>
http://jsfiddle.net/YwCRf/
I have iframe, which loaded dynamically. Content in this iframe should be
styled like page on which it's located. To do this I added link to css
file to iframe head. It works OK in Firefox, but it doesn't work in IE10.
Is it known issue?
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#dialogIframe').load(function(){
$('#dialogIframe')
.contents().find("body")
.html("test iframe");
$('#dialogIframe')
.contents().find("head")
.html('<link rel="stylesheet" type="text/css"
href="/css/main.css">');
});
});
</script>
</head>
<body>
Test
<iframe id="dialogIframe" style="width:300px; height:300px; border: none;">
</iframe>
</body>
</html>
http://jsfiddle.net/YwCRf/
Wednesday, 21 August 2013
jquery: can't get input value
jquery: can't get input value
I'm trying send my value to ajax but it seems empty parameter. Then I try
like:
<input type="text" id="IDtag"/>
<button id="check"></button>
$('#check').click(function(){
var IDnum = $("#IDtag").val();
alert (IDnum);
});
alert is null even I already fill some value into IDtag.
UPDATE
I'm trying send my value to ajax but it seems empty parameter. Then I try
like:
<input type="text" id="IDtag"/>
<button id="check"></button>
$('#check').click(function(){
var IDnum = $("#IDtag").val();
alert (IDnum);
});
alert is null even I already fill some value into IDtag.
UPDATE
Web Services with SQLite
Web Services with SQLite
I am developing an android dashboard app to display various charts. I am
having a local SQLLitedatabase in my application which contains all the
values to be displayed.
But I want that whenever my app loads my db should get refreshed by
hitting a web server if data connection is ON or else it should display
the charts with the local db in offline mode.
Can I update my db using the JSON parser provided by the Android API?
Please suggest the best protocol for this
I am developing an android dashboard app to display various charts. I am
having a local SQLLitedatabase in my application which contains all the
values to be displayed.
But I want that whenever my app loads my db should get refreshed by
hitting a web server if data connection is ON or else it should display
the charts with the local db in offline mode.
Can I update my db using the JSON parser provided by the Android API?
Please suggest the best protocol for this
Chain of C libraries into C++
Chain of C libraries into C++
I have a very trivial problem including a chain of C libraries into a C++
main project. I've experience with C but it's the first time that I'm
programming in C++.
The structure of the project is a single folder with inside:
main.cpp
Mylib_1.c
Mylib_1.h
Mylib_2.c
Mylib_2.h
main calls -> Mylib_1.h that calls -> My_lib2.h
//main.cpp
#include "Mylib_1.h"
//Mylib_1.h
#include "Mylib_2.h"
main contains both Mylib_1 and Mylib_2 functions and typedef structs
Mylib_1 uses typedef structs and functions of Mylib_2
Everything inside each Mylib_x.h is wrapped between extern "C", like this:
#ifndef __MYLIB_X_H
#define __MYLIB_X_H
#ifdef __cplusplus
extern "C" {
I have a very trivial problem including a chain of C libraries into a C++
main project. I've experience with C but it's the first time that I'm
programming in C++.
The structure of the project is a single folder with inside:
main.cpp
Mylib_1.c
Mylib_1.h
Mylib_2.c
Mylib_2.h
main calls -> Mylib_1.h that calls -> My_lib2.h
//main.cpp
#include "Mylib_1.h"
//Mylib_1.h
#include "Mylib_2.h"
main contains both Mylib_1 and Mylib_2 functions and typedef structs
Mylib_1 uses typedef structs and functions of Mylib_2
Everything inside each Mylib_x.h is wrapped between extern "C", like this:
#ifndef __MYLIB_X_H
#define __MYLIB_X_H
#ifdef __cplusplus
extern "C" {
NEW FACEBOOK ACCOUNT ERROR
NEW FACEBOOK ACCOUNT ERROR
I was just trying to create a NEW Facebook account using the email address
(kraevin0507@gmail.com). However for some reason when scrolling down the
birth year column it froze at a year in the 2000's. When i hit refresh it
made me ineligable. I know i am old enough because i was born in 1987. My
name that I was under was KRaevin Armstrong. So Now that you can verify
who i am, exactly how can i correct this problem so that i may create the
account? And start my facebook experience?
I was just trying to create a NEW Facebook account using the email address
(kraevin0507@gmail.com). However for some reason when scrolling down the
birth year column it froze at a year in the 2000's. When i hit refresh it
made me ineligable. I know i am old enough because i was born in 1987. My
name that I was under was KRaevin Armstrong. So Now that you can verify
who i am, exactly how can i correct this problem so that i may create the
account? And start my facebook experience?
Is it possible to find out that a remote programm is closed
Is it possible to find out that a remote programm is closed
I use NetTcpBinding to communicate between multiple PCs. Allcan act as
equal servers, they connect from time to time with each other.
At the moment I connect additional from time to time to see wether remote
program is alive. It is wished that immediatly if remote program is
stopped (shut down, forcefully terminated, connection is down, ...) on one
PC tha information is given to user on other pcs (not over the
configurable interval used now, but really immidiate).
The Faulted state is used, but is only catching Faults if the
communication is activilly used (it didn't see an error if nothing is done
with the connection on a client, and the server is forcefully shut down
with task manager).
Is there any possibility to see if the remote programm is closed without
explizitly calling a method on the remote host? A sort of : connect to
other programm and keep connection always on, report if connection is shut
down?
Is there a pattern to use like: "IF RemoteProgramm is not alive THEN throw
Exception/Fault"
I use NetTcpBinding to communicate between multiple PCs. Allcan act as
equal servers, they connect from time to time with each other.
At the moment I connect additional from time to time to see wether remote
program is alive. It is wished that immediatly if remote program is
stopped (shut down, forcefully terminated, connection is down, ...) on one
PC tha information is given to user on other pcs (not over the
configurable interval used now, but really immidiate).
The Faulted state is used, but is only catching Faults if the
communication is activilly used (it didn't see an error if nothing is done
with the connection on a client, and the server is forcefully shut down
with task manager).
Is there any possibility to see if the remote programm is closed without
explizitly calling a method on the remote host? A sort of : connect to
other programm and keep connection always on, report if connection is shut
down?
Is there a pattern to use like: "IF RemoteProgramm is not alive THEN throw
Exception/Fault"
Prevent submitting a newly created record (sub object) to the store using Ember.data
Prevent submitting a newly created record (sub object) to the store using
Ember.data
My models (simplified in this code example)
App.TemplateItem = DS.Model.extend({
someProperty: DS.attr('number'),
contentBlock: DS.belongsTo('App.ContentBlock')
});
App.ContentBlock = DS.Model.extend({
htmlContent: DS.attr('string')
});
DS.WebAPIAdapter.map('App.TemplateItem', {
contentBlock: { embedded: 'always' }
});
My server store internally represents these two models as single class
(ContentBlock inherits from TemplateItem – there are other TemplateItem
types with different properties).
Now, when I create an TemplateItem+ContentBlock in a single step:
newTemplateItem = App.TemplateItem.createRecord({
someProperty: 23,
contentBlock: App.ContentBlock.createRecord({
htmlContent: 'New block...',
})
});
and commit the data
newTemplateItem.get('store').commit();
both TemplateItem and ContentBlock POST requests are launched. But since
my API already creates the server-side object from the TemplateItem POST
request (it contains the nested ContentBlock object), I don't need the
ContentBlock being posted to the API service.
Is there a way to tell Ember data / adapter that it doesn't need to send
the second, nested object? The problem is that even if I create a dummy
server-side API method which doesn't do nothing, I still need to return
the object (which I can't create because of the limitations of the
server-side implementation I described above).
Ember.data
My models (simplified in this code example)
App.TemplateItem = DS.Model.extend({
someProperty: DS.attr('number'),
contentBlock: DS.belongsTo('App.ContentBlock')
});
App.ContentBlock = DS.Model.extend({
htmlContent: DS.attr('string')
});
DS.WebAPIAdapter.map('App.TemplateItem', {
contentBlock: { embedded: 'always' }
});
My server store internally represents these two models as single class
(ContentBlock inherits from TemplateItem – there are other TemplateItem
types with different properties).
Now, when I create an TemplateItem+ContentBlock in a single step:
newTemplateItem = App.TemplateItem.createRecord({
someProperty: 23,
contentBlock: App.ContentBlock.createRecord({
htmlContent: 'New block...',
})
});
and commit the data
newTemplateItem.get('store').commit();
both TemplateItem and ContentBlock POST requests are launched. But since
my API already creates the server-side object from the TemplateItem POST
request (it contains the nested ContentBlock object), I don't need the
ContentBlock being posted to the API service.
Is there a way to tell Ember data / adapter that it doesn't need to send
the second, nested object? The problem is that even if I create a dummy
server-side API method which doesn't do nothing, I still need to return
the object (which I can't create because of the limitations of the
server-side implementation I described above).
Which is the most stable Ubuntu version?
Which is the most stable Ubuntu version?
I just bought a new SSD and will begin installing Windows and Ubuntu soon.
I am a long(ish) time user of Ubuntu and have always noticed that some
versions of Ubuntu are more stable than others in terms of bugs.
At work, i use 12.04 which seems to be very stable - but i am also aware
its nowhere near the latest version now. In terms of stability, how are
13.04 and 12.10? Have all the annoying bugs been fixed yet?
I am also contemplating Kubuntu. I had installed 13.04 a few weeks ago but
i was plagued with KWallet, Localization and timezone bugs which just put
me off completely. Is there some stable version of Kubuntu i can install?
I just bought a new SSD and will begin installing Windows and Ubuntu soon.
I am a long(ish) time user of Ubuntu and have always noticed that some
versions of Ubuntu are more stable than others in terms of bugs.
At work, i use 12.04 which seems to be very stable - but i am also aware
its nowhere near the latest version now. In terms of stability, how are
13.04 and 12.10? Have all the annoying bugs been fixed yet?
I am also contemplating Kubuntu. I had installed 13.04 a few weeks ago but
i was plagued with KWallet, Localization and timezone bugs which just put
me off completely. Is there some stable version of Kubuntu i can install?
Tuesday, 20 August 2013
TableView and Storyboards
TableView and Storyboards
I have an iphone app where I set a main table according to data received
over the internet:
bList = [[BeerList alloc] initListWithData:array];
[mainTable setDataSource:bList];
[mainTable setDelegate:bList];
[self.mainTable reloadData];
Which works fine in the first view. I have a secondary view controller
which alters some properties and returns to this initial view. On the
return to the initial view the table doesn't redraw. Though the request
for "numberOfRowsInSection" returns a positive number, the cells don't
appear in the UI. Is there something weird about storyboards that would
cause this?
I have an iphone app where I set a main table according to data received
over the internet:
bList = [[BeerList alloc] initListWithData:array];
[mainTable setDataSource:bList];
[mainTable setDelegate:bList];
[self.mainTable reloadData];
Which works fine in the first view. I have a secondary view controller
which alters some properties and returns to this initial view. On the
return to the initial view the table doesn't redraw. Though the request
for "numberOfRowsInSection" returns a positive number, the cells don't
appear in the UI. Is there something weird about storyboards that would
cause this?
Web Crawler with Ajax/JavaScript
Web Crawler with Ajax/JavaScript
I have tried to use HtmlUnit to implement a crawler which can obtain the
results generated by executing the Ajax request and javascript's
execution.However, HtmlUnit is not so powerful to meet my demand because
it can't obtain all the rendered DOM element generated by executing
JavaScript or AJax. And then I aslo tried to use pywebkitgtk and
pyQtwebkit, it did generated some dynamic DOM element.But they don't work
stably, and I have no idea to tackle it. It seems that someone aslo
mentioned using the selenium.Can anybody give me some suggestions to
implement a Ajax Crawler? Many thanks!
I have tried to use HtmlUnit to implement a crawler which can obtain the
results generated by executing the Ajax request and javascript's
execution.However, HtmlUnit is not so powerful to meet my demand because
it can't obtain all the rendered DOM element generated by executing
JavaScript or AJax. And then I aslo tried to use pywebkitgtk and
pyQtwebkit, it did generated some dynamic DOM element.But they don't work
stably, and I have no idea to tackle it. It seems that someone aslo
mentioned using the selenium.Can anybody give me some suggestions to
implement a Ajax Crawler? Many thanks!
Two SQL queries into the same array
Two SQL queries into the same array
I have two database tables - one for tutors and the other for the subjects
that the tutors teach.
The two are connected by the tutorID. Now I'm trying to get data from both
into a single array. Is there any way to do this? I've tried doing it in
sequence i.e:
$query = "SELECT id, name, avatar, price, ( 3959 * acos( cos(
radians('$center_lat') ) * cos( radians( lat ) ) * cos( radians( lng ) -
radians('$center_lng') ) + sin( radians('$center_lat') ) * sin( radians(
lat ) ) ) ) AS distance
FROM users
having distance < '$radius' order by RAND() LIMIT 0, 20";
$result = mysqli_query($db_conx, $query);
if (!$result) {
echo "Query problem";
}
$rows = array();
//set xml header
/* header("Content-type: application/json"); */
// Iterate through the rows, adding XML nodes for each
while ($r = @mysqli_fetch_assoc($result)){
$rows[] = $r;
}
$tutorID = $rows[0]['id'];
$query = "SELECT level, subject, topic
FROM TUTORLINK
where tutorID='$tutorID'
order by level";
$result = mysqli_query($db_conx, $query);
while ($r = @mysqli_fetch_assoc($result)){
$rows[] = $r;
}
var_dump($rows);
but rows only contains the results of the first query - can anyone help?
I have two database tables - one for tutors and the other for the subjects
that the tutors teach.
The two are connected by the tutorID. Now I'm trying to get data from both
into a single array. Is there any way to do this? I've tried doing it in
sequence i.e:
$query = "SELECT id, name, avatar, price, ( 3959 * acos( cos(
radians('$center_lat') ) * cos( radians( lat ) ) * cos( radians( lng ) -
radians('$center_lng') ) + sin( radians('$center_lat') ) * sin( radians(
lat ) ) ) ) AS distance
FROM users
having distance < '$radius' order by RAND() LIMIT 0, 20";
$result = mysqli_query($db_conx, $query);
if (!$result) {
echo "Query problem";
}
$rows = array();
//set xml header
/* header("Content-type: application/json"); */
// Iterate through the rows, adding XML nodes for each
while ($r = @mysqli_fetch_assoc($result)){
$rows[] = $r;
}
$tutorID = $rows[0]['id'];
$query = "SELECT level, subject, topic
FROM TUTORLINK
where tutorID='$tutorID'
order by level";
$result = mysqli_query($db_conx, $query);
while ($r = @mysqli_fetch_assoc($result)){
$rows[] = $r;
}
var_dump($rows);
but rows only contains the results of the first query - can anyone help?
Are there standard names for different types of data reports?
Are there standard names for different types of data reports?
The specific answer I am looking for is a reference to some kind of
established standard (with naming conventions) for different report
layouts that would be produced from data out of a database. I am hoping to
find "context independent" names here - i.e not tied to one particular
database type or language.
I understand that there are general distinctions between tabular and
graphical types of reports, but I am looking for descriptive terms for
particular report types (if that even exists).
I'm sure Google would provide the answer, but I don't quite know what to
ask it...
The specific answer I am looking for is a reference to some kind of
established standard (with naming conventions) for different report
layouts that would be produced from data out of a database. I am hoping to
find "context independent" names here - i.e not tied to one particular
database type or language.
I understand that there are general distinctions between tabular and
graphical types of reports, but I am looking for descriptive terms for
particular report types (if that even exists).
I'm sure Google would provide the answer, but I don't quite know what to
ask it...
putting distinct in the hql
putting distinct in the hql
I have the below HQL to fetch out all the persons from the table
return session.find("from Person u where u.active='N'");
Now I want to fetch all the unique persons please advise how to put
distinct in the above hql query
I have the below HQL to fetch out all the persons from the table
return session.find("from Person u where u.active='N'");
Now I want to fetch all the unique persons please advise how to put
distinct in the above hql query
Latencies of Direct3D 9 API calls
Latencies of Direct3D 9 API calls
I've recently been looking with PIX for Windows at an application using
Direct3D 9 for rendering. What I've noticed is that the first operations
of a given frame on render targets or textures that wrap them seem to take
a very long time. The system is running Windows 7 and is not out of
graphics memory. No thrashing should thus be happening. What I find
interesting is that operations on 16-bit floating point surfaces take
about double the time as on 8-bit integer surfaces.
Anyone have any explanation for this phenomena?
-Timo
I've recently been looking with PIX for Windows at an application using
Direct3D 9 for rendering. What I've noticed is that the first operations
of a given frame on render targets or textures that wrap them seem to take
a very long time. The system is running Windows 7 and is not out of
graphics memory. No thrashing should thus be happening. What I find
interesting is that operations on 16-bit floating point surfaces take
about double the time as on 8-bit integer surfaces.
Anyone have any explanation for this phenomena?
-Timo
Explain me context of these functions.
Explain me context of these functions.
If the weight of a pet rabbit in pounds is a function of its age in years.
Call this function g and let a be the the current age of the rabbit. Also,
let h be the inverse of g.
$g(a)+1$
$g(2a)$
$h(5)$
Can someone explain me the meaning of each function in the context of the
given info. This is not a real question. I need to understand the meaning
of each of these in order to do the real problem.
If the weight of a pet rabbit in pounds is a function of its age in years.
Call this function g and let a be the the current age of the rabbit. Also,
let h be the inverse of g.
$g(a)+1$
$g(2a)$
$h(5)$
Can someone explain me the meaning of each function in the context of the
given info. This is not a real question. I need to understand the meaning
of each of these in order to do the real problem.
Monday, 19 August 2013
Do we have to re-publish the Web-site if we modify a part of the code in the aspx pages?
Do we have to re-publish the Web-site if we modify a part of the code in
the aspx pages?
My doubt is, If we make a slight modification of the code in the C# page
or in the aspx page, do we have to republish the entire web-site after the
modification?
I am using VS-2008 professional and the code is written in C#.
Thanks in advance.
Regards, Nitesh
the aspx pages?
My doubt is, If we make a slight modification of the code in the C# page
or in the aspx page, do we have to republish the entire web-site after the
modification?
I am using VS-2008 professional and the code is written in C#.
Thanks in advance.
Regards, Nitesh
How to convert type 'byte[]' to 'System.Data.Linq.Binary'
How to convert type 'byte[]' to 'System.Data.Linq.Binary'
I have a WorkflowInstances table in my DB which contains this fields: ID
(int), Name (nvarchar(50), WorkflowID (int), Document (varbinary(MAX))). I
want to insert a new WorkflowInstance so I wrote this code
Stream myStream = openFileDialogDoc.OpenFile();
if (myStream != null)
{
using (myStream)
{
WorkflowInstance w = new WorkflowInstance();
byte[] bytes = new byte[myStream.Length];
myStream.Read(bytes, 0, (int)myStream.Length);
w.ID =
repository.WorkflowsRepository.GetMaxIDWokflowInstance()
+ 1;
w.Name = textBoxWorkflowInstanceName.Text;
w.CurrentStateID =
repository.WorkflowsRepository.GetWorkflowFirstState((int)listBoxMyWorkflows.SelectedValue);
w.WorkflowID = (int)listBoxMyWorkflows.SelectedValue;
w.CreationDate = System.DateTime.Now.ToString();
w.Document = bytes;
RapidWorkflowDataContext context = new
RapidWorkflowDataContext();
context.WorkflowInstances.InsertOnSubmit(w);
context.SubmitChanges();
}
}
I got an error in line 15, the error is: Cannot implicitly convert type
'byte[]' to 'System.Data.Linq.Binary'
I have a WorkflowInstances table in my DB which contains this fields: ID
(int), Name (nvarchar(50), WorkflowID (int), Document (varbinary(MAX))). I
want to insert a new WorkflowInstance so I wrote this code
Stream myStream = openFileDialogDoc.OpenFile();
if (myStream != null)
{
using (myStream)
{
WorkflowInstance w = new WorkflowInstance();
byte[] bytes = new byte[myStream.Length];
myStream.Read(bytes, 0, (int)myStream.Length);
w.ID =
repository.WorkflowsRepository.GetMaxIDWokflowInstance()
+ 1;
w.Name = textBoxWorkflowInstanceName.Text;
w.CurrentStateID =
repository.WorkflowsRepository.GetWorkflowFirstState((int)listBoxMyWorkflows.SelectedValue);
w.WorkflowID = (int)listBoxMyWorkflows.SelectedValue;
w.CreationDate = System.DateTime.Now.ToString();
w.Document = bytes;
RapidWorkflowDataContext context = new
RapidWorkflowDataContext();
context.WorkflowInstances.InsertOnSubmit(w);
context.SubmitChanges();
}
}
I got an error in line 15, the error is: Cannot implicitly convert type
'byte[]' to 'System.Data.Linq.Binary'
data transfer from Multiple Excel files to SQL table
data transfer from Multiple Excel files to SQL table
Need to transfer data from multiple Excel files to a SQL table. For
instance there are multiple excel files in a folder such as
1.INR_08012013.xls 2.INR_08022013.xls 3.INR_08032013.xls Note: Look at
datepart increments in the file_name.
I'm planning to create SSIS package and import data into SQL. I know i can
import one excel file at a time but i'm planning to do several at a time.
There could be many excels so i don't want to create multiple SSIS
packages for this job.
I want to create one SSIS package(for multiple excel files) and import the
data into SQL. Is this possible thru SSIS, Give me some guidance.
Thanks!
Need to transfer data from multiple Excel files to a SQL table. For
instance there are multiple excel files in a folder such as
1.INR_08012013.xls 2.INR_08022013.xls 3.INR_08032013.xls Note: Look at
datepart increments in the file_name.
I'm planning to create SSIS package and import data into SQL. I know i can
import one excel file at a time but i'm planning to do several at a time.
There could be many excels so i don't want to create multiple SSIS
packages for this job.
I want to create one SSIS package(for multiple excel files) and import the
data into SQL. Is this possible thru SSIS, Give me some guidance.
Thanks!
java script function is no running
java script function is no running
phtml code is here/p precodelt;form name=f1 action=feedback1.php
method=Post onSubmit=return isDataFilled(); gt; lt;table border=0
align=center width=500px style=max-width: 500px; cellspacing=3
cellpadding=5 align=centergt; lt;tr align=leftgt; lt;td width=25%gt; Enter
your subject lt;/tdgt; lt;td width=75%gt;lt;input type=text name=subject
size=30 value=Your subject onClick=if(this.value=='Your
subject'){this.value=''}; this.style.backgroundColor='#CCFF99'
onBlur=if(this.value==''){this.value='Your subject'};
this.style.backgroundColor='white'/gt;lt;/tdgt; lt;/trgt; lt;tr
align=leftgt; lt;tdgt; Enter your emaillt;span
style=color:#FF0000gt;*lt;/spangt; lt;/tdgt; lt;tdgt; lt;input type=text
name=email size=30 value=example@mail.com
onClick=if(this.value=='example@mail.com'){this.value=''};
this.style.backgroundColor='#CCFF99'
onBlur=if(this.value==''){this.value='example@mail.com'};
this.style.backgroundColor='white'/gt; lt;/tdgt; lt;/trgt; lt;tr
align=leftgt; lt;td colspan=2gt; Enter your message herelt;span
style=color:#FF0000gt;*lt;/spangt;: lt;/tdgt; lt;/trgt; lt;tr
align=leftgt; lt;td colspan=2gt; lt;textarea rows=10 cols=50 name=message
title=Your message goes here onClick= if(this.value=='Your message goes
here'){this.value=''}; this.style.backgroundColor='#CCFF99'
onBlur=if(this.value==''){this.value='Your message goes here'};
this.style.backgroundColor='white' gt;Your message goes
herelt;/textareagt; lt;/tdgt; lt;/trgt; lt;trgt; lt;td colspan=
align=rightgt; lt;input type=submit value=Send name=b1 title=Send your
message/gt; lt;/tdgt; lt;td align=centergt; lt;input type=reset
value=Reset name=reset title=Removes your form data and fill it again/gt;
lt;/tdgt; lt;/trgt; lt;/tablegt; lt;/form /code/pre pand this is
javascript code/p precodefunction isDataFilled() {
if(document.forms['f1']['email'].value=='example@mail.com') { alert(No
email address in email field!); return false; }
if(document.forms['f1']['message'].value=='Your message goes here') {
alert(No message in message field!); return false; } return
isEmailCorrect(document.forms[f1][email].value); return
check_word_length(document.forms['f1']['message'].value, 20); } function
isEmailCorrect(f_email) { var x=f_email; var atpos=x.indexOf(@); var
dotpos=x.lastIndexOf(.); if (atposlt;1 || dotposlt;atpos+2 ||
dotpos+2gt;=x.length) { alert(Not a valid e-mail address); return false; }
} function check_word_length(text, over_size) { var word=0; var
message=text; for(i=0;ilt;message.length;i++) { if(message.charAt(i)== ) {
word=0; } else { word++; if(wordgt;=over_size) { alert(Too long text
entered); return false; } } } } /code/pre ponly the last function :
function check_word_length(text, over_size)/p pis not working so guys and
gils please help me/p pWhy is this happening I'm confused because I think
my code is alright/p pThanks in advance for helping/p
phtml code is here/p precodelt;form name=f1 action=feedback1.php
method=Post onSubmit=return isDataFilled(); gt; lt;table border=0
align=center width=500px style=max-width: 500px; cellspacing=3
cellpadding=5 align=centergt; lt;tr align=leftgt; lt;td width=25%gt; Enter
your subject lt;/tdgt; lt;td width=75%gt;lt;input type=text name=subject
size=30 value=Your subject onClick=if(this.value=='Your
subject'){this.value=''}; this.style.backgroundColor='#CCFF99'
onBlur=if(this.value==''){this.value='Your subject'};
this.style.backgroundColor='white'/gt;lt;/tdgt; lt;/trgt; lt;tr
align=leftgt; lt;tdgt; Enter your emaillt;span
style=color:#FF0000gt;*lt;/spangt; lt;/tdgt; lt;tdgt; lt;input type=text
name=email size=30 value=example@mail.com
onClick=if(this.value=='example@mail.com'){this.value=''};
this.style.backgroundColor='#CCFF99'
onBlur=if(this.value==''){this.value='example@mail.com'};
this.style.backgroundColor='white'/gt; lt;/tdgt; lt;/trgt; lt;tr
align=leftgt; lt;td colspan=2gt; Enter your message herelt;span
style=color:#FF0000gt;*lt;/spangt;: lt;/tdgt; lt;/trgt; lt;tr
align=leftgt; lt;td colspan=2gt; lt;textarea rows=10 cols=50 name=message
title=Your message goes here onClick= if(this.value=='Your message goes
here'){this.value=''}; this.style.backgroundColor='#CCFF99'
onBlur=if(this.value==''){this.value='Your message goes here'};
this.style.backgroundColor='white' gt;Your message goes
herelt;/textareagt; lt;/tdgt; lt;/trgt; lt;trgt; lt;td colspan=
align=rightgt; lt;input type=submit value=Send name=b1 title=Send your
message/gt; lt;/tdgt; lt;td align=centergt; lt;input type=reset
value=Reset name=reset title=Removes your form data and fill it again/gt;
lt;/tdgt; lt;/trgt; lt;/tablegt; lt;/form /code/pre pand this is
javascript code/p precodefunction isDataFilled() {
if(document.forms['f1']['email'].value=='example@mail.com') { alert(No
email address in email field!); return false; }
if(document.forms['f1']['message'].value=='Your message goes here') {
alert(No message in message field!); return false; } return
isEmailCorrect(document.forms[f1][email].value); return
check_word_length(document.forms['f1']['message'].value, 20); } function
isEmailCorrect(f_email) { var x=f_email; var atpos=x.indexOf(@); var
dotpos=x.lastIndexOf(.); if (atposlt;1 || dotposlt;atpos+2 ||
dotpos+2gt;=x.length) { alert(Not a valid e-mail address); return false; }
} function check_word_length(text, over_size) { var word=0; var
message=text; for(i=0;ilt;message.length;i++) { if(message.charAt(i)== ) {
word=0; } else { word++; if(wordgt;=over_size) { alert(Too long text
entered); return false; } } } } /code/pre ponly the last function :
function check_word_length(text, over_size)/p pis not working so guys and
gils please help me/p pWhy is this happening I'm confused because I think
my code is alright/p pThanks in advance for helping/p
How To find overlapping Dates in SQL
How To find overlapping Dates in SQL
I have a table which has startdatetime and enddatetime. how to find the
the particuler datetime which is overlapping in other dates: see below
example
create table #period (
id int,
starttime datetime,
endtime datetime
);
insert into #period values
(1,'2013-10-10 08:00:00' , '2013-10-10 10:00:00'),
(2,'2013-10-10 08:10:00' , '2013-10-10 08:20:00'),
(3,'2013-10-10 08:10:00' , '2013-10-10 08:30:00')
(4,'2013-10-10 08:15:00' , '2013-10-10 08:25:00')
select * from #period
required output is '2013-10-10 08:15:00' , '2013-10-10 08:20:00' is
getting overlapped in all the dates.
expected output: '2013-10-10 08:15:00' '2013-10-10 08:20:00' 5 Min
I have a table which has startdatetime and enddatetime. how to find the
the particuler datetime which is overlapping in other dates: see below
example
create table #period (
id int,
starttime datetime,
endtime datetime
);
insert into #period values
(1,'2013-10-10 08:00:00' , '2013-10-10 10:00:00'),
(2,'2013-10-10 08:10:00' , '2013-10-10 08:20:00'),
(3,'2013-10-10 08:10:00' , '2013-10-10 08:30:00')
(4,'2013-10-10 08:15:00' , '2013-10-10 08:25:00')
select * from #period
required output is '2013-10-10 08:15:00' , '2013-10-10 08:20:00' is
getting overlapped in all the dates.
expected output: '2013-10-10 08:15:00' '2013-10-10 08:20:00' 5 Min
Sunday, 18 August 2013
How do I connect Android Application to SQL server 2005
How do I connect Android Application to SQL server 2005
I am having an Android application which I want to connect with SQL Server
2005. I have read about web services but i didn't get connectivity with
SQL server. Please give me proper solution.
I am having an Android application which I want to connect with SQL Server
2005. I have read about web services but i didn't get connectivity with
SQL server. Please give me proper solution.
In Wordpress SQL database, where does it show which attachment(s) has been assigned to which post?
In Wordpress SQL database, where does it show which attachment(s) has been
assigned to which post?
I was able to tap into my wordpress database and pull all the rows from
the "wp_posts" table with "post_type=post" and display the content on
another page (not wordpress, just built from scratch). The problem I have
is the images (in the database "attachments") are in the same table with
"post_type=attachment". So I cannot pull the correct images into my site.
I can't find how they are related to the posts. I thought
"wp_term_relationships" was my answer but those are just category
relationships. In short, Where are the image relationships?
assigned to which post?
I was able to tap into my wordpress database and pull all the rows from
the "wp_posts" table with "post_type=post" and display the content on
another page (not wordpress, just built from scratch). The problem I have
is the images (in the database "attachments") are in the same table with
"post_type=attachment". So I cannot pull the correct images into my site.
I can't find how they are related to the posts. I thought
"wp_term_relationships" was my answer but those are just category
relationships. In short, Where are the image relationships?
ios use EKEventEditViewController with a custom calendar
ios use EKEventEditViewController with a custom calendar
in iOS how do I set up EKEventEditViewController to save events into a
custom calendar?
In my application I first create a custom calendar. I would then like to
setup a new EKEventEditViewController and have the events saved into the
events into the custom calendar.
How can this be done?
in iOS how do I set up EKEventEditViewController to save events into a
custom calendar?
In my application I first create a custom calendar. I would then like to
setup a new EKEventEditViewController and have the events saved into the
events into the custom calendar.
How can this be done?
Eclipse CDT has DEBUG defined in Release build
Eclipse CDT has DEBUG defined in Release build
I'm using Eclipse CDT to write some C++ code (on Win7 with Cygwin). I
naturally want different/additional behavior when debugging, and use
#ifdef DEBUG occasionally. Unfortunately, it seems that I somehow have
DEBUG defined in Release build configuration as well.
How can I get Eclipse CDT to not define DEBUG?
I'm using Eclipse CDT to write some C++ code (on Win7 with Cygwin). I
naturally want different/additional behavior when debugging, and use
#ifdef DEBUG occasionally. Unfortunately, it seems that I somehow have
DEBUG defined in Release build configuration as well.
How can I get Eclipse CDT to not define DEBUG?
getSupportFragmentManager().beginTransaction().add(android.R.id.content, f) not working
getSupportFragmentManager().beginTransaction().add(android.R.id.content,
f) not working
// Place an ArticleFragment as our content pane
final ArticleFragment f = new ArticleFragment();
getSupportFragmentManager().beginTransaction().add(android.R.id.content,
f).commit();This lines of code are from the NewsReader sample app
Why they are not working if the activity extends ActionBarActivity?
Everything works fine if the activity extends FragmentActivity.
Why?
Ralph
f) not working
// Place an ArticleFragment as our content pane
final ArticleFragment f = new ArticleFragment();
getSupportFragmentManager().beginTransaction().add(android.R.id.content,
f).commit();This lines of code are from the NewsReader sample app
Why they are not working if the activity extends ActionBarActivity?
Everything works fine if the activity extends FragmentActivity.
Why?
Ralph
Print the Python Exception/Error Hierarchy
Print the Python Exception/Error Hierarchy
Is the any command line option in python to print the Exception/Error
Class hierarchy?
The output should be similar to
http://docs.python.org/2/library/exceptions.html#exception-hierarchy
Is the any command line option in python to print the Exception/Error
Class hierarchy?
The output should be similar to
http://docs.python.org/2/library/exceptions.html#exception-hierarchy
Saturday, 17 August 2013
Registry location of DirectShow audio capture devices
Registry location of DirectShow audio capture devices
I am executing VLC from my application to capture and encode from a
DirectShow audio capture device. VLC sends the encoded data to my
application via STDOUT. I need a way to enumerate DirectShow audio capture
devices. Unfortunately, VLC doesn't seem to provide any non-GUI way for
this.
While looking for a simple way to get a list of device names, I stumbled
on these registry keys where child keys are named after audio capture
devices:
HKEY_CURRENT_USER\Software\Microsoft\ActiveMovie\devenum
64-bit\{33D9A762-90C8-11D0-BD43-00A0C911CE86}
HKEY_CURRENT_USER\Software\Microsoft\ActiveMovie\devenum\{33D9A762-90C8-11D0-BD43-00A0C911CE86}
Is this registry location guaranteed to be in the same place for other
machines and recent versions of DirectX? Short of implementing a ton of
DirectX code, is there some other way to get a list of the DirectShow
audio device names? (Possibly through some output of a diagnostic tool.)
I am executing VLC from my application to capture and encode from a
DirectShow audio capture device. VLC sends the encoded data to my
application via STDOUT. I need a way to enumerate DirectShow audio capture
devices. Unfortunately, VLC doesn't seem to provide any non-GUI way for
this.
While looking for a simple way to get a list of device names, I stumbled
on these registry keys where child keys are named after audio capture
devices:
HKEY_CURRENT_USER\Software\Microsoft\ActiveMovie\devenum
64-bit\{33D9A762-90C8-11D0-BD43-00A0C911CE86}
HKEY_CURRENT_USER\Software\Microsoft\ActiveMovie\devenum\{33D9A762-90C8-11D0-BD43-00A0C911CE86}
Is this registry location guaranteed to be in the same place for other
machines and recent versions of DirectX? Short of implementing a ton of
DirectX code, is there some other way to get a list of the DirectShow
audio device names? (Possibly through some output of a diagnostic tool.)
self referential association with polymorphic association
self referential association with polymorphic association
I have a User and Address models. A user may have many addresses and one
as default. I currently use this that works
# User.rb
belongs_to :default_address, class_name: "Address", foreign_key:
:default_address_id
Now I made the Address belongs_to :addressable, polymorphic: true.
My question is how to tell this default_address self association to use
the addressable instead of going directly to the Address class
I have a User and Address models. A user may have many addresses and one
as default. I currently use this that works
# User.rb
belongs_to :default_address, class_name: "Address", foreign_key:
:default_address_id
Now I made the Address belongs_to :addressable, polymorphic: true.
My question is how to tell this default_address self association to use
the addressable instead of going directly to the Address class
WPF - Hosting Silverlight Control
WPF - Hosting Silverlight Control
In my WPF application I am using a Web Browser control, which is showing a
Silverlight application. I have to go with this design(Web Browser and
Silverlight) because, I badly need PivotViewer control, which only
available on Silverlight.
Now, I need to communicate from WPF to silverlight app which was in Web
Browser control (i.e. Pass an .NET List/Class).
How can I do it? and What are my options?
Thanks
In my WPF application I am using a Web Browser control, which is showing a
Silverlight application. I have to go with this design(Web Browser and
Silverlight) because, I badly need PivotViewer control, which only
available on Silverlight.
Now, I need to communicate from WPF to silverlight app which was in Web
Browser control (i.e. Pass an .NET List/Class).
How can I do it? and What are my options?
Thanks
Using an Object Oriented Database (db4o) for a medium scale application
Using an Object Oriented Database (db4o) for a medium scale application
I came across db4o OODB database and wondering how it compares to a
traditional stack with an RDBMS or an ORM like Hibernate/EclipseLink. The
application is a workflow system and will expand over time. Not sure if an
OODB like db4o fits well. I never worked on an OODB so I can't tell. Any
suggestions?
I came across db4o OODB database and wondering how it compares to a
traditional stack with an RDBMS or an ORM like Hibernate/EclipseLink. The
application is a workflow system and will expand over time. Not sure if an
OODB like db4o fits well. I never worked on an OODB so I can't tell. Any
suggestions?
Want to create a autorun flashdrive
Want to create a autorun flashdrive
I want to create a flash drive that opens a exe file when it is plugged
into a laptop/pc. I dont want to make a Autorun.inf file. Those do not
execute the program when it is plugged in, but give you the option of
opening it. And i want it non-detectable from avast.
For my company, I need to install a new program on some of the Computers,
I want to just plug in a flash drive to each of the computers and it
installs my new program.
Operating systems to be used on: 7 and xp Minimum space on each drive:
2gig Antivirus: Avast
I want to create a flash drive that opens a exe file when it is plugged
into a laptop/pc. I dont want to make a Autorun.inf file. Those do not
execute the program when it is plugged in, but give you the option of
opening it. And i want it non-detectable from avast.
For my company, I need to install a new program on some of the Computers,
I want to just plug in a flash drive to each of the computers and it
installs my new program.
Operating systems to be used on: 7 and xp Minimum space on each drive:
2gig Antivirus: Avast
android camera not asking whether to save or discard and makes the activity refresh
android camera not asking whether to save or discard and makes the
activity refresh
I have 3 buttons to capture the image from the camera invoking through
Intent. While trying to take second image the first image is getting null,
similarly after taking the third image the 2 and 1st images are becoming
null.
Here in some devices it is working fine. But in some devices it is not
working. Also the devices are not asking whether to save or discard the
images directly it is moving to the activity and the activity is loosing
its scope.
Any help appreciated! Thanks..
activity refresh
I have 3 buttons to capture the image from the camera invoking through
Intent. While trying to take second image the first image is getting null,
similarly after taking the third image the 2 and 1st images are becoming
null.
Here in some devices it is working fine. But in some devices it is not
working. Also the devices are not asking whether to save or discard the
images directly it is moving to the activity and the activity is loosing
its scope.
Any help appreciated! Thanks..
Friday, 16 August 2013
diveintopython.net example gets SyntaxError: invalid syntax
diveintopython.net example gets SyntaxError: invalid syntax
I am trying to follow the tutorial found here:
http://www.diveintopython.net/getting_to_know_python/index.html
Here's what I am doing ...
$ cat odbchelper.py
def buildConnectionString(params):
"""Build a connection string from a dictionary of parameters.
Returns string."""
return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
if __name__ == "__main__":
myParams = {"server":"mpilgrim", \
"database":"master", \
"uid":"sa", \
"pwd":"secret" \
}
print buildConnectionString(myParams)
... and when I run the above script I get this output ...
$ python3 odbchelper.py
File "odbchelper.py", line 13
print buildConnectionString(myParams)
^
SyntaxError: invalid syntax
... I am not sure what is wrong here. Is it python3 thing?
Thanks
I am trying to follow the tutorial found here:
http://www.diveintopython.net/getting_to_know_python/index.html
Here's what I am doing ...
$ cat odbchelper.py
def buildConnectionString(params):
"""Build a connection string from a dictionary of parameters.
Returns string."""
return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
if __name__ == "__main__":
myParams = {"server":"mpilgrim", \
"database":"master", \
"uid":"sa", \
"pwd":"secret" \
}
print buildConnectionString(myParams)
... and when I run the above script I get this output ...
$ python3 odbchelper.py
File "odbchelper.py", line 13
print buildConnectionString(myParams)
^
SyntaxError: invalid syntax
... I am not sure what is wrong here. Is it python3 thing?
Thanks
Thursday, 8 August 2013
Which versions of GAE SDK support Python 2.5?
Which versions of GAE SDK support Python 2.5?
We're in the process of migrating an app from python 2.5 to python 2.7
The latest SDK (1.8.3) does not support python 2.5.
What is the most recent version of the SDK that does support python 2.5?
Please link to source if you have it.
We're in the process of migrating an app from python 2.5 to python 2.7
The latest SDK (1.8.3) does not support python 2.5.
What is the most recent version of the SDK that does support python 2.5?
Please link to source if you have it.
Issues loading parameters on a C# RDLC Report
Issues loading parameters on a C# RDLC Report
thanks por reading my question, i use to load a report with a button,
after selecting dates (from and to), y use mysql and c#, and here are some
images so you can look my issues.
Here is the principal issue/error
Here is my Report, as you can see, at the left side, it has the parameters
required
Here i have the dataset/Query to that report, it has the @parameters here too
Finally, the code when i do clic to generate the report
thanks por reading my question, i use to load a report with a button,
after selecting dates (from and to), y use mysql and c#, and here are some
images so you can look my issues.
Here is the principal issue/error
Here is my Report, as you can see, at the left side, it has the parameters
required
Here i have the dataset/Query to that report, it has the @parameters here too
Finally, the code when i do clic to generate the report
Detecting position tapped with UITapGestureRecognizer
Detecting position tapped with UITapGestureRecognizer
Hi so I was wondering if there was any way possible to get the position
that was touched using UITapGestureRecognizer to recognize taps on the
background.
-(void)handleTapGesture:(UITapGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateRecognized)
{
if ( bomb == nil)
{
bomb = [[UIImageView alloc] initWithImage:[UIImage
imageNamed:@"bomb.png"]];
bomb.center = CGPointMake(10, 1);
bomb.frame = CGRectMake(113,123,67,67);
[self.view addSubview:bomb];
//[self performSelector:@selector(Update) withObject:nil
afterDelay:1];
NSLog(@"Spawned bomb");
timer = [NSTimer scheduledTimerWithTimeInterval:.01 target:self
selector:@selector(dropBomb) userInfo:nil repeats:YES];
}
}
}
Hi so I was wondering if there was any way possible to get the position
that was touched using UITapGestureRecognizer to recognize taps on the
background.
-(void)handleTapGesture:(UITapGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateRecognized)
{
if ( bomb == nil)
{
bomb = [[UIImageView alloc] initWithImage:[UIImage
imageNamed:@"bomb.png"]];
bomb.center = CGPointMake(10, 1);
bomb.frame = CGRectMake(113,123,67,67);
[self.view addSubview:bomb];
//[self performSelector:@selector(Update) withObject:nil
afterDelay:1];
NSLog(@"Spawned bomb");
timer = [NSTimer scheduledTimerWithTimeInterval:.01 target:self
selector:@selector(dropBomb) userInfo:nil repeats:YES];
}
}
}
Subscribe to:
Comments (Atom)