java.lang.NumberFormatException: For input string:
I'm trying to convert a String timestamp to an Integer one and I'm using
postgres as DB.
@Column(name = "connecte_timestamp")
private Integer timestamp;
SimpleDateFormat formater = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss");
Date aujourdhui = new Date();
this.timestamp = Integer.parseInt(formater.format(aujourdhui)
.replace("-", "").replace(" ", "").replace(":", ""));
the timestamp have bigint as a type in the DB. When I run my app, I get
the following stack trace :
java.lang.NumberFormatException: For input string: "01092013062024" at
java.lang.NumberFormatException.forInputString(Unknown Source) at
java.lang.Integer.parseInt(Unknown Source) at
java.lang.Integer.parseInt(Unknown Source) at
com.forum.beans.Connecte.(Connecte.java:26) at
com.forum.servlets.ListageForums.doGet(ListageForums.java:32) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
java.lang.Thread.run(Unknown Source)
Any help please ?
Saturday, 31 August 2013
UnauthorizedAccessException Accessing XSD In Windows Store App
UnauthorizedAccessException Accessing XSD In Windows Store App
My Windows Store app uses the FileOpenPicker to allow the user to browse
to an XML document. I can open the XML document as a stream and load it
with XDocument.Load([stream]).
But now, as I parse the XML document, I want to process schema
declarations that I find. I want to open a referenced XSD and parse it,
too, using an XDocument. The referenced XSD is in the same folder as the
main XML document. How do I open the referenced XSD? If I try to access it
by its full path name, an UnauthorizedAccessException object is thrown. I
don't want to use the FileOpenPicker again and force the user to select
the XSD ... that would make for a bad UI. I know where the XSD is ... it's
with the XML.
So how do I call XDocument.Load() on the referenced XSD without an
UnauthorizedAccessException object being thrown?
My Windows Store app uses the FileOpenPicker to allow the user to browse
to an XML document. I can open the XML document as a stream and load it
with XDocument.Load([stream]).
But now, as I parse the XML document, I want to process schema
declarations that I find. I want to open a referenced XSD and parse it,
too, using an XDocument. The referenced XSD is in the same folder as the
main XML document. How do I open the referenced XSD? If I try to access it
by its full path name, an UnauthorizedAccessException object is thrown. I
don't want to use the FileOpenPicker again and force the user to select
the XSD ... that would make for a bad UI. I know where the XSD is ... it's
with the XML.
So how do I call XDocument.Load() on the referenced XSD without an
UnauthorizedAccessException object being thrown?
PDO not inserting - what's wrong..?
PDO not inserting - what's wrong..?
I'm stumped as to why it's not inserting into the database...
PHP Code:
$insert_user = $db->prepare("INSERT INTO `users(`deposit_address`,
`date_assigned`) VALUES (:deposit_address, :date_assigned)");
$insert_user->execute(array(':deposit_address' =>
$_SESSION['deposit_address'], ':date_assigned'=> time() ));
I did a var_dump and it returned:
object(PDOStatement)#3 (1) { ["queryString"]=> string(96) "INSERT INTO
`users(`deposit_address`, `date_assigned`) VALUES (:deposit_address,
:date_assigned)" }
I'm stumped as to why it's not inserting into the database...
PHP Code:
$insert_user = $db->prepare("INSERT INTO `users(`deposit_address`,
`date_assigned`) VALUES (:deposit_address, :date_assigned)");
$insert_user->execute(array(':deposit_address' =>
$_SESSION['deposit_address'], ':date_assigned'=> time() ));
I did a var_dump and it returned:
object(PDOStatement)#3 (1) { ["queryString"]=> string(96) "INSERT INTO
`users(`deposit_address`, `date_assigned`) VALUES (:deposit_address,
:date_assigned)" }
Rails Model user adding player to user pinboard
Rails Model user adding player to user pinboard
I'm creating a sports application which allows users to create pinboards,
as many as they like. The users can then add say their favorite player to
a specified pinboard. So for example User: Jack, creates a new pinboard
called "My favorite defenders", He can then go and find his favorite
defenders, say Kevin Garnet, and add/pin garnet to his "My favorite
defenders" Pinboard.
I have a Users model, a Pinboards Model and a Players model. I tried the
following association but didn't work as I wanted. User has_many
:pinboards has_many :pins, through: pinboards, source: :player
Pinboard belongs_to :user belongs_to :player I know a player can't have
many pinboards and a pinboard will hold many players. How can I get the
behavior i want; User creates pinboard---user adds player to pinboard.
I'm creating a sports application which allows users to create pinboards,
as many as they like. The users can then add say their favorite player to
a specified pinboard. So for example User: Jack, creates a new pinboard
called "My favorite defenders", He can then go and find his favorite
defenders, say Kevin Garnet, and add/pin garnet to his "My favorite
defenders" Pinboard.
I have a Users model, a Pinboards Model and a Players model. I tried the
following association but didn't work as I wanted. User has_many
:pinboards has_many :pins, through: pinboards, source: :player
Pinboard belongs_to :user belongs_to :player I know a player can't have
many pinboards and a pinboard will hold many players. How can I get the
behavior i want; User creates pinboard---user adds player to pinboard.
Deserialize json character as enumeration
Deserialize json character as enumeration
I have an enumeration, where I'm storing it's values as characters, like
this:
public enum CardType
{
Artist = 'A',
Contemporary = 'C',
Historical = 'H',
Musician = 'M',
Sports = 'S',
Writer = 'W'
}
When the JSON is written, it looks like this:
[{"CardType","A"},{"CardType", "C"}]
Now when I attempt to deserialize, it's trying to read that value back
into the Enumeration, but something is wrong, because after
deserialization, the CardType value is always zero (0) as if the
deserialization failed.
Is there an extra step I need to get this to deserialize an enumeration
correctly?
Please let me know if I haven't provided enough information here, thanks!
I have an enumeration, where I'm storing it's values as characters, like
this:
public enum CardType
{
Artist = 'A',
Contemporary = 'C',
Historical = 'H',
Musician = 'M',
Sports = 'S',
Writer = 'W'
}
When the JSON is written, it looks like this:
[{"CardType","A"},{"CardType", "C"}]
Now when I attempt to deserialize, it's trying to read that value back
into the Enumeration, but something is wrong, because after
deserialization, the CardType value is always zero (0) as if the
deserialization failed.
Is there an extra step I need to get this to deserialize an enumeration
correctly?
Please let me know if I haven't provided enough information here, thanks!
When i hover over the button i want new image to describe that button, but it's blinking [on hold]
When i hover over the button i want new image to describe that button, but
it's blinking [on hold]
I want that when I hover over the button to keep the button on its place
and show a little describe box below. There's no picture in demo, so you
can't see exactly what I am talking about. Here's also a pic how it should
look like. http://i.imgur.com/otfNxJr.jpg Demo: http://jsbin.com/UXAleHi/1
it's blinking [on hold]
I want that when I hover over the button to keep the button on its place
and show a little describe box below. There's no picture in demo, so you
can't see exactly what I am talking about. Here's also a pic how it should
look like. http://i.imgur.com/otfNxJr.jpg Demo: http://jsbin.com/UXAleHi/1
How to create PHI node in LLVM , make use of the PHINode class and StoreInst class
How to create PHI node in LLVM , make use of the PHINode class and
StoreInst class
Original LLVM IR code
if.then: ; preds = %entry
....
%sub = fsub float %tmp11, %tmp14
store float %sub, float addrspace(1)* %arrayidx4, align 4
br label %if.end
if.else: ; preds = %entry
....
%sub7 = fsub float %tmp19, %tmp22
store float %sub7, float addrspace(1)* %arrayidx4, align 4
br label %if.end
if.end: ; preds = %if.else,
%if.then
ret void
I have stuck here for a long time , i don't know how to make use of the
PHINode class and StoreInst class. I have trace the llvm source code but
still don't know how to do..
Now i want to merge this two store instruction.
Like this ...
if.then: ; preds = %entry
....
%sub = fsub float %tmp11, %tmp14
br label %if.end
if.else: ; preds = %entry
....
%sub7 = fsub float %tmp19, %tmp22
br label %if.end
if.end: ; preds = %if.else,
%if.then
%storemerge = phi float [ %sub, %if.then ], [ %sub7, %if.else ]
store float %storemerge, float addrspace(1)* %arrayidx4, align 4
ret void
Can anyone teach me how to do it ?? Thanks in advance ...
StoreInst class
Original LLVM IR code
if.then: ; preds = %entry
....
%sub = fsub float %tmp11, %tmp14
store float %sub, float addrspace(1)* %arrayidx4, align 4
br label %if.end
if.else: ; preds = %entry
....
%sub7 = fsub float %tmp19, %tmp22
store float %sub7, float addrspace(1)* %arrayidx4, align 4
br label %if.end
if.end: ; preds = %if.else,
%if.then
ret void
I have stuck here for a long time , i don't know how to make use of the
PHINode class and StoreInst class. I have trace the llvm source code but
still don't know how to do..
Now i want to merge this two store instruction.
Like this ...
if.then: ; preds = %entry
....
%sub = fsub float %tmp11, %tmp14
br label %if.end
if.else: ; preds = %entry
....
%sub7 = fsub float %tmp19, %tmp22
br label %if.end
if.end: ; preds = %if.else,
%if.then
%storemerge = phi float [ %sub, %if.then ], [ %sub7, %if.else ]
store float %storemerge, float addrspace(1)* %arrayidx4, align 4
ret void
Can anyone teach me how to do it ?? Thanks in advance ...
Friday, 30 August 2013
Relative path converter MAC->Windows, Windows->MAC in C#
Relative path converter MAC->Windows, Windows->MAC in C#
Could you tell me if there is a more clever way to convert MAC->Windows,
Windows->MAC relative pathes rather than taking a string and replacing
tildas to dots and slashes to backslashes?
Thanks!
Could you tell me if there is a more clever way to convert MAC->Windows,
Windows->MAC relative pathes rather than taking a string and replacing
tildas to dots and slashes to backslashes?
Thanks!
Uncaught SyntaxError: Unexpected token < google-analytics
Uncaught SyntaxError: Unexpected token < google-analytics
I followed the google analytics explanation to add this right after the body
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-15481145-1', 'mydomain.com');
ga('send', 'pageview');
</script>
However in Google Chrome in Dev Tools I get
Uncaught SyntaxError: Unexpected token < www.google-analytics.com/:1
What am I missing?
I followed the google analytics explanation to add this right after the body
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-15481145-1', 'mydomain.com');
ga('send', 'pageview');
</script>
However in Google Chrome in Dev Tools I get
Uncaught SyntaxError: Unexpected token < www.google-analytics.com/:1
What am I missing?
Thursday, 29 August 2013
MongoDB: Sort distinct keys by number of occurances
MongoDB: Sort distinct keys by number of occurances
I have a bunch of repository data that I've scrapped from Github. Each
repository has a language key and with pymongo I am able to the list of
all languages in my database with db.distinct('language'). I would like to
sort the list by the number of occurrences so that the first language is
my list is the language associated with the most repositories. Is it
possible to do this in one query instead of querying the database for the
count of each language?
I have a bunch of repository data that I've scrapped from Github. Each
repository has a language key and with pymongo I am able to the list of
all languages in my database with db.distinct('language'). I would like to
sort the list by the number of occurrences so that the first language is
my list is the language associated with the most repositories. Is it
possible to do this in one query instead of querying the database for the
count of each language?
Wednesday, 28 August 2013
ExtJS: Model's not working as intended
ExtJS: Model's not working as intended
I don't understand whats wrong. Trying to learn from the Sencha doc's
app/model/Customer.js
Ext.define('myapp.model.Customer', {
extend: 'Ext.data.Model',
fields: ['id', 'name'],
proxy: {
type: 'rest',
url: 'data/customer'
}
});
app/controller/myController.js
Ext.define('myapp.controller.myController', {
extend: 'Ext.app.Controller',
models: ['Customer'],
...
onSomeEvent: function() {
var cust = Ext.create('Customer', {name: 'neo'});
cust.save();
}
});
I'm getting an Uncaught TypeError: object is not a function error, and my
server is logging a GET /Customer.js?_dc=1395954443
I don't understand whats wrong. Trying to learn from the Sencha doc's
app/model/Customer.js
Ext.define('myapp.model.Customer', {
extend: 'Ext.data.Model',
fields: ['id', 'name'],
proxy: {
type: 'rest',
url: 'data/customer'
}
});
app/controller/myController.js
Ext.define('myapp.controller.myController', {
extend: 'Ext.app.Controller',
models: ['Customer'],
...
onSomeEvent: function() {
var cust = Ext.create('Customer', {name: 'neo'});
cust.save();
}
});
I'm getting an Uncaught TypeError: object is not a function error, and my
server is logging a GET /Customer.js?_dc=1395954443
How to Use Variable Data in C# SQL Query String
How to Use Variable Data in C# SQL Query String
I have a project I'm working in, which I did not create. I am still
relatively new to C# and ASP.NET as a whole. I am faced with this SQL
query:
var sql = @"SELECT * FROM [database] WHERE [submitDate] >=
Convert(datetime,'20130301')";
This of course behaves exactly as expected. What I need to do, however, is
make the 2013 part of the Convert(datetime,'20130301') bit actually equal
to the current yet, so that we don't have to update this query every
single year.
Based on my limited experience I started by trying to concatenate in a C#
variable, not only did that not work, but after some research I learned
that method can be an opening for potential SQL Injections.
I read a bit about parameterizing the SQL Query, but everything I saw on
that led me to believe that I would have to rewrite/rethink how this data
is being pulled from the database in the first place.
Any advice on how to accomplish my goal?
I have a project I'm working in, which I did not create. I am still
relatively new to C# and ASP.NET as a whole. I am faced with this SQL
query:
var sql = @"SELECT * FROM [database] WHERE [submitDate] >=
Convert(datetime,'20130301')";
This of course behaves exactly as expected. What I need to do, however, is
make the 2013 part of the Convert(datetime,'20130301') bit actually equal
to the current yet, so that we don't have to update this query every
single year.
Based on my limited experience I started by trying to concatenate in a C#
variable, not only did that not work, but after some research I learned
that method can be an opening for potential SQL Injections.
I read a bit about parameterizing the SQL Query, but everything I saw on
that led me to believe that I would have to rewrite/rethink how this data
is being pulled from the database in the first place.
Any advice on how to accomplish my goal?
How to get the version of mongodb from php
How to get the version of mongodb from php
I need a way to display a version of Mongo database in the php website.
For example, I want to show something like "powered by MongoDB version
2.2.6"
I cannot find a way to find out the version of database that php
mongoClient is connected to.
I'm sure that is a way to do this. Does anyone know how?
I need a way to display a version of Mongo database in the php website.
For example, I want to show something like "powered by MongoDB version
2.2.6"
I cannot find a way to find out the version of database that php
mongoClient is connected to.
I'm sure that is a way to do this. Does anyone know how?
C++ unexpected behaviour (where are my temporaries!?)
C++ unexpected behaviour (where are my temporaries!?)
This was an r-value experiment but it mutated when gcc whined to me about
lack of move-constructor (I'd deleted it) and didn't fall-back to the copy
constructor (as I expected) I then removed -std=c++11 from the flags and
tried what you see below, it has a lot of output (it didn't initially)
because I am trying to work out why exactly it doesn't work (I know how to
debug but I find messages on stdout to be a good indicator of something
happening)
Here's my code:
#include <iostream>
class Object {
public:
Object() { id=nextId; std::cout << "Creating object: "<<id<<"\n";
nextId++; }
Object(const Object& from) {
id=nextId; std::cout << "Creating object: "<<id<<"\n"; nextId++;
std::cout<<"(Object: "<<id<<" created from Object: "<<from.id<<")\n";
}
Object& operator=(const Object& from) {
std::cout<<"Assigning to "<<id<<" from "<<from.id<<"\n";
return *this;
}
~Object() { std::cout<<"Deconstructing object: "<<id<<"\n";}
private:
static int nextId;
int id;
};
int Object::nextId = 0;
Object test();
int main(int,char**) {
Object a;
std::cout<<"A ought to exist\n";
Object b(test());
std::cout<<"B ought to exist\n";
Object c = test();
std::cout<<"C ought to exist\n";
return 0;
}
Object test() {
std::cout<<"In test\n";
Object tmp;
std::cout<<"Test's tmp ought to exist\n";
return tmp;
}
Output:
Creating object: 0
A ought to exist
In test
Creating object: 1
Test's tmp ought to exist
B ought to exist
In test
Creating object: 2
Test's tmp ought to exist
C ought to exist
Deconstructing object: 2
Deconstructing object: 1
Deconstructing object: 0
I use deconstructing, because deconstruction is already a word, sometimes
I use destructor, I'm never quite happy with the word, I favour destructor
as the noun.
Here's what I expected:
A to be constructed
tmp in test to be constructed, a temporary to be created from that
tmp, tmp to be destructed(?)
that temporary to be the argument to B's copy constructor
the temporary to be destructed.
C's default constructor to be used
"" with a temporary from `test`
C's assignment operator to be used
the temporary to be destructed
c,b,a to be destructed.
I have been called "die-hard C" and I am trying to learn to use C++ as
more than "C with namespaces".
Someone might say "the compiler optimises it out" I'd like that person
never to answer a question with such an answer now or ever, optimisations
must not alter the program state, it must be as if everything happened as
the specification says, so the compiler may humor me by putting a message
on cout that includes the number, it may not bother to even increase the
number and such, but the output of the program would be the same as if it
did do everything the code describes.
So it's not optimisations, what's going on?
This was an r-value experiment but it mutated when gcc whined to me about
lack of move-constructor (I'd deleted it) and didn't fall-back to the copy
constructor (as I expected) I then removed -std=c++11 from the flags and
tried what you see below, it has a lot of output (it didn't initially)
because I am trying to work out why exactly it doesn't work (I know how to
debug but I find messages on stdout to be a good indicator of something
happening)
Here's my code:
#include <iostream>
class Object {
public:
Object() { id=nextId; std::cout << "Creating object: "<<id<<"\n";
nextId++; }
Object(const Object& from) {
id=nextId; std::cout << "Creating object: "<<id<<"\n"; nextId++;
std::cout<<"(Object: "<<id<<" created from Object: "<<from.id<<")\n";
}
Object& operator=(const Object& from) {
std::cout<<"Assigning to "<<id<<" from "<<from.id<<"\n";
return *this;
}
~Object() { std::cout<<"Deconstructing object: "<<id<<"\n";}
private:
static int nextId;
int id;
};
int Object::nextId = 0;
Object test();
int main(int,char**) {
Object a;
std::cout<<"A ought to exist\n";
Object b(test());
std::cout<<"B ought to exist\n";
Object c = test();
std::cout<<"C ought to exist\n";
return 0;
}
Object test() {
std::cout<<"In test\n";
Object tmp;
std::cout<<"Test's tmp ought to exist\n";
return tmp;
}
Output:
Creating object: 0
A ought to exist
In test
Creating object: 1
Test's tmp ought to exist
B ought to exist
In test
Creating object: 2
Test's tmp ought to exist
C ought to exist
Deconstructing object: 2
Deconstructing object: 1
Deconstructing object: 0
I use deconstructing, because deconstruction is already a word, sometimes
I use destructor, I'm never quite happy with the word, I favour destructor
as the noun.
Here's what I expected:
A to be constructed
tmp in test to be constructed, a temporary to be created from that
tmp, tmp to be destructed(?)
that temporary to be the argument to B's copy constructor
the temporary to be destructed.
C's default constructor to be used
"" with a temporary from `test`
C's assignment operator to be used
the temporary to be destructed
c,b,a to be destructed.
I have been called "die-hard C" and I am trying to learn to use C++ as
more than "C with namespaces".
Someone might say "the compiler optimises it out" I'd like that person
never to answer a question with such an answer now or ever, optimisations
must not alter the program state, it must be as if everything happened as
the specification says, so the compiler may humor me by putting a message
on cout that includes the number, it may not bother to even increase the
number and such, but the output of the program would be the same as if it
did do everything the code describes.
So it's not optimisations, what's going on?
Tuesday, 27 August 2013
How can I return from a browser activity to my activity that started it?
How can I return from a browser activity to my activity that started it?
My app generates Google Map urls, then uses ACTION_VIEW to bring up the
map. The user gets his choice of Chrome, Google Maps, Browser, etc., to
execute the action. The problem is trying to get back to my main activity
with the back key. Strangely, if I use Google Maps to execute the action,
hitting the back key gets me into my Chrome web browser and backs up from
there, rather than into my starting activity. Here's my code:
Main Activity
Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri);
browserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(browserIntent);
MainActivityManifest
<activity
android:name="net.hilltopper.gamewatch.MainActivity"
android:label="@string/app_name" >
</activity>
"MainActivity" is kind of a misnomer, as it's actually the second activity
called. But it was the first at the beginning, and then I added an intro
video that actually became the first activity.
Still, why does setting my two flags as above not start the Google Maps,
or Chrome, or whatever activity the user chooses to complete the action,
with a clear top and no history so that the back key will return to the
caller instead of heading out into other territory?
My app generates Google Map urls, then uses ACTION_VIEW to bring up the
map. The user gets his choice of Chrome, Google Maps, Browser, etc., to
execute the action. The problem is trying to get back to my main activity
with the back key. Strangely, if I use Google Maps to execute the action,
hitting the back key gets me into my Chrome web browser and backs up from
there, rather than into my starting activity. Here's my code:
Main Activity
Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri);
browserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(browserIntent);
MainActivityManifest
<activity
android:name="net.hilltopper.gamewatch.MainActivity"
android:label="@string/app_name" >
</activity>
"MainActivity" is kind of a misnomer, as it's actually the second activity
called. But it was the first at the beginning, and then I added an intro
video that actually became the first activity.
Still, why does setting my two flags as above not start the Google Maps,
or Chrome, or whatever activity the user chooses to complete the action,
with a clear top and no history so that the back key will return to the
caller instead of heading out into other territory?
why is my code returning nil in ruby?
why is my code returning nil in ruby?
I am trying to calculate freezing point of 0 Fahrenheit. My code is
returning nil. I am trying to solve a question in http://testfirst.org/ .
So I created a Temperature class. created a Hash. I iterate over each
hash. With the value I iterate and do the calculation
My Code
class Temperature
attr_accessor :f
def initialize(f)
f = Hash.new
@f = f
end
def to_fahrenheit
50
end
def to_celsius
f.each do |key, value|
@to_c = if value == 32
0
elsif value == 212
100
elsif value == 98.6
37
elsif value == 68
20
else
f = value.to_f
(f -32 ) / 1.8
end
end
@to_c
end
end
My Test
require "temperature"
describe Temperature do
describe "can be constructed with an options hash" do
describe "in degrees fahrenheit" do
it "at 50 degrees" do
end
describe "and correctly convert to celsius" do
it "at freezing" do
Temperature.new({:f => 32}).to_celsius.should == 0
end
it "at boiling" do
Temperature.new({:f => 212}).to_celsius.should == 100
end
it "at body temperature" do
Temperature.new({:f => 98.6}).to_celsius.should == 37
end
it "at an arbitrary temperature" do
Temperature.new({:f => 68}).to_celsius.should == 20
end
end
end
My terminal
1) Temperature can be constructed with an options hash in degrees
fahrenheit and correctly convert to celsius at freezing
Failure/Error: Temperature.new({:f => 32}).to_celsius.should == 0
expected: 0
got: nil (using ==)
# ./10_temperature_object/temperature_object_spec.rb:31:in `block (5
levels) in <top (required)>'
I am trying to calculate freezing point of 0 Fahrenheit. My code is
returning nil. I am trying to solve a question in http://testfirst.org/ .
So I created a Temperature class. created a Hash. I iterate over each
hash. With the value I iterate and do the calculation
My Code
class Temperature
attr_accessor :f
def initialize(f)
f = Hash.new
@f = f
end
def to_fahrenheit
50
end
def to_celsius
f.each do |key, value|
@to_c = if value == 32
0
elsif value == 212
100
elsif value == 98.6
37
elsif value == 68
20
else
f = value.to_f
(f -32 ) / 1.8
end
end
@to_c
end
end
My Test
require "temperature"
describe Temperature do
describe "can be constructed with an options hash" do
describe "in degrees fahrenheit" do
it "at 50 degrees" do
end
describe "and correctly convert to celsius" do
it "at freezing" do
Temperature.new({:f => 32}).to_celsius.should == 0
end
it "at boiling" do
Temperature.new({:f => 212}).to_celsius.should == 100
end
it "at body temperature" do
Temperature.new({:f => 98.6}).to_celsius.should == 37
end
it "at an arbitrary temperature" do
Temperature.new({:f => 68}).to_celsius.should == 20
end
end
end
My terminal
1) Temperature can be constructed with an options hash in degrees
fahrenheit and correctly convert to celsius at freezing
Failure/Error: Temperature.new({:f => 32}).to_celsius.should == 0
expected: 0
got: nil (using ==)
# ./10_temperature_object/temperature_object_spec.rb:31:in `block (5
levels) in <top (required)>'
Change css class if input has a value
Change css class if input has a value
How can I change the CSS class of an input field, if that input field has
a value
Example:
<input name='referrer' type='text' class='input-xlarge placeholder'
placeholder='Referrer' value='{$ref}' style='width:346px;'>
Currently, I am doing like this:
if ($('#reffield').val() != ''){ $('#reffield').addClass('classname'); }
But that doesn't have any effect, nor does it generate any error.
How can I change the CSS class of an input field, if that input field has
a value
Example:
<input name='referrer' type='text' class='input-xlarge placeholder'
placeholder='Referrer' value='{$ref}' style='width:346px;'>
Currently, I am doing like this:
if ($('#reffield').val() != ''){ $('#reffield').addClass('classname'); }
But that doesn't have any effect, nor does it generate any error.
in php friend system, how to print from friend table friends of my friends
in php friend system, how to print from friend table friends of my friends
I have created a friend system in php. A table called friends, has 3
columns. First for friends_id, second user_one and third user_two.
Friends(friends_id, user_one, user_two). Where user_one and user_two are
the ids of the users that are friends.
The following piece of code prints me friends of my friends.
<?php
$friend_query = mysql_query(" SELECT `user_one`, `user_two` FROM
`friends` WHERE `user_one`='$session_user_id' OR
`user_two`='$session_user_id' ");
while($run_friend = mysql_fetch_array($friend_query)){
$user_one = $run_friend['user_one'];
$user_two = $run_friend['user_two'];
if($user_one == $session_user_id){
$user = $user_two;
}else{
$user = $user_one;
}
$friend_id = getuser($user, 'user_id');
$friend_query_two = mysql_query(" SELECT `user_one`, `user_two` FROM
`friends` WHERE (`user_one`='$friend_id' and `user_two` !=
'$session_user_id') OR (`user_one`!='$session_user_id'
and`user_two`='$friend_id' ) ");
while($run_friend_two = mysql_fetch_array($friend_query_two)){
$user_one_two = $run_friend_two['user_one'];
$user_two_two = $run_friend_two['user_two'];
if($user_one_two == $friend_id){
$user_two = $user_two_two;
}else{
$user_two = $user_one_two;
}
$friend_id_two = getuser($user_two, 'user_id');
echo $friend_id_two;
} //end while first
} //end while second
?>
My code works fine, but how can I modify it in order to make it print only
the friends of my friends that happens not to be my friends? (because some
friends of my friends, happens to be my friends as well).
I have created a friend system in php. A table called friends, has 3
columns. First for friends_id, second user_one and third user_two.
Friends(friends_id, user_one, user_two). Where user_one and user_two are
the ids of the users that are friends.
The following piece of code prints me friends of my friends.
<?php
$friend_query = mysql_query(" SELECT `user_one`, `user_two` FROM
`friends` WHERE `user_one`='$session_user_id' OR
`user_two`='$session_user_id' ");
while($run_friend = mysql_fetch_array($friend_query)){
$user_one = $run_friend['user_one'];
$user_two = $run_friend['user_two'];
if($user_one == $session_user_id){
$user = $user_two;
}else{
$user = $user_one;
}
$friend_id = getuser($user, 'user_id');
$friend_query_two = mysql_query(" SELECT `user_one`, `user_two` FROM
`friends` WHERE (`user_one`='$friend_id' and `user_two` !=
'$session_user_id') OR (`user_one`!='$session_user_id'
and`user_two`='$friend_id' ) ");
while($run_friend_two = mysql_fetch_array($friend_query_two)){
$user_one_two = $run_friend_two['user_one'];
$user_two_two = $run_friend_two['user_two'];
if($user_one_two == $friend_id){
$user_two = $user_two_two;
}else{
$user_two = $user_one_two;
}
$friend_id_two = getuser($user_two, 'user_id');
echo $friend_id_two;
} //end while first
} //end while second
?>
My code works fine, but how can I modify it in order to make it print only
the friends of my friends that happens not to be my friends? (because some
friends of my friends, happens to be my friends as well).
Nx Client Windos
Nx Client Windos
So I have NX Client installed on my Win7
Settings NXClient in win Correct Ip/port Desktop: GNOME Display Available
Area
I also have installed ubuntu 13.04 in my asus eee pc 901
Also installed: openssh nxclient nxnode nxserver
So the issue i get is it does not load desktop environment.
I'm able to connect to the computer and get command line via putty.exe.
I was able to get desktop environment when i installed xubuntu
And change node.cfg
Commented out #CommandStartGnome = " /etc/X11/Xsession gnome-session
with Commented out #CommandStartGnome = " /usr/bin/startxfce4"/
What am i doing wrong?
So I have NX Client installed on my Win7
Settings NXClient in win Correct Ip/port Desktop: GNOME Display Available
Area
I also have installed ubuntu 13.04 in my asus eee pc 901
Also installed: openssh nxclient nxnode nxserver
So the issue i get is it does not load desktop environment.
I'm able to connect to the computer and get command line via putty.exe.
I was able to get desktop environment when i installed xubuntu
And change node.cfg
Commented out #CommandStartGnome = " /etc/X11/Xsession gnome-session
with Commented out #CommandStartGnome = " /usr/bin/startxfce4"/
What am i doing wrong?
JPQL: How to "SELECT new Foo(null, null... someValue, ..)?
JPQL: How to "SELECT new Foo(null, null... someValue, ..)?
For example I have an entity
public class Foo {
private String col1;
private String col2;
private String col3;
private String col4;
//getters and setters
}
What I want to do is to select only col3 and col4. But I already have a
Foo constructor like below:
public Foo (String col1, String col2) {
this.col1 = col1;
this.col2 = col2;
}
Thus, I cannot have another constructor for col3 and col4 because it will
have the same signature.
What I am trying to accomplish so far is to make a complete constructor like:
public Foo (String col1, String col2, String col3, String col4) {
this.col1 = col1;
this.col2 = col2;
this.col3 = col3;
this.col4 = col4;
}
But when I try to do something like below in my query
SELECT new Foo(null, null, f.col3, f.col4)
FROM Foo f
I get
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of
subtree
Although when I try
SELECT new Foo(f.col1, f.col2, f.col3, f.col4)
FROM Foo f
It works as expected.
For example I have an entity
public class Foo {
private String col1;
private String col2;
private String col3;
private String col4;
//getters and setters
}
What I want to do is to select only col3 and col4. But I already have a
Foo constructor like below:
public Foo (String col1, String col2) {
this.col1 = col1;
this.col2 = col2;
}
Thus, I cannot have another constructor for col3 and col4 because it will
have the same signature.
What I am trying to accomplish so far is to make a complete constructor like:
public Foo (String col1, String col2, String col3, String col4) {
this.col1 = col1;
this.col2 = col2;
this.col3 = col3;
this.col4 = col4;
}
But when I try to do something like below in my query
SELECT new Foo(null, null, f.col3, f.col4)
FROM Foo f
I get
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of
subtree
Although when I try
SELECT new Foo(f.col1, f.col2, f.col3, f.col4)
FROM Foo f
It works as expected.
Monday, 26 August 2013
Set Joomla cookie expiration for Joomla users
Set Joomla cookie expiration for Joomla users
I am trying to to change the cookie expiration for the default login for
Joomla users to 90 days. I have read that the cookie expires after the
session has ended (when user closes the browser). Does anyone know how I
could change it and which file is the code contained?
I have been scouring the internet for two days for a solution but most of
them are about the 1.5 version of Joomla. There was no reply on Joomla
support forum also. I am using 3.1.
I am trying to to change the cookie expiration for the default login for
Joomla users to 90 days. I have read that the cookie expires after the
session has ended (when user closes the browser). Does anyone know how I
could change it and which file is the code contained?
I have been scouring the internet for two days for a solution but most of
them are about the 1.5 version of Joomla. There was no reply on Joomla
support forum also. I am using 3.1.
Is it correct or safe to throw an Exception whose message includes the offending value?
Is it correct or safe to throw an Exception whose message includes the
offending value?
Let's say you are writing a generic doSomething method where you check a
string argument for validity:
public void doSomething(String argument) {
if(!checkArgument(argument)) {
// Argument is not valid
throw new IllegalArgumentException("Argument " + argument + " is not
valid");
}
...
Is throwing an Exception whose message can contain potentially arbitrary
text safe? Or can it expose the program to log forging or some other
security issues?
Is there any best practice to handle such cases?
offending value?
Let's say you are writing a generic doSomething method where you check a
string argument for validity:
public void doSomething(String argument) {
if(!checkArgument(argument)) {
// Argument is not valid
throw new IllegalArgumentException("Argument " + argument + " is not
valid");
}
...
Is throwing an Exception whose message can contain potentially arbitrary
text safe? Or can it expose the program to log forging or some other
security issues?
Is there any best practice to handle such cases?
Displaying just one post from each category on archive page
Displaying just one post from each category on archive page
My categories look like this. Each has one or more posts
-Main Category
--Main Category Sub-category 1
--- 1 post here
--- 1 post here
--Main Category Sub-category 2
--- 1 post here
--- 1 post here
--- 1 post here
--Main Category Sub-category 3
--- 1 post here
When viewing Main Category archive page I only want the first post from
each of the subcategories. So in my case I would only have 3 posts. Using
twentythirteen theme. Don't want to change too much. I hope it can be done
with query_posts.
<?php /* The loop */ ?>
<?php query_posts($query_string . '&??????'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content-category', get_post_format()
); ?>
<?php endwhile; ?>
My categories look like this. Each has one or more posts
-Main Category
--Main Category Sub-category 1
--- 1 post here
--- 1 post here
--Main Category Sub-category 2
--- 1 post here
--- 1 post here
--- 1 post here
--Main Category Sub-category 3
--- 1 post here
When viewing Main Category archive page I only want the first post from
each of the subcategories. So in my case I would only have 3 posts. Using
twentythirteen theme. Don't want to change too much. I hope it can be done
with query_posts.
<?php /* The loop */ ?>
<?php query_posts($query_string . '&??????'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content-category', get_post_format()
); ?>
<?php endwhile; ?>
Java Unit test for Exception
Java Unit test for Exception
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
try
{
builder = factory.newDocumentBuilder();
}
catch (ParserConfigurationException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
doc = builder.parse(entity.getContent());
}
catch (IllegalStateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (SAXException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
There are 3 exceptions I need to write Junit test to get into the
exception. Does anyone know how to use powermock or easymock class to
write the unit test for it?
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
try
{
builder = factory.newDocumentBuilder();
}
catch (ParserConfigurationException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
doc = builder.parse(entity.getContent());
}
catch (IllegalStateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (SAXException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
There are 3 exceptions I need to write Junit test to get into the
exception. Does anyone know how to use powermock or easymock class to
write the unit test for it?
How to share Guest's internet with host on Virtualbox?
How to share Guest's internet with host on Virtualbox?
I have a problem that I have been trying to fix over 3 months now, I'm
using Ubuntu 12.04 64bit with Windows 7 as a Guest on VirtualBox, I have a
USB Modem which doesn't support Linux, the Modem works good on the Guest
but I don't know how to let the Host (Ubuntu) use that connection, I have
searched around the Internet and most documents and fixes for how to share
Host's connection with Guest, not Guest with Host. Beside, I've found some
posts with similar problem but I couldn't understand the workarounds, I'm
still beginner. So could anyone provide a step-by-step guide how to share
Guest's Internet with Host? Thanks a lot!
I have a problem that I have been trying to fix over 3 months now, I'm
using Ubuntu 12.04 64bit with Windows 7 as a Guest on VirtualBox, I have a
USB Modem which doesn't support Linux, the Modem works good on the Guest
but I don't know how to let the Host (Ubuntu) use that connection, I have
searched around the Internet and most documents and fixes for how to share
Host's connection with Guest, not Guest with Host. Beside, I've found some
posts with similar problem but I couldn't understand the workarounds, I'm
still beginner. So could anyone provide a step-by-step guide how to share
Guest's Internet with Host? Thanks a lot!
Get web page content (with json array)
Get web page content (with json array)
I am trying to get my web page content (i have in the page json array),
and i can not find a way to do it, evry code i found in google dont work
and crash the application..
I need help!
Thanks!
I am trying to get my web page content (i have in the page json array),
and i can not find a way to do it, evry code i found in google dont work
and crash the application..
I need help!
Thanks!
Rounded Corners are not working in IE 10 & IE 9
Rounded Corners are not working in IE 10 & IE 9
I have a website which works perfectly in IE 10 as Browser mode and IE5
quirks as document mode. But the round corners are not working in this
scenario. Rounded corners are working when i change the document mode to
IE 9 standards. But i want IE 5 quirks as document mode.
My CSS is, .roundedcorner { behavior: url(/Includes/border-radius.htc);
-moz-border-radius: 30px; -webkit-border-radius: 30px;
-khtml-border-radius: 30px; border-radius: 30px;
border-top-left-radius:30px; border-top-right-radius:30px;
border-bottom-left-radius:30px; border-bottom-right-radius:30px; } Please
help me in resolving the issue.
Thanks in Advance, Raghava.
I have a website which works perfectly in IE 10 as Browser mode and IE5
quirks as document mode. But the round corners are not working in this
scenario. Rounded corners are working when i change the document mode to
IE 9 standards. But i want IE 5 quirks as document mode.
My CSS is, .roundedcorner { behavior: url(/Includes/border-radius.htc);
-moz-border-radius: 30px; -webkit-border-radius: 30px;
-khtml-border-radius: 30px; border-radius: 30px;
border-top-left-radius:30px; border-top-right-radius:30px;
border-bottom-left-radius:30px; border-bottom-right-radius:30px; } Please
help me in resolving the issue.
Thanks in Advance, Raghava.
What would a PC need to be able to eat live animals raw=?iso-8859-1?Q?=3F_=96_rpg.stackexchange.com?=
What would a PC need to be able to eat live animals raw? –
rpg.stackexchange.com
Ok, so I mentioned in another question an idea for a character known for
"(eating) small animals live and fresh with all the dignity and etiquette
of a nobleman eating a sandwich"; would a character …
rpg.stackexchange.com
Ok, so I mentioned in another question an idea for a character known for
"(eating) small animals live and fresh with all the dignity and etiquette
of a nobleman eating a sandwich"; would a character …
At what angle do these curves cut one another=?iso-8859-1?Q?=3F_=96_math.stackexchange.com?=
At what angle do these curves cut one another? – math.stackexchange.com
I'm working on an exercise that asks this: At what angle do the curves $$y
= 3.5x^2 + 2$$ and $$y = x^2 - 5x + 9.5$$ cut one another? I have set
these equations equal to one another to find two values …
I'm working on an exercise that asks this: At what angle do the curves $$y
= 3.5x^2 + 2$$ and $$y = x^2 - 5x + 9.5$$ cut one another? I have set
these equations equal to one another to find two values …
Sunday, 25 August 2013
$2000 is ok?iOS + Android + Cocos2d-x Mobile game source code on sale. only $2000
$2000 is ok?iOS + Android + Cocos2d-x Mobile game source code on sale.
only $2000
Code Structure and Core Content
Based on cocos2d-x by using C++,Objective-C and Java Interaction between
cocos2d-x and OC, using iAP in iOS version and how to connect Java and
original SDK. Mutual call between cocos2d-x and LUA iOS version applies to
iphone4,iphone retina, iphone 5, iPad, iPad mini and etc. Android version
applies to most of the popular devices with high/medium/low resolution.
The coding structure is concise with clear SVN of 600 versions, the
documentation management is also professional in terms of naming. All the
coding was developed by professionals working in various mobile Internet
Game company with over 5 years' development experience. Localization in
both iOS and android version.
Where to download the application package and check the running status?
Search ħ·¨Ó泡 (Magic Fishery) in itunes or click
https://itunes.apple.com/cn/app/bu-yu-wai-chuan-mo-fa-yu-chang/id598149176?mt=8
if you are using iOS platform Search ħ·¨Ó泡 (Magic Fishery) in Google
Play or click http://www.appchina.com/app/com.FMGame91.fisher/ if you are
using Android. If you need the latest version of adHoc or APK, we can also
provide the customized version.
Some Data Release
The iOS version is released on APP store with daily download of 300 and
100,000 in total. The Android version is released on google market with
80,000 in total. The profit mode is mainly focusing on advertisement
embedding on Admob. And also from iOS In app Purchase.
What's in it for you?
For management level, you can refine the UI and have them resubmitted. It
also applies to team training and cases sharing for a new team. For
development staff, you can learn the coding structure and solve some
difficulties during development. For UI staff, you can learn how to
process graphics For freelancers, you can rename it or change the ID and
have it re-submitted, for long-term investment purpose including game
in-purchase and advertisement. For Promotion staff, you can have it
promoted by cooperating with some investors. or you can modify it into
social version and develop it into various games
Our advantages
The whole code package could be opened with xocode of MAC by running iOS
and Eclipse by running Android. It is developed based on a cross-platform.
About the Price
All of this code is only $2000¡.. It very worthy. Why it is? If your team
try to develop a project like Magic Fishery. You should: Let¡¯s have a
breakdown! 2 senior cocos2d-x game developer work for 2month 1 UI designer
work for 2 month 1 iOS developer with for 1 month 1 Android developer work
1 month.
So the total might be more than $10,000 and tester/QA is not included. The
whole development duration would be at least 3 months.
About Payment
A formal contract will be signed and our company will provide the contract
and have the signed and sealed or no contract at all. Payment methods:
By PayPal. Email transfer based on a bank debit card.
Finally, if you are interest in this code. Just feel free to ping us at
alexliu0506@gmail.com We will reply you as soon as possible.
only $2000
Code Structure and Core Content
Based on cocos2d-x by using C++,Objective-C and Java Interaction between
cocos2d-x and OC, using iAP in iOS version and how to connect Java and
original SDK. Mutual call between cocos2d-x and LUA iOS version applies to
iphone4,iphone retina, iphone 5, iPad, iPad mini and etc. Android version
applies to most of the popular devices with high/medium/low resolution.
The coding structure is concise with clear SVN of 600 versions, the
documentation management is also professional in terms of naming. All the
coding was developed by professionals working in various mobile Internet
Game company with over 5 years' development experience. Localization in
both iOS and android version.
Where to download the application package and check the running status?
Search ħ·¨Ó泡 (Magic Fishery) in itunes or click
https://itunes.apple.com/cn/app/bu-yu-wai-chuan-mo-fa-yu-chang/id598149176?mt=8
if you are using iOS platform Search ħ·¨Ó泡 (Magic Fishery) in Google
Play or click http://www.appchina.com/app/com.FMGame91.fisher/ if you are
using Android. If you need the latest version of adHoc or APK, we can also
provide the customized version.
Some Data Release
The iOS version is released on APP store with daily download of 300 and
100,000 in total. The Android version is released on google market with
80,000 in total. The profit mode is mainly focusing on advertisement
embedding on Admob. And also from iOS In app Purchase.
What's in it for you?
For management level, you can refine the UI and have them resubmitted. It
also applies to team training and cases sharing for a new team. For
development staff, you can learn the coding structure and solve some
difficulties during development. For UI staff, you can learn how to
process graphics For freelancers, you can rename it or change the ID and
have it re-submitted, for long-term investment purpose including game
in-purchase and advertisement. For Promotion staff, you can have it
promoted by cooperating with some investors. or you can modify it into
social version and develop it into various games
Our advantages
The whole code package could be opened with xocode of MAC by running iOS
and Eclipse by running Android. It is developed based on a cross-platform.
About the Price
All of this code is only $2000¡.. It very worthy. Why it is? If your team
try to develop a project like Magic Fishery. You should: Let¡¯s have a
breakdown! 2 senior cocos2d-x game developer work for 2month 1 UI designer
work for 2 month 1 iOS developer with for 1 month 1 Android developer work
1 month.
So the total might be more than $10,000 and tester/QA is not included. The
whole development duration would be at least 3 months.
About Payment
A formal contract will be signed and our company will provide the contract
and have the signed and sealed or no contract at all. Payment methods:
By PayPal. Email transfer based on a bank debit card.
Finally, if you are interest in this code. Just feel free to ping us at
alexliu0506@gmail.com We will reply you as soon as possible.
Black tea water: Does boiling water first make a difference?
Black tea water: Does boiling water first make a difference?
When I make black tea, I usually put the leaves (or tea bags) into cold or
room-temperature water before I start boiling it. I've noticed that
certain cultures always insist on first boiling the water, and only
putting in tea leaves once it reaches a full, rolling boil.
Does boiling the water before putting in the leaves make a difference? I
tried both ways and couldn't find a difference in taste. It seems like
boiling for more than a few minutes means both would have similar levels
of oxygen (not sure why that would make a difference).
To clarify: I personally *boil my tea leaves (or bag) for several minutes,
as in 10-20 minutes or more. It seems like the other popular way to make
tea is to steep in boiling water for several minutes.
I would like clarity on whether putting the leaves/bags in cold water
makes a difference, especially given the time-scale of boiling (should it
be shortened).
When I make black tea, I usually put the leaves (or tea bags) into cold or
room-temperature water before I start boiling it. I've noticed that
certain cultures always insist on first boiling the water, and only
putting in tea leaves once it reaches a full, rolling boil.
Does boiling the water before putting in the leaves make a difference? I
tried both ways and couldn't find a difference in taste. It seems like
boiling for more than a few minutes means both would have similar levels
of oxygen (not sure why that would make a difference).
To clarify: I personally *boil my tea leaves (or bag) for several minutes,
as in 10-20 minutes or more. It seems like the other popular way to make
tea is to steep in boiling water for several minutes.
I would like clarity on whether putting the leaves/bags in cold water
makes a difference, especially given the time-scale of boiling (should it
be shortened).
Email doesn't send from my PHP/html contact form
Email doesn't send from my PHP/html contact form
I'm quite new to PHP and I needed a contact form so I took one off the
internet and edited everything I needed/wanted too. The mail won't send
though, so if anyone could help me fix this I would be very happy!
HTML:
<form name="contactform" method="post"action="send_form_email.php">
<p class="name">
<input type="text" name="first_name" id="name"
placeholder="Fullständigt namn" />
</p>
<p class="foretag">
<input type="text" name="foretag" id="foretag"
placeholder="Företag" />
</p>
<p class="email">
<input type="text" name="email" id="email" placeholder="Email" />
</p>
<p class="telefon">
<input type="text" name="telephone" id="telephone"
placeholder="Telefonnummer" />
</p>
<p class="text">
<textarea name="text" id="text" placeholder="Meddelande"
/></textarea>
</p>
<p class="robotic" id="pot">
<label>Om du är människa, full inte i denna ruta:</label>
<input name="robotest" type="text" id="robotest" class="robotest" />
</p>
<p class="submit">
<input type="submit" value="Skicka" />
</p>
</form>
</div>
PHP:
<?php
if(isset($_POST['email'])) {
$email_to = "herman.larsson@live.se";
$email_subject = "bezod-design kontakta";
function died($error) {
// your error code can go here
echo "Fel uppstog";
echo "Error kod:.<br /><br />";
echo $error."<br /><br />";
echo "Gå tillbaks och fixa problemet och försök igen.<br /><br
/>";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['foretag']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset($_POST['text'])) {
died('Det värkar vara ett problem med formuläret du skrev');
}
$first_name = $_POST['first_name'];
$foretag = $_POST['foretag'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$text = $_POST['text'];
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email)) {
$error_message .= 'Emailadressen du angav värkar inte vara
giltig.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'Namnet du angav värkar inte vara giltig.<br />';
}
if(!preg_match($string_exp,$foretag)) {
$error_message .= 'Företaget du angav är inte giltig..<br />';
}
if(strlen($text) < 2) {
$error_message .= 'Meddelandet du angav är inte giltig..<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
if (preg_match("/http/i", "$first_name")) {echo "$spamErrorMessage"; exit();}
if (preg_match("/http/i", "$email")) {echo "$spamErrorMessage";
exit();}
if (preg_match("/http/i", "$telephone")) {echo
"$spamErrorMessage";exit();}
if (preg_match("/http/i", "$text")) {echo "$spamErrorMessage";
exit();}
$SpamErrorMessage = "Ingen URL tillåten";
$headers = 'From: '.$email_from."\r\n";
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
if($robotest)
$error = "You are a gutless robot.";
else {
@mail($email_to, $email_subject, $email_message, $headers);
}
}
?>
I'm quite new to PHP and I needed a contact form so I took one off the
internet and edited everything I needed/wanted too. The mail won't send
though, so if anyone could help me fix this I would be very happy!
HTML:
<form name="contactform" method="post"action="send_form_email.php">
<p class="name">
<input type="text" name="first_name" id="name"
placeholder="Fullständigt namn" />
</p>
<p class="foretag">
<input type="text" name="foretag" id="foretag"
placeholder="Företag" />
</p>
<p class="email">
<input type="text" name="email" id="email" placeholder="Email" />
</p>
<p class="telefon">
<input type="text" name="telephone" id="telephone"
placeholder="Telefonnummer" />
</p>
<p class="text">
<textarea name="text" id="text" placeholder="Meddelande"
/></textarea>
</p>
<p class="robotic" id="pot">
<label>Om du är människa, full inte i denna ruta:</label>
<input name="robotest" type="text" id="robotest" class="robotest" />
</p>
<p class="submit">
<input type="submit" value="Skicka" />
</p>
</form>
</div>
PHP:
<?php
if(isset($_POST['email'])) {
$email_to = "herman.larsson@live.se";
$email_subject = "bezod-design kontakta";
function died($error) {
// your error code can go here
echo "Fel uppstog";
echo "Error kod:.<br /><br />";
echo $error."<br /><br />";
echo "Gå tillbaks och fixa problemet och försök igen.<br /><br
/>";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['foretag']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset($_POST['text'])) {
died('Det värkar vara ett problem med formuläret du skrev');
}
$first_name = $_POST['first_name'];
$foretag = $_POST['foretag'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$text = $_POST['text'];
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email)) {
$error_message .= 'Emailadressen du angav värkar inte vara
giltig.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'Namnet du angav värkar inte vara giltig.<br />';
}
if(!preg_match($string_exp,$foretag)) {
$error_message .= 'Företaget du angav är inte giltig..<br />';
}
if(strlen($text) < 2) {
$error_message .= 'Meddelandet du angav är inte giltig..<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
if (preg_match("/http/i", "$first_name")) {echo "$spamErrorMessage"; exit();}
if (preg_match("/http/i", "$email")) {echo "$spamErrorMessage";
exit();}
if (preg_match("/http/i", "$telephone")) {echo
"$spamErrorMessage";exit();}
if (preg_match("/http/i", "$text")) {echo "$spamErrorMessage";
exit();}
$SpamErrorMessage = "Ingen URL tillåten";
$headers = 'From: '.$email_from."\r\n";
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
if($robotest)
$error = "You are a gutless robot.";
else {
@mail($email_to, $email_subject, $email_message, $headers);
}
}
?>
Using 32bit application in 64bit
Using 32bit application in 64bit
I am using windows 32 bit VLC media player in 64 bit pc. It is working
fine. but my question is that won't it allocate memory according to 32 bit
structure? That means though i have 64 bit PC, i wouldn't get advantage of
it. Simply 64 bit might have good memory allocation in register than 32
bit. Sorry for the simple question but, i am new at Computer Organization
Architecture.
EDITED : my point : using a 32bit VLC player in my 64bit OS (4GB RAM) will
run like a 32bit player running on 32bit system.. so it doesn't make any
sense whether you've 64 bit System or 32 bit system , because it's running
like a simple 32bit system. Thanks in advance.
PS. i want it in technical terms, but i have to answer in NON TECHNICAL
TERMS.(a general user can understand your answer).so try in general
meaning at the end of your answer. thanks for help ..
I am using windows 32 bit VLC media player in 64 bit pc. It is working
fine. but my question is that won't it allocate memory according to 32 bit
structure? That means though i have 64 bit PC, i wouldn't get advantage of
it. Simply 64 bit might have good memory allocation in register than 32
bit. Sorry for the simple question but, i am new at Computer Organization
Architecture.
EDITED : my point : using a 32bit VLC player in my 64bit OS (4GB RAM) will
run like a 32bit player running on 32bit system.. so it doesn't make any
sense whether you've 64 bit System or 32 bit system , because it's running
like a simple 32bit system. Thanks in advance.
PS. i want it in technical terms, but i have to answer in NON TECHNICAL
TERMS.(a general user can understand your answer).so try in general
meaning at the end of your answer. thanks for help ..
Saturday, 24 August 2013
What's wrong with the following code?.plz correct it
What's wrong with the following code?.plz correct it
shapan
function m() {var x=document.getElementById("p") .value if(x==hidden)
{document.getElementById("p") .style.visibility='show'} else
{document.getElementById("p") .style.visibility='hidden'} } a why i cant
execute
shapan
function m() {var x=document.getElementById("p") .value if(x==hidden)
{document.getElementById("p") .style.visibility='show'} else
{document.getElementById("p") .style.visibility='hidden'} } a why i cant
execute
Count subquery in a select - mongoDB
Count subquery in a select - mongoDB
I want to make a query to get a kind of ranking of users with more tweets
in my database mongoDB:
var TeewtSchema = new Schema({
userId: Number,
twweetId : Number,
createdAt: Date,
cuerpo: String,
nameUser: String,
location: String,
avatar: String,
user: String
});
MySql that output something similar to:
SELECT *, (SELECT COUNT(*) FROM `TABLE 1` WHERE userId = t.userId )
rank FROM `TABLE 1` t GROUP BY t.userId ORDER BY rank DESC
but in mongoDB i have no idea how to do
I want to make a query to get a kind of ranking of users with more tweets
in my database mongoDB:
var TeewtSchema = new Schema({
userId: Number,
twweetId : Number,
createdAt: Date,
cuerpo: String,
nameUser: String,
location: String,
avatar: String,
user: String
});
MySql that output something similar to:
SELECT *, (SELECT COUNT(*) FROM `TABLE 1` WHERE userId = t.userId )
rank FROM `TABLE 1` t GROUP BY t.userId ORDER BY rank DESC
but in mongoDB i have no idea how to do
Understanding the definition of the order of an entire function
Understanding the definition of the order of an entire function
Let $f: \mathbb C \to \mathbb C$ be an entire function. The order of $f$
is defined by $$\lambda=\limsup_{r \to \infty} \frac{\log \log M(r)}{\log
r}, $$ where $$M(r)=\max_{|z|=r} |f(z)| .$$
The author claims that
"According to this definition $\lambda$ is the smallest number such that
$$M(r)\leq e^{r^{\lambda+\varepsilon}} $$ for any given $\varepsilon > 0$
as soon as $r$ is sufficiently large."
Why is this true?
My attempt:
We know that $$\lambda=\lim_{\rho \to \infty} \sup_{r \geq \rho}
\frac{\log \log M(r)}{\log r}. $$
From the definition of the limit we have that for any $\varepsilon>0$,
there exists some $\rho_0>0$, such that $$\left\lvert \sup_{r \geq \rho}
\frac{\log \log M(r)}{\log r}-\lambda \right\rvert \leq \varepsilon ,$$
for every $\rho \geq \rho_0$. In other words $$\frac{\log \log M(r)}{\log
r} \leq \lambda+\varepsilon $$ for every $r \geq \rho_0$. From here it is
easy to see that $$M(r)\leq e^{r^{\lambda+\varepsilon}}, $$ for all $r
\geq \rho_0$. I cannot see why $\lambda$ is the smallest number with this
property.
Thanks in advance.
Let $f: \mathbb C \to \mathbb C$ be an entire function. The order of $f$
is defined by $$\lambda=\limsup_{r \to \infty} \frac{\log \log M(r)}{\log
r}, $$ where $$M(r)=\max_{|z|=r} |f(z)| .$$
The author claims that
"According to this definition $\lambda$ is the smallest number such that
$$M(r)\leq e^{r^{\lambda+\varepsilon}} $$ for any given $\varepsilon > 0$
as soon as $r$ is sufficiently large."
Why is this true?
My attempt:
We know that $$\lambda=\lim_{\rho \to \infty} \sup_{r \geq \rho}
\frac{\log \log M(r)}{\log r}. $$
From the definition of the limit we have that for any $\varepsilon>0$,
there exists some $\rho_0>0$, such that $$\left\lvert \sup_{r \geq \rho}
\frac{\log \log M(r)}{\log r}-\lambda \right\rvert \leq \varepsilon ,$$
for every $\rho \geq \rho_0$. In other words $$\frac{\log \log M(r)}{\log
r} \leq \lambda+\varepsilon $$ for every $r \geq \rho_0$. From here it is
easy to see that $$M(r)\leq e^{r^{\lambda+\varepsilon}}, $$ for all $r
\geq \rho_0$. I cannot see why $\lambda$ is the smallest number with this
property.
Thanks in advance.
How To bring text to front in html
How To bring text to front in html
I have website were the picture is over lapping the text but I want it the
other way around.
<p>my text</p>
<img href="picture.jpg">
I got it so there both in the same place but the picture is still on top
so far I've only tired flipping the order of the two lines of code but
that did nothing
I have website were the picture is over lapping the text but I want it the
other way around.
<p>my text</p>
<img href="picture.jpg">
I got it so there both in the same place but the picture is still on top
so far I've only tired flipping the order of the two lines of code but
that did nothing
Cancel execution of php code in included file
Cancel execution of php code in included file
I noticed that when you include a file with include 'file.anyextension';
and inside that file you have <?php ?> tags, that php code will be
executed. My question is:
How can I properly cancel execution of php code in file.anyextension?
My solution by now will be $file = str_replace('', '<?'), $file);
I'm on a local server now,Windows 8 64, uniServer Zero.
Edit:
I will let user to upload a file and include it in another php file.
That's my aplication. But I only wnat to allow them to execute html. I
noticed that if in a html file there are php tags that php code will be
executed. So I want to cancel execution of php code.
I noticed that when you include a file with include 'file.anyextension';
and inside that file you have <?php ?> tags, that php code will be
executed. My question is:
How can I properly cancel execution of php code in file.anyextension?
My solution by now will be $file = str_replace('', '<?'), $file);
I'm on a local server now,Windows 8 64, uniServer Zero.
Edit:
I will let user to upload a file and include it in another php file.
That's my aplication. But I only wnat to allow them to execute html. I
noticed that if in a html file there are php tags that php code will be
executed. So I want to cancel execution of php code.
Google Music Gapless Playback Works on my Galaxy Nexus but not my HTC One?
Google Music Gapless Playback Works on my Galaxy Nexus but not my HTC One?
I've recently started using Google Music on my phone but gapless playback
isn't working. I listen to a lot of mixed, electronic music albums where
it's absolutely essential that it's totally seamless with no gaps at all.
On my old Galaxy Nexus, with CyanogenMod 10.1 (Android 4.2.2), Google
Music version v5.1.1107K.753159, it works flawlessly.
On my new HTC One (stock), with Android 4.2.2 also, Google Music version
v5.1.1107K.753159 also, there's a very noticable gap (1 second or so).
Is there a way to enable gapless playback with Google Music on the HTC
One? Does anyone use Cyanogenmod on the HTC One? If so, could you confirm
if gapless playback works?
I've recently started using Google Music on my phone but gapless playback
isn't working. I listen to a lot of mixed, electronic music albums where
it's absolutely essential that it's totally seamless with no gaps at all.
On my old Galaxy Nexus, with CyanogenMod 10.1 (Android 4.2.2), Google
Music version v5.1.1107K.753159, it works flawlessly.
On my new HTC One (stock), with Android 4.2.2 also, Google Music version
v5.1.1107K.753159 also, there's a very noticable gap (1 second or so).
Is there a way to enable gapless playback with Google Music on the HTC
One? Does anyone use Cyanogenmod on the HTC One? If so, could you confirm
if gapless playback works?
Friday, 23 August 2013
redirect to another web page based on selection [on hold]
redirect to another web page based on selection [on hold]
I have 3 countries e.g. USA;INDIA;RUSSIA. I have their details (e.g.
POPULATION etc.) in for 3 months in HTML files like this:
USA0213.HTML; USA0313.HTML; ETC
INDIA0213.HTML; INDIA0313.HTML; ETC
RUSSIA0213.HTML; RUSSIA0313.HTML; ETC
How can I create a dropdown for the countries, month & year so that on
clicking the submit button I could open/navigate to the related HTML
files.
I have 3 countries e.g. USA;INDIA;RUSSIA. I have their details (e.g.
POPULATION etc.) in for 3 months in HTML files like this:
USA0213.HTML; USA0313.HTML; ETC
INDIA0213.HTML; INDIA0313.HTML; ETC
RUSSIA0213.HTML; RUSSIA0313.HTML; ETC
How can I create a dropdown for the countries, month & year so that on
clicking the submit button I could open/navigate to the related HTML
files.
How do I place attachments on the side of other objects?
How do I place attachments on the side of other objects?
I want to create a set of launch configurations to come together and
create a ship I can build in orbit. To do this, I want to be able to put
parts only on one face, like on the side of the orange fuel pod. I have
seen downloadable models with this, but I am pretty new to this. Can
someone explain how?
I want to create a set of launch configurations to come together and
create a ship I can build in orbit. To do this, I want to be able to put
parts only on one face, like on the side of the orange fuel pod. I have
seen downloadable models with this, but I am pretty new to this. Can
someone explain how?
Android Large Images issue
Android Large Images issue
I am using android:background to give a background image to android layout.
After putting some images I get this exception :
08-24 00:40:19.237: E/dalvikvm-heap(8533): Out of memory on a
36000016-byte allocation.
how can I use large images as backgrounds on android?
can I expand the application heap memory? or is it something not good to do ?
I am using android:background to give a background image to android layout.
After putting some images I get this exception :
08-24 00:40:19.237: E/dalvikvm-heap(8533): Out of memory on a
36000016-byte allocation.
how can I use large images as backgrounds on android?
can I expand the application heap memory? or is it something not good to do ?
How to disable button in WPF during validation
How to disable button in WPF during validation
i created WPF Validation form, in it i am taking name and password of
password. I want that "Login" Button should only enabled when both
password and username has entered correctly. I wrote this code below but
it only works for name field and when capslock is set to oN for password.
Here code is:
<Grid x:Name="validationContainer"
dxe:ValidationService.IsValidationContainer="True">
<dxe:PasswordBoxEdit HorizontalAlignment="Left"
Height="25" Width="173" ValidateOnTextInput="True"
VerticalAlignment="Top" ShowCapsLockWarningToolTip="True"
Name="passBox" Validate="passBox_Validate"
Margin="138,95,0,0" NullText="Enter Password Here">
<dxe:PasswordBoxEdit.CapsLockWarningToolTipTemplate>
<DataTemplate>
<TextBlock Text="Caps-Lock is Off"
Foreground="Red"/>
</DataTemplate>
</dxe:PasswordBoxEdit.CapsLockWarningToolTipTemplate>
</dxe:PasswordBoxEdit>
<TextBlock HorizontalAlignment="Left" Margin="57,133,0,0"
TextWrapping="Wrap" Text="Password strength: "
VerticalAlignment="Top" Name="textBlock"/>
<dxe:TextEdit x:Name="dxTextEdit" Height="25" Width="173"
ValidateOnTextInput="True" HorizontalAlignment="Left"
VerticalAlignment="Top"
Validate="dxTextEdit_Validate" NullText="Enter Name Here"
MaskType="RegEx" Mask="[a-zA-Z]+" MaskIgnoreBlank="True"
Margin="138,58,81,175" >
</dxe:TextEdit>
<Label Content="User Name" HorizontalAlignment="Left"
Margin="64,57,0,0" VerticalAlignment="Top"/>
<Label Content="Password" HorizontalAlignment="Left"
Margin="64,94,0,0" VerticalAlignment="Top"/>
<Button Content="Login" MinWidth="100" HorizontalAlignment="Right"
Margin="0,229,287,0" Width="105" Click="Button_Click_1">
<Button.IsEnabled>
<Binding Path="(dxe:ValidationService.HasValidationError)"
ElementName="validationContainer">
<Binding.Converter>
<dx:NegationConverterExtension />
</Binding.Converter>
</Binding>
</Button.IsEnabled>
</Button>
Need your suggestion. Thank you! NOTE:I am using Devexpress and WPF
i created WPF Validation form, in it i am taking name and password of
password. I want that "Login" Button should only enabled when both
password and username has entered correctly. I wrote this code below but
it only works for name field and when capslock is set to oN for password.
Here code is:
<Grid x:Name="validationContainer"
dxe:ValidationService.IsValidationContainer="True">
<dxe:PasswordBoxEdit HorizontalAlignment="Left"
Height="25" Width="173" ValidateOnTextInput="True"
VerticalAlignment="Top" ShowCapsLockWarningToolTip="True"
Name="passBox" Validate="passBox_Validate"
Margin="138,95,0,0" NullText="Enter Password Here">
<dxe:PasswordBoxEdit.CapsLockWarningToolTipTemplate>
<DataTemplate>
<TextBlock Text="Caps-Lock is Off"
Foreground="Red"/>
</DataTemplate>
</dxe:PasswordBoxEdit.CapsLockWarningToolTipTemplate>
</dxe:PasswordBoxEdit>
<TextBlock HorizontalAlignment="Left" Margin="57,133,0,0"
TextWrapping="Wrap" Text="Password strength: "
VerticalAlignment="Top" Name="textBlock"/>
<dxe:TextEdit x:Name="dxTextEdit" Height="25" Width="173"
ValidateOnTextInput="True" HorizontalAlignment="Left"
VerticalAlignment="Top"
Validate="dxTextEdit_Validate" NullText="Enter Name Here"
MaskType="RegEx" Mask="[a-zA-Z]+" MaskIgnoreBlank="True"
Margin="138,58,81,175" >
</dxe:TextEdit>
<Label Content="User Name" HorizontalAlignment="Left"
Margin="64,57,0,0" VerticalAlignment="Top"/>
<Label Content="Password" HorizontalAlignment="Left"
Margin="64,94,0,0" VerticalAlignment="Top"/>
<Button Content="Login" MinWidth="100" HorizontalAlignment="Right"
Margin="0,229,287,0" Width="105" Click="Button_Click_1">
<Button.IsEnabled>
<Binding Path="(dxe:ValidationService.HasValidationError)"
ElementName="validationContainer">
<Binding.Converter>
<dx:NegationConverterExtension />
</Binding.Converter>
</Binding>
</Button.IsEnabled>
</Button>
Need your suggestion. Thank you! NOTE:I am using Devexpress and WPF
Application can reject by native css from Apple?
Application can reject by native css from Apple?
My client's application is rejected by apple which i developed he sent me
not enough information but he just sent me reference number on apple
review guide line 2.5 which says "Apps that use non-public APIs will be
rejected", I checked external APIs on my project but all of them public
except Native CSS which I don't have idea that whether apple accept this
or not. My application not very large its little project. I also asked to
client to send me detail info so that i can sniff in better way. IF any
one idea about native css please guide me. Thanks
My client's application is rejected by apple which i developed he sent me
not enough information but he just sent me reference number on apple
review guide line 2.5 which says "Apps that use non-public APIs will be
rejected", I checked external APIs on my project but all of them public
except Native CSS which I don't have idea that whether apple accept this
or not. My application not very large its little project. I also asked to
client to send me detail info so that i can sniff in better way. IF any
one idea about native css please guide me. Thanks
Export all contacts to VCF (vcard) file widnows phone
Export all contacts to VCF (vcard) file widnows phone
I want to export phone book contacts to single VCF file. I'm new to VCF file.
I can't find any API or code to generate VCF file in Windows Phone.
Thanks
I want to export phone book contacts to single VCF file. I'm new to VCF file.
I can't find any API or code to generate VCF file in Windows Phone.
Thanks
Thursday, 22 August 2013
Repeat multiple lines in an ArrayList and add them in order back to the same ArrayList
Repeat multiple lines in an ArrayList and add them in order back to the
same ArrayList
I have an arraylist that have the following strings:
02, String1
03, Num1
03, Num2
02, String2
based on an input from another method I need to repeat the strings that
start with 03 number of times and then add it back to the same arraylist
number of times = 4 output:
02, String1
03, Num1
03, Num2
03, Num1
03, Num2
03, Num1
03, Num2
03, Num1
03, Num2
02, String2
please any help,
Thanks in advance.
same ArrayList
I have an arraylist that have the following strings:
02, String1
03, Num1
03, Num2
02, String2
based on an input from another method I need to repeat the strings that
start with 03 number of times and then add it back to the same arraylist
number of times = 4 output:
02, String1
03, Num1
03, Num2
03, Num1
03, Num2
03, Num1
03, Num2
03, Num1
03, Num2
02, String2
please any help,
Thanks in advance.
DISTRIBUTE THIS POST TO OTHERS IF YOU WANT THE PLANET TO FLIP
DISTRIBUTE THIS POST TO OTHERS IF YOU WANT THE PLANET TO FLIP
pYou are about to be provided with information tobr start your own
Google./p pSome people posted comments and said this can notbr be done
because google has 1 million servers and we do not./p pThe truth is,
google has those many servers for trollingbr purposes (e.g. google +,
google finance, youtube the bandwidth consumingbr no-profit making web
site, etc )./p pall for trolling purposes./p pif you wanted to start your
own search engine...br you need to know few things./p p1 : you need to
know how beautiful mysql is.br 2: you need to not listen to people that
tell you to use a frameworkbr with python, and simply use mod-wsgi. br 3:
you need to cache popular searches when your search engine is running.br
3: you need to connect numbers to words. maybe even something like..br
numbers to numbers to words./p pin other words let's say in the past 24
hours people searched forbr some phrases over and over again.. you cache
those and assign numbersbr to them, this way you are matching numbers with
numbers in mysql.br not words with words./p pin other words let's say
google uses 1/2 their servers for trollingbr and 1/2 for search engine./p
pwe need technology and ideas so that you can run a search enginebr on 1
or 2 dedicated servers that cost no more than $100/month each./p ponce you
make money, you can begin buying more and more servers.br after you make
lots of money.. you probably gonna turn into a trollbr too like google
inc./p pbecause god is brutal.br god is void-statebr it keeps singing you
songs when you are sleeping and saysbr nothing matters, there is simply no
meaning/p pbut of course to start this search engine, you need a jump
start.br if you notice google constantly links to other web sites with abr
trackable way when people click on search results./p pthis means google
knows which web sites are becoming popularbr are popular, etc. they can
see what is rising before it rises.br it's like being able to see the
future./p pthe computer tells them you better get in touch with this guybr
before he becomes rich and becomes un-stopable /p psometimes they send
cops onto people. etc./p h1AMAZON INC however..br/h1 pwill provide you
with the top 1 million web sites in the world.br updated daily in a cvs
file. br downloadable at alexa.com/p psimply click on 'top sites' and then
you will see the downloadablebr file on the right side./p peveryday they
update it. and it is being given away for free.br google would never do
this.br amazon does this./p pthis list you can use to ensure you show the
top sites first in yourbr search engine ./p pthis makes your search engine
look 'credible'/p pin other words as you start making money, you first
display thingsbr in a Generic way but at the same time not in a
questionable waybr by displaying them based on rank/p pof course amazon
only gives you URLS of the web sites.br you need to grab the title and etc
from the web sites./p pthe truth is, to get started you do not need
everything from web sites.br a title and some tags is all you need./p
psimple.br basic.br functionalbr will get peoples attention./p pi always
ask questions on SO but most questions get deleted. here'sbr something
that did not get deleted.. /p pa
href=http://stackoverflow.com/questions/17765805/how-do-i-ensure-that-re-findall-stops-at-the-right-placeHow
do I ensure that re.findall() stops at the right place?/a/p puse python,
skrew php, php is no good.br do not use python frameworks, it's all lies
and b.s. use mod-wsgibr use memcache to cache the templates and thus no
need for a template engine.br/p palways look at russian dedicated servers,
and so on.br do not put your trust in america.br it has all turned into a
mafia.br/p pgoogle can file a report, fbi can send cops onto you, and next
thing you knowbr they frame you as a criminal, thug, mentally ill,
bipolar, peadophile, and so on./p pall you can do is bleed to death behind
bars./p pdo not give into the lies of AMERICA.br find russian dedicated
servers./p pi tried signing up with pw-service.com but i couldn't do it
due tobr restrictions with their russian payment systems and so on../p
pagain, amazon's web site alexa.com provides you with downloadablebr top 1
mil web sites in the form of a cvs file. /p puse it./p pagain, do not give
into python programmers suggesting frameworks for python.br it's all b.s.
use mod_wsgi with memcache./p pagain, american corporations can ruin you
with lies and all you can do isbr bleed to death behind bars/p pagain, a
basic search engine needs : url, title, tags, and popular searchesbr can
be cached and words can be connected to numbers within the mysql./p pmysql
has capabilities to cache things as well./p pcache once, cache twice, and
you will not need 1 million servers in order to troll./p pif you need some
xdotool commands to deal with people calling you a trollbr here it is;/p
precodexdotool key ctrl+c xdotool key Tab Tab Tab Return xdotool type '@'
xdotool key ctrl+v xdotool type --clearmodifiers ', there can not be such
thing as a `troll` unless compared to a stationary point, if you are
complaining, you are not stationary. which means you are the one that is
trolling.' xdotool key Tab Return /code/pre pcreate an application
launcher on your gnome-panel, and then select the username in the comments
section that called you a 'troll' and click the shortcut on the
gnome-panel./p pit will copy the selected username to the clipboard and
then hit TAB TAB TAB RETURN/p pwhich opens the comment typing box. and
then it will type @ + username + comma, and then the rest.
....................................................................................................................................................................../p
pYou are about to be provided with information tobr start your own
Google./p pSome people posted comments and said this can notbr be done
because google has 1 million servers and we do not./p pThe truth is,
google has those many servers for trollingbr purposes (e.g. google +,
google finance, youtube the bandwidth consumingbr no-profit making web
site, etc )./p pall for trolling purposes./p pif you wanted to start your
own search engine...br you need to know few things./p p1 : you need to
know how beautiful mysql is.br 2: you need to not listen to people that
tell you to use a frameworkbr with python, and simply use mod-wsgi. br 3:
you need to cache popular searches when your search engine is running.br
3: you need to connect numbers to words. maybe even something like..br
numbers to numbers to words./p pin other words let's say in the past 24
hours people searched forbr some phrases over and over again.. you cache
those and assign numbersbr to them, this way you are matching numbers with
numbers in mysql.br not words with words./p pin other words let's say
google uses 1/2 their servers for trollingbr and 1/2 for search engine./p
pwe need technology and ideas so that you can run a search enginebr on 1
or 2 dedicated servers that cost no more than $100/month each./p ponce you
make money, you can begin buying more and more servers.br after you make
lots of money.. you probably gonna turn into a trollbr too like google
inc./p pbecause god is brutal.br god is void-statebr it keeps singing you
songs when you are sleeping and saysbr nothing matters, there is simply no
meaning/p pbut of course to start this search engine, you need a jump
start.br if you notice google constantly links to other web sites with abr
trackable way when people click on search results./p pthis means google
knows which web sites are becoming popularbr are popular, etc. they can
see what is rising before it rises.br it's like being able to see the
future./p pthe computer tells them you better get in touch with this guybr
before he becomes rich and becomes un-stopable /p psometimes they send
cops onto people. etc./p h1AMAZON INC however..br/h1 pwill provide you
with the top 1 million web sites in the world.br updated daily in a cvs
file. br downloadable at alexa.com/p psimply click on 'top sites' and then
you will see the downloadablebr file on the right side./p peveryday they
update it. and it is being given away for free.br google would never do
this.br amazon does this./p pthis list you can use to ensure you show the
top sites first in yourbr search engine ./p pthis makes your search engine
look 'credible'/p pin other words as you start making money, you first
display thingsbr in a Generic way but at the same time not in a
questionable waybr by displaying them based on rank/p pof course amazon
only gives you URLS of the web sites.br you need to grab the title and etc
from the web sites./p pthe truth is, to get started you do not need
everything from web sites.br a title and some tags is all you need./p
psimple.br basic.br functionalbr will get peoples attention./p pi always
ask questions on SO but most questions get deleted. here'sbr something
that did not get deleted.. /p pa
href=http://stackoverflow.com/questions/17765805/how-do-i-ensure-that-re-findall-stops-at-the-right-placeHow
do I ensure that re.findall() stops at the right place?/a/p puse python,
skrew php, php is no good.br do not use python frameworks, it's all lies
and b.s. use mod-wsgibr use memcache to cache the templates and thus no
need for a template engine.br/p palways look at russian dedicated servers,
and so on.br do not put your trust in america.br it has all turned into a
mafia.br/p pgoogle can file a report, fbi can send cops onto you, and next
thing you knowbr they frame you as a criminal, thug, mentally ill,
bipolar, peadophile, and so on./p pall you can do is bleed to death behind
bars./p pdo not give into the lies of AMERICA.br find russian dedicated
servers./p pi tried signing up with pw-service.com but i couldn't do it
due tobr restrictions with their russian payment systems and so on../p
pagain, amazon's web site alexa.com provides you with downloadablebr top 1
mil web sites in the form of a cvs file. /p puse it./p pagain, do not give
into python programmers suggesting frameworks for python.br it's all b.s.
use mod_wsgi with memcache./p pagain, american corporations can ruin you
with lies and all you can do isbr bleed to death behind bars/p pagain, a
basic search engine needs : url, title, tags, and popular searchesbr can
be cached and words can be connected to numbers within the mysql./p pmysql
has capabilities to cache things as well./p pcache once, cache twice, and
you will not need 1 million servers in order to troll./p pif you need some
xdotool commands to deal with people calling you a trollbr here it is;/p
precodexdotool key ctrl+c xdotool key Tab Tab Tab Return xdotool type '@'
xdotool key ctrl+v xdotool type --clearmodifiers ', there can not be such
thing as a `troll` unless compared to a stationary point, if you are
complaining, you are not stationary. which means you are the one that is
trolling.' xdotool key Tab Return /code/pre pcreate an application
launcher on your gnome-panel, and then select the username in the comments
section that called you a 'troll' and click the shortcut on the
gnome-panel./p pit will copy the selected username to the clipboard and
then hit TAB TAB TAB RETURN/p pwhich opens the comment typing box. and
then it will type @ + username + comma, and then the rest.
....................................................................................................................................................................../p
Adfly URL shortener
Adfly URL shortener
I've received been playing with Adfly, and I've hooked up my own domain,
and I want to have it hosting shortened URLs.
I wish to create a website that you type in a URL (google{dot}com) and
it'd automatically add this to the suffix of URL of the API code, so it'd
turn
hxxp://api.adf.ly/api.php?key={KEY}&uid={ID}&advert_type=int&domain=adf.ly&url=
to:
hxxp://api.adf.ly/api.php?key={KEY}&uid={ID}&advert_type=int&domain=adf.ly&url=google.com
I'd really love it using HTML or PHP
I'd also really like if it was on the same page, not going to a new page.
Nothing too fancy, but this is what I'd hope it'd look like. this Then
it'd change it too: this
~
Thanks in advance.
I've received been playing with Adfly, and I've hooked up my own domain,
and I want to have it hosting shortened URLs.
I wish to create a website that you type in a URL (google{dot}com) and
it'd automatically add this to the suffix of URL of the API code, so it'd
turn
hxxp://api.adf.ly/api.php?key={KEY}&uid={ID}&advert_type=int&domain=adf.ly&url=
to:
hxxp://api.adf.ly/api.php?key={KEY}&uid={ID}&advert_type=int&domain=adf.ly&url=google.com
I'd really love it using HTML or PHP
I'd also really like if it was on the same page, not going to a new page.
Nothing too fancy, but this is what I'd hope it'd look like. this Then
it'd change it too: this
~
Thanks in advance.
how to separate js, html and php files
how to separate js, html and php files
I need help. When I throw the javascript code from the create_table.php
file then does not work delete row in the table. How to separate this
files?, can someone help me make this work? What's wrong? Thx.
index_table.html
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Table</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="script.js"></script>
</head>
<body>
<div id="write_table"></div><br /><br />
</body>
</html>
script.js
$(document).ready(function(){
$.ajax({
url:"create_table.php",
cache: false,
success: function(data){
$("#write_table").html(data);
}});
});
create_table.php
<script type='text/javascript'>
$(document).ready(function(){
$('button.delete').click(function(e){
var parent = $(this).closest('tr');
$.ajax({
cache: false,
data: parent,
success: function(){
parent.fadeOut('fast', function(){
parent.remove();
});
}
});
});
});
</script>
<?php
ini_set('display_errors', true);
error_reporting(E_ALL + E_NOTICE);
$tabela = new Tabela();
$header;
$data= array (
array ("row_1", "row_1", "row_1", null),
array ("row_2", "row_2", "row_2", "row_2"),
array ("row_3", "row_3", "row_3", "row_3"),
array ("row_4", "row_4", "row_4", "row_4")
);
$header = array("col_1","col_2","col_3","col_4");
$tablica1 = $tabela->NapraviTabelu($header, $data, true, true, true);
echo $tablica1;
class Tabela {
function __construct() {
}
public function NapraviTabelu($header, $data, $add=true, $edit=true,
$delete=true){
$tablica1 = "<table border='3' id='tablicaId'><thead><tr>";
foreach ($header as $head){
$tablica1 = $tablica1."<th width='120px'>$head</th>";
}
if($edit || $delete){
$tablica1 .= "<th height='44px'>/*******/</th>";
}
$tablica1 .="</tr></thead>";
if (isset($data)){
foreach($data as $row){
$tablica1 .="<tr>";
foreach($row as $column){
if ($column !=''){
$tablica1 .= "<td height='44px'>$column</td>";
}
else {$tablica1 .="<td></td>";}
}
if($edit || $delete)
$tablica1 .= "<td align='right'>";
if($edit){$tablica1 .= "<button title='Edit' type='submit'><img
src='Update.png'/> </button>";}
if($delete){$tablica1 .= "<button name='cmdEdit' class='delete'
title='Delete' type='submit'><img src='Remove.png'/></button>";}
$tablica1 .= "</td></tr>";
}
return $tablica1 ."</table>";
}
}
}
?>
I need help. When I throw the javascript code from the create_table.php
file then does not work delete row in the table. How to separate this
files?, can someone help me make this work? What's wrong? Thx.
index_table.html
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Table</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="script.js"></script>
</head>
<body>
<div id="write_table"></div><br /><br />
</body>
</html>
script.js
$(document).ready(function(){
$.ajax({
url:"create_table.php",
cache: false,
success: function(data){
$("#write_table").html(data);
}});
});
create_table.php
<script type='text/javascript'>
$(document).ready(function(){
$('button.delete').click(function(e){
var parent = $(this).closest('tr');
$.ajax({
cache: false,
data: parent,
success: function(){
parent.fadeOut('fast', function(){
parent.remove();
});
}
});
});
});
</script>
<?php
ini_set('display_errors', true);
error_reporting(E_ALL + E_NOTICE);
$tabela = new Tabela();
$header;
$data= array (
array ("row_1", "row_1", "row_1", null),
array ("row_2", "row_2", "row_2", "row_2"),
array ("row_3", "row_3", "row_3", "row_3"),
array ("row_4", "row_4", "row_4", "row_4")
);
$header = array("col_1","col_2","col_3","col_4");
$tablica1 = $tabela->NapraviTabelu($header, $data, true, true, true);
echo $tablica1;
class Tabela {
function __construct() {
}
public function NapraviTabelu($header, $data, $add=true, $edit=true,
$delete=true){
$tablica1 = "<table border='3' id='tablicaId'><thead><tr>";
foreach ($header as $head){
$tablica1 = $tablica1."<th width='120px'>$head</th>";
}
if($edit || $delete){
$tablica1 .= "<th height='44px'>/*******/</th>";
}
$tablica1 .="</tr></thead>";
if (isset($data)){
foreach($data as $row){
$tablica1 .="<tr>";
foreach($row as $column){
if ($column !=''){
$tablica1 .= "<td height='44px'>$column</td>";
}
else {$tablica1 .="<td></td>";}
}
if($edit || $delete)
$tablica1 .= "<td align='right'>";
if($edit){$tablica1 .= "<button title='Edit' type='submit'><img
src='Update.png'/> </button>";}
if($delete){$tablica1 .= "<button name='cmdEdit' class='delete'
title='Delete' type='submit'><img src='Remove.png'/></button>";}
$tablica1 .= "</td></tr>";
}
return $tablica1 ."</table>";
}
}
}
?>
getting PDFParseException: Data format exception:incorrect data check
getting PDFParseException: Data format exception:incorrect data check
I am new to Itext. I am writing an application to create a image by
parsing a pdf file. my code is:
PdfReader reader = new PdfReader(TTFpath + "/image.pdf");
File directory = new File(uploadedpath);
File previewFile = File.createTempFile("sarath"+ imageType, ".pdf",
directory);
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(previewFile));
PdfContentByte pdfcb = stamper.getOverContent(1);
BaseFont basef = BaseFont.createFont(TTFpath + "/" + fileName,
BaseFont.WINANSI, BaseFont.EMBEDDED);
pdfcb.beginText();
pdfcb.setFontAndSize(basef, fontSize);
float floatWidth = pdfcb.getEffectiveStringWidth(userName, true);
RandomAccessFile raf= new RandomAccessFile(file, "r");
FileChannel channel = raf.getChannel();
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0,
channel.size());
PDFFile pdffile = new PDFFile(buf);
PDFPage page = pdffile.getPage(0);
Exactly after last line of code i am getting exception like "GetPage inner
loop: com.sun.pdfview.PDFParseException: Data format exception:incorrect
data check". What may be cause?
I am new to Itext. I am writing an application to create a image by
parsing a pdf file. my code is:
PdfReader reader = new PdfReader(TTFpath + "/image.pdf");
File directory = new File(uploadedpath);
File previewFile = File.createTempFile("sarath"+ imageType, ".pdf",
directory);
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(previewFile));
PdfContentByte pdfcb = stamper.getOverContent(1);
BaseFont basef = BaseFont.createFont(TTFpath + "/" + fileName,
BaseFont.WINANSI, BaseFont.EMBEDDED);
pdfcb.beginText();
pdfcb.setFontAndSize(basef, fontSize);
float floatWidth = pdfcb.getEffectiveStringWidth(userName, true);
RandomAccessFile raf= new RandomAccessFile(file, "r");
FileChannel channel = raf.getChannel();
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0,
channel.size());
PDFFile pdffile = new PDFFile(buf);
PDFPage page = pdffile.getPage(0);
Exactly after last line of code i am getting exception like "GetPage inner
loop: com.sun.pdfview.PDFParseException: Data format exception:incorrect
data check". What may be cause?
Wednesday, 21 August 2013
How to add hyper link text to textconsoleviewer?
How to add hyper link text to textconsoleviewer?
In my application i have a dialog where i am putting a text console
viewer.On text console viewer there is some text .Can i make some of the
text as hyperlink.Any pointer on this is appreciated.
CODE:
console = new MessageConsole("Try", null, false);
outputStream = console.newMessageStream();
Composite viewerParent = new Composite(container, SWT.NONE);
GridLayout layout2 = new GridLayout();
layout2.marginBottom = layout2.marginHeight =
layout2.marginLeft = layout2.marginRight = layout2.marginTop =
layout2.marginWidth = 1;
viewerParent.setLayout(layout2);
viewerParent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
true, true));
viewer = new TextConsoleViewer(viewerParent, console);
viewer.setEditable(false);
viewer.getControl().setLayoutData(new GridData(SWT.FILL,
SWT.FILL, true, true));
In my application i have a dialog where i am putting a text console
viewer.On text console viewer there is some text .Can i make some of the
text as hyperlink.Any pointer on this is appreciated.
CODE:
console = new MessageConsole("Try", null, false);
outputStream = console.newMessageStream();
Composite viewerParent = new Composite(container, SWT.NONE);
GridLayout layout2 = new GridLayout();
layout2.marginBottom = layout2.marginHeight =
layout2.marginLeft = layout2.marginRight = layout2.marginTop =
layout2.marginWidth = 1;
viewerParent.setLayout(layout2);
viewerParent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
true, true));
viewer = new TextConsoleViewer(viewerParent, console);
viewer.setEditable(false);
viewer.getControl().setLayoutData(new GridData(SWT.FILL,
SWT.FILL, true, true));
"Ant debug" output always shows no changes. How can I force apkbuilder to build APK?
"Ant debug" output always shows no changes. How can I force apkbuilder to
build APK?
When I type "ant debug" on Jenkins, I always get message like :
[aapt] No changed resources. R.java and Manifest.java untouched.
[dex] No new compiled code. No need to convert bytecode to dalvik format.
[aapt] No changed resources or assets.
[apkbuilder] No changes. No need to create apk.
The same command from my local computer against the same code from Eclipse
does not output the messages above. And it always finds modified input and
creates an apk with debug key correctly from command-line. My goal is to
create an APK with debug key on Jenkins also.
Any idea why "ant debug" is showing the output as following? Is there a
way to force apkbuilder to create an apk?
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
-post-compile:
-obfuscate:
-dex:
[dex] input:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/classes
[dex] input:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/libs/Robotium.jar
[dex] Using Pre-Dexed Robotium-764572c80737d765208bdb367579ac89.jar
<-
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/libs/Robotium.jar
[dex] No new compiled code. No need to convert bytecode to dalvik
format.
-crunch:
[crunch] Crunching PNG Files in source dir:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/res
[crunch] To destination dir:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] No changed resources or assets. Settings_Tests_New.ap_ remains
untouched
-package:
[apkbuilder] No changes. No need to create apk.
-post-package:
-do-debug:
[zipalign] Run cancelled: no changes to input file
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/Settings_Tests_New-debug-unaligned.apk
[echo] Debug Package:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/Settings_Tests_New-debug.apk
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
-post-build:
debug:
BUILD SUCCESSFUL
build APK?
When I type "ant debug" on Jenkins, I always get message like :
[aapt] No changed resources. R.java and Manifest.java untouched.
[dex] No new compiled code. No need to convert bytecode to dalvik format.
[aapt] No changed resources or assets.
[apkbuilder] No changes. No need to create apk.
The same command from my local computer against the same code from Eclipse
does not output the messages above. And it always finds modified input and
creates an apk with debug key correctly from command-line. My goal is to
create an APK with debug key on Jenkins also.
Any idea why "ant debug" is showing the output as following? Is there a
way to force apkbuilder to create an apk?
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
-post-compile:
-obfuscate:
-dex:
[dex] input:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/classes
[dex] input:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/libs/Robotium.jar
[dex] Using Pre-Dexed Robotium-764572c80737d765208bdb367579ac89.jar
<-
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/libs/Robotium.jar
[dex] No new compiled code. No need to convert bytecode to dalvik
format.
-crunch:
[crunch] Crunching PNG Files in source dir:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/res
[crunch] To destination dir:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] No changed resources or assets. Settings_Tests_New.ap_ remains
untouched
-package:
[apkbuilder] No changes. No need to create apk.
-post-package:
-do-debug:
[zipalign] Run cancelled: no changes to input file
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/Settings_Tests_New-debug-unaligned.apk
[echo] Debug Package:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/Settings_Tests_New-debug.apk
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
[propertyfile] Updating property file:
/Users/buildmaster/.jenkins/workspace/my-ci-job-name/bin/build.prop
-post-build:
debug:
BUILD SUCCESSFUL
Freezing UI with async/await
Freezing UI with async/await
I have some code running that will freeze up if you grab and move the
window while it is loading. I'm not sure what the problem is but thought I
would post my code since I am fairly new at working with async/await and
just wondering if there is some problem with my logic. I'm not saying this
is causing the problem, I've just searched and seen other problems that
with UI freezing up and async/await comes up often. Any help would be
appreciated.
private async void BuildChart()
{
DateTime date = DateTime.Today;
using (Database db = new Database())
{
await BuildActual(date, db);
await BuildActual(date.AddDays(1),db);
}
}
private async Task BuildActual(DateTime date, Database db)
{
List<TimeSeries> actualValues = await
Task<List<TimeSeries>>.Factory.StartNew(() =>
{
try
{
var wind = DoStuff(date, db);
if (wind == null) return null;
if (wind.Count == 0) return null;
return MakeTimeSeries(wind);
}
catch
{
return null;
}
});
try
{
if (actualValues == null) return;
DoMoreStuff(actualValues);
}
catch (Exception ex)
{
Logger.Log(ex);
}
}
Thanks.
I have some code running that will freeze up if you grab and move the
window while it is loading. I'm not sure what the problem is but thought I
would post my code since I am fairly new at working with async/await and
just wondering if there is some problem with my logic. I'm not saying this
is causing the problem, I've just searched and seen other problems that
with UI freezing up and async/await comes up often. Any help would be
appreciated.
private async void BuildChart()
{
DateTime date = DateTime.Today;
using (Database db = new Database())
{
await BuildActual(date, db);
await BuildActual(date.AddDays(1),db);
}
}
private async Task BuildActual(DateTime date, Database db)
{
List<TimeSeries> actualValues = await
Task<List<TimeSeries>>.Factory.StartNew(() =>
{
try
{
var wind = DoStuff(date, db);
if (wind == null) return null;
if (wind.Count == 0) return null;
return MakeTimeSeries(wind);
}
catch
{
return null;
}
});
try
{
if (actualValues == null) return;
DoMoreStuff(actualValues);
}
catch (Exception ex)
{
Logger.Log(ex);
}
}
Thanks.
Can't get textview and \n to work
Can't get textview and \n to work
Posting this on behalf of a friend, I don't have the android SDK to test
this so apologies if it's super obvious:
Trying to update a TextView with a timestamp on a new line:
viewText = viewText + "\n"+ String.format("%d:%02d:%02d", minutes,
seconds,millis);
But no matter what seems to always end up on the same line.
Code below:
package com.example.polyrhythm;
import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity implements OnClickListener {
TextView showResults, countDown;
long start, stop;
String sResults = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button bStart = (Button) findViewById(R.id.startButton);
Button bStop = (Button) findViewById(R.id.rhythmOne);
showResults = (TextView) findViewById(R.id.resultTextView);
// countDown = (TextView) findViewById(R.id.countDownTextView);
showResults.setSingleLine(false);
bStart.setOnClickListener(this);
bStop.setOnClickListener(this);
start = 0;
}
@Override
public void onClick(View arg0) {
switch (arg0.getId()) {
case R.id.startButton:
new CountDownTimer(5000, 1000) {
public void onTick(long millisUntilFinished) {
// countDown.setText("" + millisUntilFinished / 1000);
}
public void onFinish() {
// countDown.setVisibility(View.GONE);
start = System.currentTimeMillis();
}
}.start();
break;
case R.id.rhythmOne:
stop = System.currentTimeMillis();
if (start != 0) {
String viewText = "";
long result = stop - start;
int millis = (int) result;
int seconds = (int) result / 1000;
int minutes = seconds / 60;
millis = millis % 100;
seconds = seconds % 60;
viewText = viewText
+ "\n"
+ String.format("%d:%02d:%02d", minutes, seconds,
millis);
showResults.setText(viewText);
}
break;
}
}
}
Posting this on behalf of a friend, I don't have the android SDK to test
this so apologies if it's super obvious:
Trying to update a TextView with a timestamp on a new line:
viewText = viewText + "\n"+ String.format("%d:%02d:%02d", minutes,
seconds,millis);
But no matter what seems to always end up on the same line.
Code below:
package com.example.polyrhythm;
import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity implements OnClickListener {
TextView showResults, countDown;
long start, stop;
String sResults = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button bStart = (Button) findViewById(R.id.startButton);
Button bStop = (Button) findViewById(R.id.rhythmOne);
showResults = (TextView) findViewById(R.id.resultTextView);
// countDown = (TextView) findViewById(R.id.countDownTextView);
showResults.setSingleLine(false);
bStart.setOnClickListener(this);
bStop.setOnClickListener(this);
start = 0;
}
@Override
public void onClick(View arg0) {
switch (arg0.getId()) {
case R.id.startButton:
new CountDownTimer(5000, 1000) {
public void onTick(long millisUntilFinished) {
// countDown.setText("" + millisUntilFinished / 1000);
}
public void onFinish() {
// countDown.setVisibility(View.GONE);
start = System.currentTimeMillis();
}
}.start();
break;
case R.id.rhythmOne:
stop = System.currentTimeMillis();
if (start != 0) {
String viewText = "";
long result = stop - start;
int millis = (int) result;
int seconds = (int) result / 1000;
int minutes = seconds / 60;
millis = millis % 100;
seconds = seconds % 60;
viewText = viewText
+ "\n"
+ String.format("%d:%02d:%02d", minutes, seconds,
millis);
showResults.setText(viewText);
}
break;
}
}
}
C# Trim/Replace the char '\"' from a string
C# Trim/Replace the char '\"' from a string
I need to use a string for path for a file but sometimes there are
forbidden characters in this string and I must replace them. For example,
my string _title is "rumbaton jonathan \"racko\" contreras".
Well I should replace the chars '\' and '"'.
I tried this but it doesn't work :
_title.Replace(@"/", "");
_title.Replace(@"\", "");
_title.Replace(@"*", "");
_title.Replace(@"?", "");
_title.Replace(@"<", "");
_title.Replace(@">", "");
_title.Replace(@"|", "");
Thank you so much,
Veriditas !
I need to use a string for path for a file but sometimes there are
forbidden characters in this string and I must replace them. For example,
my string _title is "rumbaton jonathan \"racko\" contreras".
Well I should replace the chars '\' and '"'.
I tried this but it doesn't work :
_title.Replace(@"/", "");
_title.Replace(@"\", "");
_title.Replace(@"*", "");
_title.Replace(@"?", "");
_title.Replace(@"<", "");
_title.Replace(@">", "");
_title.Replace(@"|", "");
Thank you so much,
Veriditas !
Getting element's height after adding elements
Getting element's height after adding elements
I am getting this div's .height(), after appending elements to a div (
which height is set to auto ),
The problem is that the DOM doesn't seem to update the div's height before
I am getting it.
Is there some event I could listen for?
I am getting this div's .height(), after appending elements to a div (
which height is set to auto ),
The problem is that the DOM doesn't seem to update the div's height before
I am getting it.
Is there some event I could listen for?
Display results then give option to export to .csv?
Display results then give option to export to .csv?
I have a table on my site that is generated using PHP and a mysql DB. I
would like to have the table displayed with an option below to export the
results to a .csv file.
I was trying to setup a button/link at the bottom that would run the below
php file. However it just exports the entire HTML code into the .csv file
... could someone help me out ?
I run the query then -->
$num_fields = $result->field_count;
$headers = array();
// Creating headers for output files
for ($i = 0; $i < $num_fields; $i++)
{
$headers[] = $result->fetch_fields();
}
$fp = fopen('php://output', 'w');
if ($fp && $result)
{
// name of file with date
$filename = "AccessReport-".date('Y-m-d').".csv";
// Setting header types for csv file.
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename='.$filename);
header('Pragma: no-cache');
header('Expires: 0');
fputcsv($fp, $headers);
while ($row = $result->fetch_assoc())
{
fputcsv($fp, $row);
}
}
$result->close();
I have a table on my site that is generated using PHP and a mysql DB. I
would like to have the table displayed with an option below to export the
results to a .csv file.
I was trying to setup a button/link at the bottom that would run the below
php file. However it just exports the entire HTML code into the .csv file
... could someone help me out ?
I run the query then -->
$num_fields = $result->field_count;
$headers = array();
// Creating headers for output files
for ($i = 0; $i < $num_fields; $i++)
{
$headers[] = $result->fetch_fields();
}
$fp = fopen('php://output', 'w');
if ($fp && $result)
{
// name of file with date
$filename = "AccessReport-".date('Y-m-d').".csv";
// Setting header types for csv file.
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename='.$filename);
header('Pragma: no-cache');
header('Expires: 0');
fputcsv($fp, $headers);
while ($row = $result->fetch_assoc())
{
fputcsv($fp, $row);
}
}
$result->close();
Tuesday, 20 August 2013
Field Extension Notation
Field Extension Notation
I've seen similar questions asked here, but I've not been able to find a
comprehensive answer.
I know that for a ring $R$, $R[X]$ denotes the ring of polynomials over
$R$ and $R(X)$ denotes the field of fractions of $R[X]$. But if $\alpha
\in S$, where $S \supseteq R$ are rings, what is the distinction between
$R[\alpha]$ and $R(\alpha)$? It is my understanding that if $R$ is a field
then $R[\alpha] \cong R(\alpha)$, but that this is not generally true for
any ring. Is this correct?
Adding to my confusion is the fact that $\mathbb Z[i]$ and $\mathbb Z(i)$
are used interchangeably, despite $\mathbb Z$ not being a field. However,
it's clear to me that they are equivalent ( i.e. $\mathbb Z[i] = \mathbb
Z(i) = \{ a + bi | a,b \in \mathbb Z \}$); is this because $i$ is
algebraic over $\mathbb Z$? Or for some other reason?
Thanks for your help!
I've seen similar questions asked here, but I've not been able to find a
comprehensive answer.
I know that for a ring $R$, $R[X]$ denotes the ring of polynomials over
$R$ and $R(X)$ denotes the field of fractions of $R[X]$. But if $\alpha
\in S$, where $S \supseteq R$ are rings, what is the distinction between
$R[\alpha]$ and $R(\alpha)$? It is my understanding that if $R$ is a field
then $R[\alpha] \cong R(\alpha)$, but that this is not generally true for
any ring. Is this correct?
Adding to my confusion is the fact that $\mathbb Z[i]$ and $\mathbb Z(i)$
are used interchangeably, despite $\mathbb Z$ not being a field. However,
it's clear to me that they are equivalent ( i.e. $\mathbb Z[i] = \mathbb
Z(i) = \{ a + bi | a,b \in \mathbb Z \}$); is this because $i$ is
algebraic over $\mathbb Z$? Or for some other reason?
Thanks for your help!
Selecting trades to maximize ownership between a variety of buy / sell weighted fields
Selecting trades to maximize ownership between a variety of buy / sell
weighted fields
Say I have four(or more) items: beer, cheese, milk, and honey.
And I can trade these items for other items with a percentage loss each
time (due to effort). How can I select the best approach to maximize one
item?
beer->cheese :: buy:10 sell:1
beer->milk :: buy:5 sell: 9
beer->honey :: buy:4 sell 8
cheese->beer :: buy:20 sell 10
cheese->milk :: buy:1 sell:15
cheese->honey :: buy:8 sell: 34
milk->beer :: buy:10 sell:13
milk->cheese :: buy:7 sell: 3
milk->honey :: buy:8 sell 3
honey->beer :: buy:110 sell:1
honey->cheese :: buy:28 sell: 9
honey->milk :: buy:43 sell 0.2
In this case I want to acquire the most beer as I am thirsty, on another
day I may want to merely have a trade chain that results in the most
worth. I assume I can merely bruteforce it, by looking at all of the
profitable trades I am able to do, and then branching from there. Is there
a better way? Is there a generalized way to maximize either worth or beer?
weighted fields
Say I have four(or more) items: beer, cheese, milk, and honey.
And I can trade these items for other items with a percentage loss each
time (due to effort). How can I select the best approach to maximize one
item?
beer->cheese :: buy:10 sell:1
beer->milk :: buy:5 sell: 9
beer->honey :: buy:4 sell 8
cheese->beer :: buy:20 sell 10
cheese->milk :: buy:1 sell:15
cheese->honey :: buy:8 sell: 34
milk->beer :: buy:10 sell:13
milk->cheese :: buy:7 sell: 3
milk->honey :: buy:8 sell 3
honey->beer :: buy:110 sell:1
honey->cheese :: buy:28 sell: 9
honey->milk :: buy:43 sell 0.2
In this case I want to acquire the most beer as I am thirsty, on another
day I may want to merely have a trade chain that results in the most
worth. I assume I can merely bruteforce it, by looking at all of the
profitable trades I am able to do, and then branching from there. Is there
a better way? Is there a generalized way to maximize either worth or beer?
Renamed user in Active Directory/Exchange not correctly displaying in Outlook calender
Renamed user in Active Directory/Exchange not correctly displaying in
Outlook calender
We renamed a user via the SBS2011 console. It appeared to update
everywhere. However when other domain users use Outlook to connect to the
user's shared calendar it still has the old username.
Ex: rename User1 to User2. When User3 connects to User2's shared calendar
it still shows User1's name in the calendars list.
Active directory has the correct info, and everything seems to be in
place, our only issue is with the wrong name showing up in the shared
Outlook calenders. Removing and recreating the account isn't really an
option because of all the information tied to this specific user's
account.
Why would this be happening?
Outlook calender
We renamed a user via the SBS2011 console. It appeared to update
everywhere. However when other domain users use Outlook to connect to the
user's shared calendar it still has the old username.
Ex: rename User1 to User2. When User3 connects to User2's shared calendar
it still shows User1's name in the calendars list.
Active directory has the correct info, and everything seems to be in
place, our only issue is with the wrong name showing up in the shared
Outlook calenders. Removing and recreating the account isn't really an
option because of all the information tied to this specific user's
account.
Why would this be happening?
how is this substitution string working?
how is this substitution string working?
I am working with kerberos configuration (specifically the krb5.conf file)
and there is a specific section called auth_to_local mappings and it is
defined here:
http://web.mit.edu/Kerberos/krb5-1.9/krb5-1.9.5/doc/krb5-admin.html
A typical mapping entry looks like this:
auth_to_local = RULE:[1:$0\$1](^DOMAIN\.COM\\.*)s/^DOMAIN\.COM/DOMAIN/
The man page states the exact syntax, but basically the above line would
look for a UPN like:
user@DOMAIN.COM and convert it to DOMAIN.COM\user and see if it can match
DOMAIN.COM and if so, substitute in just DOMAIN. So, end result would be
DOMAIN\user.
However, we have an entry (that works) in this format:
auth_to_local = RULE:[1:$0\$1](^DOMAIN\.COM\\.*)s/^DOMAIN\.COM\\//
Seemingly, it is substituting the DOMAIN.COM with some kind of null value,
but I can't decode what this "\\//" syntax means.
I'm not sure if this rule uses standard sed type syntax to
substitute...can someone wager some guesses as to the interpretation of
this?
I am working with kerberos configuration (specifically the krb5.conf file)
and there is a specific section called auth_to_local mappings and it is
defined here:
http://web.mit.edu/Kerberos/krb5-1.9/krb5-1.9.5/doc/krb5-admin.html
A typical mapping entry looks like this:
auth_to_local = RULE:[1:$0\$1](^DOMAIN\.COM\\.*)s/^DOMAIN\.COM/DOMAIN/
The man page states the exact syntax, but basically the above line would
look for a UPN like:
user@DOMAIN.COM and convert it to DOMAIN.COM\user and see if it can match
DOMAIN.COM and if so, substitute in just DOMAIN. So, end result would be
DOMAIN\user.
However, we have an entry (that works) in this format:
auth_to_local = RULE:[1:$0\$1](^DOMAIN\.COM\\.*)s/^DOMAIN\.COM\\//
Seemingly, it is substituting the DOMAIN.COM with some kind of null value,
but I can't decode what this "\\//" syntax means.
I'm not sure if this rule uses standard sed type syntax to
substitute...can someone wager some guesses as to the interpretation of
this?
DEPRECATION WARNING: Passing options to #find is deprecated
DEPRECATION WARNING: Passing options to #find is deprecated
In my message model I have method to read a message, I use it in Message
Controller. But something's worng with this method because when i run the
tests i have error:
DEPRECATION WARNING: Passing options to #find is deprecated. Please build
a scope and then call #find on it. (called from readingmessage at
/home/mateusz/rails4/Bloggers/app/models/message.rb:21)
This is my method:
def self.readingmessage(id, reader)
message = find(id, :conditions => ["sender_id = ? OR recepient_id = ?",
reader, reader])
if message.read_at.nil? && (message.recepient.id==reader)
message.read_at = Time.now
message.save!
end
message
end
In my message model I have method to read a message, I use it in Message
Controller. But something's worng with this method because when i run the
tests i have error:
DEPRECATION WARNING: Passing options to #find is deprecated. Please build
a scope and then call #find on it. (called from readingmessage at
/home/mateusz/rails4/Bloggers/app/models/message.rb:21)
This is my method:
def self.readingmessage(id, reader)
message = find(id, :conditions => ["sender_id = ? OR recepient_id = ?",
reader, reader])
if message.read_at.nil? && (message.recepient.id==reader)
message.read_at = Time.now
message.save!
end
message
end
ActionController::Live goes down after the second connection from the same host
ActionController::Live goes down after the second connection from the same
host
RubyOnRails 4 + Passenger + Nginx
Tested it with curl:
curl -i http://myapp.com/stream
Rails logs after the one connection:
Started GET "/stream" for xxx.xxx.xxx.xxx at 2013-08-20 16:53:01 +0600
Processing by StreamingController#index as */*
After the second connection:
Started GET "/stream" for xxx.xxx.xxx.xxx at 2013-08-20 16:53:06 +0600
Processing by StreamingController#index as */*
That's it, server is not responding to anybody, and logs are clear.
host
RubyOnRails 4 + Passenger + Nginx
Tested it with curl:
curl -i http://myapp.com/stream
Rails logs after the one connection:
Started GET "/stream" for xxx.xxx.xxx.xxx at 2013-08-20 16:53:01 +0600
Processing by StreamingController#index as */*
After the second connection:
Started GET "/stream" for xxx.xxx.xxx.xxx at 2013-08-20 16:53:06 +0600
Processing by StreamingController#index as */*
That's it, server is not responding to anybody, and logs are clear.
php.ini unable to change upload_max_filesize
php.ini unable to change upload_max_filesize
I am developing php applications on Ubuntu 13.04 and when i am trying to
change the upload_max_filesize sudo gedit /etc/php5/apache2/php.ini and
restart apache the values do not change in my phpinfo they stay at the
default values
This is the path mentioned in the phpinfo (Loaded Configuration File
/etc/php5/apache2/php.ini)
Any help would be greatly appreciated.
Thanks!!
I am developing php applications on Ubuntu 13.04 and when i am trying to
change the upload_max_filesize sudo gedit /etc/php5/apache2/php.ini and
restart apache the values do not change in my phpinfo they stay at the
default values
This is the path mentioned in the phpinfo (Loaded Configuration File
/etc/php5/apache2/php.ini)
Any help would be greatly appreciated.
Thanks!!
Monday, 19 August 2013
PDO replacing mysqli
PDO replacing mysqli
I'm convinced that I need to migrate to PDO and am working my way through.
I have two questions so far...
(1) Is is always appropriate to use a prepared statement? What if I simply
want to list a set or records from a table and there will only be one
query on that table? Doesn't a prepared statement slow things down for the
first query?
(2) Let's say I have a table with 10 fields. Can I declare a class that
has only six of those fields and then use PDO::FETCH_CLASS, "foo" where
"foo" is my abbreviated class?
I'm convinced that I need to migrate to PDO and am working my way through.
I have two questions so far...
(1) Is is always appropriate to use a prepared statement? What if I simply
want to list a set or records from a table and there will only be one
query on that table? Doesn't a prepared statement slow things down for the
first query?
(2) Let's say I have a table with 10 fields. Can I declare a class that
has only six of those fields and then use PDO::FETCH_CLASS, "foo" where
"foo" is my abbreviated class?
Finding Allocated Memory
Finding Allocated Memory
Platform: x86 Linux 3.2.0 (Debian 7.1)
Compiler: GCC 4.7.2 (Debian 4.7.2-5)
I am writing a function that generates a "random" integer by reading
allocated portions of memory for "random" values. The idea is based on the
fact that uninitialized variables have undefined values. My initial idea
was to allocate an array using malloc() and then use it's uninitialized
elements to generate a random number. But malloc() tends to return NULL
blocks of memory so I cannot guarantee that there is anything to read. So
I thought about reading a separate processes memory in order to almost
guarantee values other than NULL. My current idea is somehow finding the
first valid memory address and reading from there down but I do not know
how to do this. I tried initializing a pointer to NULL and then
incrementing it by one but if I attempt to print the referenced memory
location a segmentation fault occurs. So my question is how do I read a
separate processes memory. I do not need to do anything with the memory
other than read it.
Platform: x86 Linux 3.2.0 (Debian 7.1)
Compiler: GCC 4.7.2 (Debian 4.7.2-5)
I am writing a function that generates a "random" integer by reading
allocated portions of memory for "random" values. The idea is based on the
fact that uninitialized variables have undefined values. My initial idea
was to allocate an array using malloc() and then use it's uninitialized
elements to generate a random number. But malloc() tends to return NULL
blocks of memory so I cannot guarantee that there is anything to read. So
I thought about reading a separate processes memory in order to almost
guarantee values other than NULL. My current idea is somehow finding the
first valid memory address and reading from there down but I do not know
how to do this. I tried initializing a pointer to NULL and then
incrementing it by one but if I attempt to print the referenced memory
location a segmentation fault occurs. So my question is how do I read a
separate processes memory. I do not need to do anything with the memory
other than read it.
vbscript won't return multidimensional array
vbscript won't return multidimensional array
This is really getting annoying. The following is a method which is
contained in a custom database class. I query data into a recordset then
try to convert this data into an array w/o field names. It appears to be
working within the function because I setup a response.write to check if
there were any values. But once out of the function, things go haywire
(the array is not the same).
Public Function To2Array()
dim A, x, columns
columns = Rs.Fields.Count
Rs.MoveFirst()
x = 0
do until Rs.EOF
Redim A(x+1,columns)
for y = 0 to columns - 1
A(x,y) = Rs.Fields.Item(y)
response.write A(x,y) 'returns correct value
Next
x = x + 1
Rs.MoveNext()
loop
To2Array = A
End Function
I assign the return array but there appears to be nothing.
arr = db.To2Array()
response.write(arr(1,0)) 'returns nothing
Can anyone figure out what I'm doing wrong?
This is really getting annoying. The following is a method which is
contained in a custom database class. I query data into a recordset then
try to convert this data into an array w/o field names. It appears to be
working within the function because I setup a response.write to check if
there were any values. But once out of the function, things go haywire
(the array is not the same).
Public Function To2Array()
dim A, x, columns
columns = Rs.Fields.Count
Rs.MoveFirst()
x = 0
do until Rs.EOF
Redim A(x+1,columns)
for y = 0 to columns - 1
A(x,y) = Rs.Fields.Item(y)
response.write A(x,y) 'returns correct value
Next
x = x + 1
Rs.MoveNext()
loop
To2Array = A
End Function
I assign the return array but there appears to be nothing.
arr = db.To2Array()
response.write(arr(1,0)) 'returns nothing
Can anyone figure out what I'm doing wrong?
Can't connect to localhost
Can't connect to localhost
I am learning PHP and am working on a script that connects to my DB and
pulls some data.
The website I have running on my localhost is a PHP driven CMS.
A segment of the script is here
DEFINE ('DB_USER','myname');
DEFINE ('DB_PASSWORD','somepass123');
DEFINE ('DB_HOST','localhost');
DEFINE ('DB_NAME','sitename');
// make the db connection
$dbc = @mysqli_connect('DB_HOST','DB_USER','DB_PASSWORD','DB_NAME')
OR die ('Could not connect to mysql: ' . mysqli_connect_error());
When I load a page that draws on the PHP I receive the following error
where the output data is meant to be:
Could not connect to mysql: Unknown MySQL server host 'DB_HOST' (1)
I did some research on SO and some googling around. A suspect issue could
be that DB_HOST is defined elsewhere. Is that plausible? I'm not
experienced enough to know if this is the right path.
I did find this in the config/database.php file, I'm not sure if it's
relevant:
$config['default'] = array(
'benchmark' => TRUE,
'persistent' => FALSE,
'connection' => array(
'type' => 'mysqli',
'user' => 'myname',
'pass' => 'somepass123',
'host' => 'localhost',
'port' => FALSE,
'socket' => FALSE,
'database' => 'sitename',
How would I approach figuring out next steps? Is this a common error? Does
anyone have any pointers?
I am learning PHP and am working on a script that connects to my DB and
pulls some data.
The website I have running on my localhost is a PHP driven CMS.
A segment of the script is here
DEFINE ('DB_USER','myname');
DEFINE ('DB_PASSWORD','somepass123');
DEFINE ('DB_HOST','localhost');
DEFINE ('DB_NAME','sitename');
// make the db connection
$dbc = @mysqli_connect('DB_HOST','DB_USER','DB_PASSWORD','DB_NAME')
OR die ('Could not connect to mysql: ' . mysqli_connect_error());
When I load a page that draws on the PHP I receive the following error
where the output data is meant to be:
Could not connect to mysql: Unknown MySQL server host 'DB_HOST' (1)
I did some research on SO and some googling around. A suspect issue could
be that DB_HOST is defined elsewhere. Is that plausible? I'm not
experienced enough to know if this is the right path.
I did find this in the config/database.php file, I'm not sure if it's
relevant:
$config['default'] = array(
'benchmark' => TRUE,
'persistent' => FALSE,
'connection' => array(
'type' => 'mysqli',
'user' => 'myname',
'pass' => 'somepass123',
'host' => 'localhost',
'port' => FALSE,
'socket' => FALSE,
'database' => 'sitename',
How would I approach figuring out next steps? Is this a common error? Does
anyone have any pointers?
Custom Normal plugin won't draw objects if previous material is BasicMaterial
Custom Normal plugin won't draw objects if previous material is BasicMaterial
I've been working on a deffered renderer for my application. In order for
my application to render correctly I need to draw position, depth and
normal maps of the scene. To render these 3 render targets I took the same
approach as was done for the depth pass plugin.
In the depth plugin, each of the objects to be rendered is replaced with a
depth material that draws the object onto the render target. I.e just
before rendering it does this:
if ( useSkinning )
material = useMorphing ? skinMorphMat : skinMat;
else if ( useMorphing )
material = morphMat;
else
material = mat;
I wanted to use the same method, but instead draw normal maps. To do this
I copied the 'normal' shader so that it supported animation and alpha
testing ( I cant use the normal map material as it doesn't support these
features - so I had to create a Shader Material with my new custom shader
).
However when I pass my ShaderMaterial to the renderer, nothing is drawn
when the object's previous material was a basic material. The reason for
this, as I understand it, is because when a basic material is applied on
an object the function 'bufferGuessNormalType' returns false and so the
mesh never has normals generated for it.
So is there a way to ensure that even if the previous material is basic,
normal are generated?
I've been working on a deffered renderer for my application. In order for
my application to render correctly I need to draw position, depth and
normal maps of the scene. To render these 3 render targets I took the same
approach as was done for the depth pass plugin.
In the depth plugin, each of the objects to be rendered is replaced with a
depth material that draws the object onto the render target. I.e just
before rendering it does this:
if ( useSkinning )
material = useMorphing ? skinMorphMat : skinMat;
else if ( useMorphing )
material = morphMat;
else
material = mat;
I wanted to use the same method, but instead draw normal maps. To do this
I copied the 'normal' shader so that it supported animation and alpha
testing ( I cant use the normal map material as it doesn't support these
features - so I had to create a Shader Material with my new custom shader
).
However when I pass my ShaderMaterial to the renderer, nothing is drawn
when the object's previous material was a basic material. The reason for
this, as I understand it, is because when a basic material is applied on
an object the function 'bufferGuessNormalType' returns false and so the
mesh never has normals generated for it.
So is there a way to ensure that even if the previous material is basic,
normal are generated?
Sunday, 18 August 2013
How to initiate class with interface if you only know the class name in string - C#
How to initiate class with interface if you only know the class name in
string - C#
I have a interface named IClass declaring the method Calculate as below:
public interface IClass
{
public int Calculate(int x);
}
Also I have 2 different classes implementing the above mentioned
interface, Class1 and Class2:
public class Class1: IClass
{
public int Calculate(int x)
{
// do some calc with method 1 here
}
}
public class Class2: IClass
{
public int Calculate(int x)
{
// do some calc with method 2 here
}
}
And then I want to call it from main class, however there is restriction
where I don't know the class type, I only know the class string name
(because it's a class library - other people may make the code for it).
The question is: how can I instantiate the particular class (and invoke
the method Calculate) by knowing only its name ?
public class MainForm()
{
public int CalcUsing(string classname, int x)
{
IClass myclass = new Type(typeof(classname))() // doesn't work here
int result = myclass.Calculate(x);
return result;
}
}
string - C#
I have a interface named IClass declaring the method Calculate as below:
public interface IClass
{
public int Calculate(int x);
}
Also I have 2 different classes implementing the above mentioned
interface, Class1 and Class2:
public class Class1: IClass
{
public int Calculate(int x)
{
// do some calc with method 1 here
}
}
public class Class2: IClass
{
public int Calculate(int x)
{
// do some calc with method 2 here
}
}
And then I want to call it from main class, however there is restriction
where I don't know the class type, I only know the class string name
(because it's a class library - other people may make the code for it).
The question is: how can I instantiate the particular class (and invoke
the method Calculate) by knowing only its name ?
public class MainForm()
{
public int CalcUsing(string classname, int x)
{
IClass myclass = new Type(typeof(classname))() // doesn't work here
int result = myclass.Calculate(x);
return result;
}
}
Trying to get example from Awk and Sed book to work on Ubuntu 13.04
Trying to get example from Awk and Sed book to work on Ubuntu 13.04
I have been developing Windows Software for years. I am trying to branch
out and learn Linux. It will really help with my new job.
I have picked up the book, "Awk and Sed" 2nd Edition. I am running Ubuntu
13.04; working with the terminal window. I am working through the book and
have run into an example that I cannot get to work.
I have been trying everything that I can find to get this to work. If I
type the example with out using the second script file, it works as
expected. However when I try to work as instructed in the book (i.e.,
using a script file), I get the following: "byState: command not found".
The command that fails is:
sed -f nameState list | byState
What is my problem?
Here is a set of data: List =
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams, 20 Post Road, Sudbury MA
Hubert Sims, 328A Brook Road, Roanoke VA
Amy Wilde, 334 Bayshore Pkwy, Mountain View CA
Sal Carpenter, 73 6th Street, Boston MA
The first script is: nameState =
s/ CA/, California/
s/ MA/, Massachusetts/
s/ OK/, Oklahoma/
s/ PA/, Pennsylvania/
s/ VA/, Virginia/
The second script is: byState =
#! /bin/sh
awk -F, '{
print $4 ", " $0
}' $* |
sort |
awk -F, '
$1 == LastState {
print "\t" $2
}
$1 != LastState {
LastState = $1
print $1
print "\t" $2
}'
I have been developing Windows Software for years. I am trying to branch
out and learn Linux. It will really help with my new job.
I have picked up the book, "Awk and Sed" 2nd Edition. I am running Ubuntu
13.04; working with the terminal window. I am working through the book and
have run into an example that I cannot get to work.
I have been trying everything that I can find to get this to work. If I
type the example with out using the second script file, it works as
expected. However when I try to work as instructed in the book (i.e.,
using a script file), I get the following: "byState: command not found".
The command that fails is:
sed -f nameState list | byState
What is my problem?
Here is a set of data: List =
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams, 20 Post Road, Sudbury MA
Hubert Sims, 328A Brook Road, Roanoke VA
Amy Wilde, 334 Bayshore Pkwy, Mountain View CA
Sal Carpenter, 73 6th Street, Boston MA
The first script is: nameState =
s/ CA/, California/
s/ MA/, Massachusetts/
s/ OK/, Oklahoma/
s/ PA/, Pennsylvania/
s/ VA/, Virginia/
The second script is: byState =
#! /bin/sh
awk -F, '{
print $4 ", " $0
}' $* |
sort |
awk -F, '
$1 == LastState {
print "\t" $2
}
$1 != LastState {
LastState = $1
print $1
print "\t" $2
}'
Change Users Home Directory
Change Users Home Directory
I have created a new user but the new user's home directory has the old
users path. How can I update my new user's home directory so that the
terminal opens to this directory and all software considers this new
directory my home directory? I'm using OS x 10.8.4.
I have created a new user but the new user's home directory has the old
users path. How can I update my new user's home directory so that the
terminal opens to this directory and all software considers this new
directory my home directory? I'm using OS x 10.8.4.
recursive CLI commands [duplicate]
recursive CLI commands [duplicate]
This question already has an answer here:
Bash - how do you make it so that the result of a command gets placed into
a variable? 1 answer
What is the syntax to perform a unix command that uses the result of
another operation as an argument. Like this
$ rm (the result of "which executable")
The intention here is to remove the first found symlink of executable. e.g:
$ rm /usr/bin/executable
This question already has an answer here:
Bash - how do you make it so that the result of a command gets placed into
a variable? 1 answer
What is the syntax to perform a unix command that uses the result of
another operation as an argument. Like this
$ rm (the result of "which executable")
The intention here is to remove the first found symlink of executable. e.g:
$ rm /usr/bin/executable
more use of used to in have to form
more use of used to in have to form
can we use used to in have to form? like my son are going to hostel and he
doesn't like to live alone , can I tell him that "you WILL HAVE TO used to
in hostel life" means use of both form have to and used to together?or
like I had to used to eat green vegies
can we use used to in have to form? like my son are going to hostel and he
doesn't like to live alone , can I tell him that "you WILL HAVE TO used to
in hostel life" means use of both form have to and used to together?or
like I had to used to eat green vegies
Arithmetical objects rendering?
Arithmetical objects rendering?
do anyone knows about any PHP library to rendering arithmetical objects ?
For example you can look at WolframAlpha.
Thanks very much.
do anyone knows about any PHP library to rendering arithmetical objects ?
For example you can look at WolframAlpha.
Thanks very much.
rsyslog: execute script on matching log event
rsyslog: execute script on matching log event
I have the following line in my /etc/rsyslog.conf
:programname, contains, "suhosin" /var/log/suhosin.log
which logs all php security related incidents to /var/log/suhosin.log.
That is nice, but I would like rsyslog to execute my script action.sh
instead of logging to file. How could I do that?
I have the following line in my /etc/rsyslog.conf
:programname, contains, "suhosin" /var/log/suhosin.log
which logs all php security related incidents to /var/log/suhosin.log.
That is nice, but I would like rsyslog to execute my script action.sh
instead of logging to file. How could I do that?
Saturday, 17 August 2013
How to auto-reload without losing server state?
How to auto-reload without losing server state?
I used to use Tomcat and Java. When Tomcat automatically reloads changed
Java code, it does not lose any server state, for example sessions are not
lost.
Recently I started to learn Play framework, and it seems to restart entire
server whenever controllers change. My web application has a login screen,
therefore even if there is a small code change, I have to manually login
again to test the feature.
Can Play reload source code without losing server states?
I used to use Tomcat and Java. When Tomcat automatically reloads changed
Java code, it does not lose any server state, for example sessions are not
lost.
Recently I started to learn Play framework, and it seems to restart entire
server whenever controllers change. My web application has a login screen,
therefore even if there is a small code change, I have to manually login
again to test the feature.
Can Play reload source code without losing server states?
Laravel 4 Model Methods access
Laravel 4 Model Methods access
am I doing something wrong to be able to access Methods stored in a model
in a view. For Example. My User model has a method that looks like
public function isCustomer(){
if (isset($this->customer_id))
return true;
else return false;
}
When I try to access this in the view I end up with Call to a member
function getResults() on a non-object.
View code is something like
@if($user->isCustomer)
Something
@endif
Is the model ONLY for database relationships between models or can I store
my own class functions here as well?
The function i listed is one of the basic ones. I have quite a few more
complicated functions that I would like to run from my User class but am
not sure how, as i end up with the same error each time. Should they be
stored in the controller?
am I doing something wrong to be able to access Methods stored in a model
in a view. For Example. My User model has a method that looks like
public function isCustomer(){
if (isset($this->customer_id))
return true;
else return false;
}
When I try to access this in the view I end up with Call to a member
function getResults() on a non-object.
View code is something like
@if($user->isCustomer)
Something
@endif
Is the model ONLY for database relationships between models or can I store
my own class functions here as well?
The function i listed is one of the basic ones. I have quite a few more
complicated functions that I would like to run from my User class but am
not sure how, as i end up with the same error each time. Should they be
stored in the controller?
Keep text in text field after submitting
Keep text in text field after submitting
I am having a issue keeping text in the text field that was previously
there after pushing submit. I am using this:
<input name="date" type="text" id="date" <?php
if(isset($_POST['date'])){echo 'value="'.$_POST['date'].'"';} ?>/>
I also have this on successful submit so that it reloads the table but
also removes whats above because it's refreshing.
echo "Succesfully added transaction. Updating table...";
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"6\">";
I am having a issue keeping text in the text field that was previously
there after pushing submit. I am using this:
<input name="date" type="text" id="date" <?php
if(isset($_POST['date'])){echo 'value="'.$_POST['date'].'"';} ?>/>
I also have this on successful submit so that it reloads the table but
also removes whats above because it's refreshing.
echo "Succesfully added transaction. Updating table...";
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"6\">";
boost::regex_replace does nothing
boost::regex_replace does nothing
I am trying to use boost::regex_replace to replace HTML entities. I looked
at this question about how to use regex_replace and I am doing what the
answer does but with iterators. As far as I can tell from the boost regex
examples , this should be correct.
Here is the regex definition:
const boost::regex HTML_ENTITIY_REGEX("(&) | (") | (<) |
(>) | (')", boost::regex::optimize);
Here is the format string definition:
const std::string HTML_ENTITIY_FMT("(?1&)(?2\")(?3<)(?4>)(?5')");
Here is the function that calls boost::regex_replace:
template <class MutableBidirItr>
void decode_html_entities(MutableBidirItr begin, MutableBidirItr end)
{
boost::regex_replace(std::ostream_iterator<char>(std::cout), begin,
end, HTML_ENTITIY_REGEX,
HTML_ENTITIY_FMT, boost::match_default |
boost::format_all);
}
begin and end params are std::array::begin and std::array::begin + offset
where offset is less than or equal std::distance(begin, end)
The original text is:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 751
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sat, 17 Aug 2013 16:30:14 GMT
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0"
encoding="utf-
16"?>
<CurrentWeather>
<Location>Cairo Airport, Egypt (HECA) 30-08N 031-24E
74M</Location>
;
<Time>Aug 17, 2013 - 12:00 PM EDT / 2013.08.17 1600 UTC</Time>
<Wind> from the NNW (340 degrees) at 13 MPH (11 KT):0</Wind>
<Visibility> greater than 7 mile(s):0</Visibility>
<Temperature> 91 F (33 C)</Temperature>
<DewPoint> 69 F (21 C)</DewPoint>
<RelativeHumidity> 49%</RelativeHumidity>
<Pressure> 29.74 in. Hg (1007 hPa)</Pressure>
<Status>Success</Status>
</CurrentWeather></string>
Output from boost::regex_replace:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 751
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sat, 17 Aug 2013 16:30:14 GMT
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0"
encoding="utf-
16"?>
<CurrentWeather>
<Location>Cairo Airport, Egypt (HECA) 30-08N 031-24E
74M</Location>
;
<Time>Aug 17, 2013 - 12:00 PM EDT / 2013.08.17 1600 UTC</Time>
<Wind> from the NNW (340 degrees) at 13 MPH (11 KT):0</Wind>
<Visibility> greater than 7 mile(s):0</Visibility>
<Temperature> 91 F (33 C)</Temperature>
<DewPoint> 69 F (21 C)</DewPoint>
<RelativeHumidity> 49%</RelativeHumidity>
<Pressure> 29.74 in. Hg (1007 hPa)</Pressure>
<Status>Success</Status>
</CurrentWeather></string>
I feel like its a problem with the fmt string, but as far as I can tell it
is correct.
What is the proper way of using boost::regex and boost::regex_replace ?
What am I doing wrong here ? Also is it correct that by default
boost::regex uses ECMAscript and the format string uses Boost-Extended
Format String Syntax ?
I am trying to use boost::regex_replace to replace HTML entities. I looked
at this question about how to use regex_replace and I am doing what the
answer does but with iterators. As far as I can tell from the boost regex
examples , this should be correct.
Here is the regex definition:
const boost::regex HTML_ENTITIY_REGEX("(&) | (") | (<) |
(>) | (')", boost::regex::optimize);
Here is the format string definition:
const std::string HTML_ENTITIY_FMT("(?1&)(?2\")(?3<)(?4>)(?5')");
Here is the function that calls boost::regex_replace:
template <class MutableBidirItr>
void decode_html_entities(MutableBidirItr begin, MutableBidirItr end)
{
boost::regex_replace(std::ostream_iterator<char>(std::cout), begin,
end, HTML_ENTITIY_REGEX,
HTML_ENTITIY_FMT, boost::match_default |
boost::format_all);
}
begin and end params are std::array::begin and std::array::begin + offset
where offset is less than or equal std::distance(begin, end)
The original text is:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 751
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sat, 17 Aug 2013 16:30:14 GMT
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0"
encoding="utf-
16"?>
<CurrentWeather>
<Location>Cairo Airport, Egypt (HECA) 30-08N 031-24E
74M</Location>
;
<Time>Aug 17, 2013 - 12:00 PM EDT / 2013.08.17 1600 UTC</Time>
<Wind> from the NNW (340 degrees) at 13 MPH (11 KT):0</Wind>
<Visibility> greater than 7 mile(s):0</Visibility>
<Temperature> 91 F (33 C)</Temperature>
<DewPoint> 69 F (21 C)</DewPoint>
<RelativeHumidity> 49%</RelativeHumidity>
<Pressure> 29.74 in. Hg (1007 hPa)</Pressure>
<Status>Success</Status>
</CurrentWeather></string>
Output from boost::regex_replace:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 751
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sat, 17 Aug 2013 16:30:14 GMT
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0"
encoding="utf-
16"?>
<CurrentWeather>
<Location>Cairo Airport, Egypt (HECA) 30-08N 031-24E
74M</Location>
;
<Time>Aug 17, 2013 - 12:00 PM EDT / 2013.08.17 1600 UTC</Time>
<Wind> from the NNW (340 degrees) at 13 MPH (11 KT):0</Wind>
<Visibility> greater than 7 mile(s):0</Visibility>
<Temperature> 91 F (33 C)</Temperature>
<DewPoint> 69 F (21 C)</DewPoint>
<RelativeHumidity> 49%</RelativeHumidity>
<Pressure> 29.74 in. Hg (1007 hPa)</Pressure>
<Status>Success</Status>
</CurrentWeather></string>
I feel like its a problem with the fmt string, but as far as I can tell it
is correct.
What is the proper way of using boost::regex and boost::regex_replace ?
What am I doing wrong here ? Also is it correct that by default
boost::regex uses ECMAscript and the format string uses Boost-Extended
Format String Syntax ?
#$@@#$@#@Where i can see Arsenal vs Aston Villa live Streaming#$#$$#@#@
#$@@#$@#@Where i can see Arsenal vs Aston Villa live Streaming#$#$$#@#@
Watch Live Streaming Link
Arsenal midfielder Mikel Arteta has a thigh injury and could miss the
first six weeks of the season.
Thomas Vermaelen and Nacho Monreal are out with back injuries, but there
could be a debut for new recruit Yaya Sanogo.
Aston Villa midfielder Yacouba Sylla is expected to miss the game with a
twisted ankle, while Chris Herd is struggling with a calf injury.
Antonio Luna, Jores Okore and winger Aleksandar Tonev are the most likely
starters among Villa's six signings.
Watch Live Streaming Link
Watch Live Streaming Link
Arsenal midfielder Mikel Arteta has a thigh injury and could miss the
first six weeks of the season.
Thomas Vermaelen and Nacho Monreal are out with back injuries, but there
could be a debut for new recruit Yaya Sanogo.
Aston Villa midfielder Yacouba Sylla is expected to miss the game with a
twisted ankle, while Chris Herd is struggling with a calf injury.
Antonio Luna, Jores Okore and winger Aleksandar Tonev are the most likely
starters among Villa's six signings.
Watch Live Streaming Link
Subscribe to:
Comments (Atom)