Q:

php echo floor error line 66

I am trying to echo the below in a new way but I get an error
old code
echo floor ($row ['avprice']);

New code , line 66
echo floor '
 '.($row ['avprice']).'
';

Error

Parse error: syntax error, unexpected '"', expecting ',' or ';' in
  C:\wamp\www\boot\details1.php on line 66

I have tried changing the " and ' ' but no joy whatever I try. I m basically just trying to round the price down or just remove everything after the decimal place , so "no" decimal places.
Thanks

A:

I am sure you didn't tried this:-
echo '
'. floor($row ['avprice']) .'
';

You can do like below (what you asked in comment):-
echo '£
'. floor($row ['avprice']) .'
';

Or
echo '
£'. floor($row ['avprice']) .'
';


Q:

WordPress Advanced Custom Post not displaying in backend

Here is the code, the 5th and final one is not showing up in the ADMIN CP Panel. All the others are working fine, but when I try add a 5th one. Nothing shows up. Not sure if there is a limit or something, does not appear to be from what I have read.
add_action( 'init', 'create_post_type' );
function create_post_type() {
    register_post_type( 'Slides',
        array(
            'labels' => array(
                'name' => __( 'slides' ),
                'singular_name' => __( 'slide' )
            ),
            'public' => true,
            'has_archive' => true,
        )
    );

    register_post_type( 'Programs',
        array(
            'labels' => array(
                'name' => __( 'programs' ),
                'singular_name' => __( 'program' )
            ),
            'public' => true,
            'has_archive' => true,
        )
    );

    register_post_type( 'Boards',
        array(
            'labels' => array(
                'name' => __( 'Boards' ),
                'singular_name' => __( 'sponsor' )
            ),
            'public' => true,
            'has_archive' => true,
        )
    );

A:

Your code just work perfectly, you have just forget in your code at the end a closing bracket } and some errors in slug post types (in lowercase):
add_action( 'init', 'create_post_type' );
function create_post_type() {
  register_post_type( 'slides', // <== here to lowercase (slug)
    array(
      'labels' => array(
        'name' => __( 'Slides' ), // <== here 1st letter uppercase
        'singular_name' => __( 'Slide' ) // <== here 1st letter uppercase
      ),
      'public' => true,
      'has_archive' => true,
    )
  );

    register_post_type( 'programs', // <== here to lowercase (slug)
    array(
      'labels' => array(
        'name' => __( 'Programs' ), // <== here 1st letter uppercase
        'singular_name' => __( 'Program' ) // <== here 1st letter uppercase
      ),
      'public' => true,
      'has_archive' => true,
    )
  );

    register_post_type( 'boards', // <== here to lowercase (slug)
    array(
      'labels' => array(
        'name' => __( 'Boards' ),
        'singular_name' => __( 'Board' )  // <== here singular
      ),
      'public' => true,
      'has_archive' => true,
    )
  );
} // <== forgetted this

I have test your code on a test website and even your custom post "Boards" is showing and working:

You may need to flush the rewrite rules by going on backend permalinks settings and simply click on save to regenerate Wordpress rewrite rules related to this new post types…

Is there a limit for post types in WordPress?
There is no limit for number of different custom posts. Try the example below that generates in a very compact code 10 custom posts with a for loop :
add_action( 'init', 'create_post_type' );
function create_post_type() {
    $arr = array('abcdef','bcdefg','cdefgh','defghi','efghij','fghijk','ghijkl','hijklm','ijklmn','jklmno');
    for( $i = 0; $i < 10; $i++ ) {
        $slug = $arr[$i];
        $slugs = $arr[$i].'s';
        register_post_type( $slug,
            array(
                'labels' => array(
                    'name' => $slugs,
                    'singular_name' => $slug ),
                'public' => true,
                'has_archive' => true )
        );
    }
}

References:

Developer WordPress - register_post_type() function
Wordpress Custom Post Types doesn't show in admin left sidebar menu


Q:

How to level up armies

In most of my games, I see the AI with high level (8,9,10) troops. How do you go about leveling your troops high? I understand that as you progress in era's troops will naturally start at a higher level, and some buildings can give experience; however, even when I have an army led by a hero for an entire game that is constantly attacking (pacifying villages, taking out roaming armies, attacking troops inside my borders, etc) my highest level troops are typically around 7 by the time the game ends.
Any tips would be greatly appreciated.

A:

pacifying villages, taking out roaming armies, attacking troops inside my borders.
You need to tackle tougher enemies to rack up the experience.
How do you usually win games? Diplomacy?
I play as the Necrophage and am constantly at war with my neighbours, invading and attacking.
The higher level army you fight, the more XP you get.
Honestly it can be a pain in the arse grinding the larger battles but thats how you get the XP you're looking for.


Q:

Can malicious code be inserted into an email?

I'm writing a disposable email script, which parses incoming emails, strips out some data and inserts it into the DB, then displays the email on a page.
What should I be careful of?
For example, I parse the to email, and make sure it's alpha-numeric only (after stripping my domain name, because I only accept alpha-numeric IDs) but is it safe to insert the sender name (after parsing the From: line) into the DB after using mysqli_real_escape_string() and then htmlentities() when displaying it?

A:

Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL.

using pdo.
$statement = $pdo->prepare('SELECT * FROM customers WHERE name = :name');
$statement ->execute(array('name' => $name));
foreach ($statement as $row) {
    // do something with $row
}

using mysqli to prevent the security lapses.
$statement= $dbConnection->prepare('SELECT * FROM customers WHERE name = ?');
$statement->bind_param('s', $name);
$statement->execute();
$result = $statement->get_result();
while ($row = $result->fetch_assoc()) {
    // do something with $row
}

mysqli insertion of data

Code example for insertion clean data.
$preparedStatement = $db->prepare('INSERT INTO table (column) VALUES (:column)');

$preparedStatement->execute(array('column' => $unsafeValue));

Since you ask about insertion here is the method to prevent sql injection by using this method attacker will have no chance for it.

Frameworks security.
A simple way would be to use a PHP framework like CodeIgniter or Laravel which have in-built features like filtering and active-record, so that you don't have to worry about these nuances.
A few guidelines.
For escaping special characters in SQL statements.Don't use MySQL, this extension is deprecated, use MySQLi or PDO.


Q:

Triangular matrices and commutators

From Humphreys' Introduction to Lie Algebras and Representation Theory:

We conclude this subsection by mentioning several other subalgebras of $gl(n,F)$ which play an important subsidiary role for us. Let $t(n,F)$ be the set of upper triangular matrices $(a_{ij})$, $a_{ij}=0$ if $i>j$. Let $n(n,F)$ be the strictly upper triangular matrices ($a_{ij}=0$ if $i\geq j$). Finally, let $o(n,F)$ be the set of all diagonal matrices. It is trivial to check that each of these is closed under the bracket. Notice also that $t(n,F)=o(n,F)+n(n,F)$ (vector space direct sum), with $[o(n,F),n(n,F)]=n(n,F)$, hence $[t(n,F),t(n,F)]=n(n,F)$. (If $H,K$ are subalgebras of $L$, $[H K]$ denotes the subspace of $L$ spanned by commutators $[xy]$, $x\in H, y\in K$.)

I am confused about why $[t(n,F),t(n,F)]=n(n,F)$. If we have two upper triangular matrices $X,Y$, then $XY$ is also upper triangular, and so $XY-YX$ is upper triangular, so it should stay in $t(n,F)$. But I don't see why $XY-YX$ should be strictly upper triangular.

A:

Two things make it easy to see that the commutator of upper triangular matrices is a strictly(1) upper triangular matrix:

diagonal matrices commute,
the product of an upper triangular matrix and a strictly upper triangular matrix is strictly upper triangular.

The multiplication of diagonal matrices amounts to multiplication of corresponding diagonal elements, and since/if multiplication in $F$ is commutative, that entails the commutativity of multiplication in $o(n,F)$.
To see that the product of a strictly upper triangular matrix with an upper triangular matrix is strictly upper triangular (I assume it already known that the product is upper triangular), consider the generic diagonal element of the product,
$$c_{ii} = \sum_{k=1}^n a_{ik} b_{ki} = \sum_{k=1}^i a_{ik}b_{ki} = \sum_{k=i}^i a_{ik}b_{ki} = a_{ii}b_{ii};$$
the first reduction of the range $k$ traverses is because $B$ is upper triangular, hence $b_{ki} = 0$ for $k > i$, the second because $A$ is upper triangular, hence $a_{ik} = 0$ for $k < i$, and that leaves only $a_{ii}b_{ii}$. One of the factors is $0$ since one of $A$ and $B$ is strictly upper triangular by assumption.
Thus, when we have two upper triangular matrices $X$ and $Y$, write them as $X = D_X + S_X,\; Y = D_Y + S_Y$ with diagonal $D_\ast$ and strictly upper triangular $S_\ast$, to find
$$\begin{align}
[X,Y] &= [D_X+S_X,Y] = [D_X,Y] + [S_X,Y]\\
&= [D_X, D_Y + S_Y] + [S_X,D_Y + S_Y]\\
&= [D_X,D_Y] + [D_X,S_Y] + [S_X,D_Y] + [S_X,S_Y]\\
&= [D_X,S_Y] + [S_X,D_Y] + [S_X,S_Y]
\end{align}$$
and all products that remain involve at least one strictly upper triangular matrix, hence are strictly upper triangular.

(1) If the ring of scalars is commutative.


Q:

What is the proper way to do html buttons for submits, cancels, deletes, actions, etc.?

Is there a standard way to code HTML buttons? One way I've been doing some buttons for a long time is to turn links into block-style buttons. I found though, that when I need a submit button and a link-button to look the same, it is very difficult to style.
Also, if I want to follow a more RESTful design, I'll need to pass HTTP DELETE and things like that as well.
Is there a standard way to code all of these buttons and be able to style them all exactly the same way?

A:

No, there isn't a standard way.
However, if you need a button, just use a button. I think you'll also find it easier to style.


Q:

Need help understanding this proof (measure theory related)

This proof comes from a probability book I am reading. I understand most of the proof already. The part I'm stuck on might be simply using properties of the symmetric difference, but I can't figure it out. The statement of the lemma is this:
Suppose that $\mathcal{F}_0$ is an algebra that generates the $\sigma$-algebra $\mathcal{F}$, that is, $\mathcal{F} = \sigma\{\mathcal{F}_0\}$. For any set $A \in \mathcal{F}$ and any $\epsilon > 0$, there exists a set $A_\epsilon \in \mathcal{F}_0$ such that
$$
P(A \bigtriangleup A_\epsilon) < \epsilon.
$$
(The notation $A \bigtriangleup B$ is the symmetric difference between $A$ and $B$, that is, $(A \setminus B) \cup (B \setminus A)$, and $P(A)$ is the probability (measure) of event/set $A$.)
The proof begins by fixing $\epsilon>0$ and creating a set $\mathcal{G}$ defined by
$$
\mathcal{G} = \{A \in \mathcal{F} \mid P(A \bigtriangleup A_\epsilon) < \epsilon \text{ for some $A_\epsilon \in \mathcal{F}_0$}\}
$$
and ultimately showing that $\mathcal{G} = \mathcal{F}$. To do this, the author shows that $\mathcal{G}$ is a $\sigma$-algebra by showing that it is closed under taking complements and taking countable unions. The closure under countable union part is where I am having trouble understanding. The part I don't understand is at the very end.
To show closure under countable union, let $A_n$ be a sequence of sets in $\mathcal{G}$. Set $A = \bigcup_{n=1}^{\infty} A_n$ and choose $n_*$ such that
$$
P(A \setminus \bigcup_{n=1}^{n_*}) < \epsilon.
$$
Next, let $\{A_{k,\epsilon} \subset \mathcal{F}_0, 1 \leq k \leq n_*\}$ be such that
$$
P(A_k \bigtriangleup A_{k,\epsilon})<\epsilon \quad \text{for $1 \leq k \leq n_*$}.
$$
Since
$$
\left( \bigcup_{k=1}^{n_*} A_k \right) \bigtriangleup \left( \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right) \subset \bigcup_{k=1}^{n_*} (A_k \bigtriangleup A_{k,\epsilon}),
$$
it follows that
$$
P\left( (\bigcup_{k=1}^{n_*} A_k) \bigtriangleup (\bigcup_{k=1}^{n_*} A_{k,\epsilon}) \right) \leq \sum_{k=1}^{n_*} P(A_k \bigtriangleup A_{k,\epsilon}) < n_* \epsilon,
$$
so that, finally,
$$
P \left( A \bigtriangleup \left( \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right) \right) < (n_* + 1)\epsilon.
$$
I don't understand where this last inequality comes from. I've tried writing $A = (\cup_{k=1}^{n_*} A_k) \cup (A \setminus \cup_{k=1}^{n_*} A_k)$, but that didn't help.

A:

Note that
$$\begin{align*}
A \bigtriangleup \left( \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right) &= \left(\left(A\setminus\bigcup_{k=1}^{n_*} A_k\right) \bigtriangleup \bigcup_{k=1}^{n_*}A_k\right)\bigtriangleup \left( \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right) \\
&=\left(A\setminus\bigcup_{k=1}^{n_*} A_k\right) \bigtriangleup \left(\bigcup_{k=1}^{n_*}A_k\bigtriangleup  \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right) \\
&\subseteq \left(A\setminus\bigcup_{k=1}^{n_*} A_k\right) \cup \left(\bigcup_{k=1}^{n_*}A_k\bigtriangleup  \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right).
\end{align*}$$
(The first equality uses the fact that if $B$ and $C$ are disjoint then $B\cup C=B\bigtriangleup C$ and the second equality uses the fact that $\bigtriangleup$ is associative.)
Since $$P\left(A\setminus\bigcup_{k=1}^{n_*} A_k\right)<\epsilon$$ and $$P\left(\bigcup_{k=1}^{n_*}A_k\bigtriangleup  \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right)<n_*\epsilon,$$ this gives $$P\left(A \bigtriangleup \left( \bigcup_{k=1}^{n_*} A_{k,\epsilon} \right)\right)<\epsilon+n_*\epsilon=(n_*+1)\epsilon.$$


Q:

Why use in-memory database for integration testing?

I'm really confused when I see a lot of in-memory database implementation used for testing, because I also heard a lot from integration testing best practices that the environment running the test should resemble as closely as possible the production environment, including operating system, library, database engine, etc.
What am I missing here?

A:

In a typical software development situation, tests are used at two points: during development, and before moving the product along the development chain.
The first situation, running tests during development, serves short-term goals: defining tasks (as in TDD: write a failing test, then make it pass), preventing regressions, making sure your changes don't break anything else, etc. Such tests need to be extremely fast: ideally, your whole test suite runs in less than 5 seconds, and you can just run it in a loop next to your IDE or text editor while you code. Any regression you introduce will pop up within seconds. Speedy test runs are more important in this phase than catching 100% of regressions and bugs, and since it is impractical (or outright impossible) to develop on exact copies of the production systems, the effort required to achieve perfect testing here isn't worth it. Using in-memory databases is a trade-off: they are not exact copies of the production system, but they do help keep test runs below the 5-second limit; if the choice is between a slightly different database setup for my database-related testing, and no testing at all, I know what I pick.
The second situation, moving the code along the development chain, however, does require extensive testing. Since we can (and should) automate this part of the development process, we can afford much slower tests - even if a full test run takes hours, scheduling a nightly build still means we always have an accurate picture of yesterday's codebase. Simulating the production environment as accurately as possible is important now, but we can afford it. So we don't make the in-memory-database tradeoff: we install the exact same version of the exact same DBMS as the production systems, and if possible, we fill it with actual production data before the testing begins.

A:

I guess it's a trade-off speed/matching the environnement. Tests should be run often, and that mean they got to be fast. Especially unit tests, which should not take more than a few seconds.
Integration tests will run slower, but when they're fast you can run them more often. For example, before every commit. Of course, it's not as complete as a full environment, but at least you're testing the mapping layer, the generated SQL, how the part talk to each other, etc. In the case of costly database you also ensure that you don't need to buy a licence for everyone. You may catch more error covering 90% of the code with tests ran once per hour than covering 100% of the code testing once per day or worst, week.
That being said, of course you need test with the real database and a fully integrated environment. You may not run those tests as often, but since your previous test already gave you confidence, all that is left is weird platform specific bug.

A:

For doing simple tests, mocking the database access layer is perfectly acceptable.  You call getName(), it calls the DAO thats been mocked and returns "John" for the first name and "Smith" for the last name, assembles them and everything is perfect.  No need to actually unit test a database there.
Things becomes a bit more when logic becomes a bit more complex.  What if you had a method "createOrUpdateUser(...)".  If you mocked the database you can verify that a given method has been called once with a certain parameter when the mock returns no objects and a different method is invoked on the database when it returns back an existing object.  This starts getting to that fuzzy line where it might be easier (especially if it was already there) to spin up a specialized in memory database and test that code with preconfigured data.
In some actual code I worked on (point of sales), we had a resumeSuspededTransaction(...) method.  This would pull the transaction from the database into an object (and its components) and update the database.  We had it mocked and a bug lurked in the code somewhere with the serialization and deserialization of the data going to the database (we changed a type which was serialized differently on the database).
The mock didn't show us the bug because it was returning its happy path - serialize the transaction, store it in the mock, deserialize it from the mock, test that they are equal.  However, when you serialize an object with a leading zero to the database it was dropping them and then recombining it back to a string without the zeros.  We caught the bug without the database through troubleshooting (it wasn't that hard to spot once we knew it was there).
Later, we put a database in there and realized that the bug would have never gotten through that junit test if we were instead going to an in memory database.

In memory databases have the advantages:

they can be spun up quickly (without needing a DBA to set up accounts, tables and such) for testing
the data can be preconfigured for that test
the test doesn't need to worry about rolling back the test when done
each test has its own in memory database so you don't have to worry if two tests are running simultaneously
they can be run on systems that don't have connectivity to the real databases


Q:

RoR: Error when connecting affilinet web services (logon function) using savon (ruby on rails) -> Deserialization Failed

I try to logon at the affilinet web services via the provided logon function. I'm working in a Rails 3 environment (3.0.x). I utilize the ruby on rails gem Savon in version 2 which in turn uses soap to connect to affilinet.
The most current wsdl can be found here https://api.affili.net/V2.0/Logon.svc?wsdl.
My code looks like this:
client = Savon.client do
  wsdl "https://api.affili.net/V2.0/Logon.svc?wsdl"
end
message = {'Username' => 'username', 'Password' => 'password', 'WebServiceType' => 'Publisher'}
response = client.call(:logon, :message => message)

The request generated by Savon:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://affilinet.framework.webservices/Svc" xmlns:ins3="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ins2="http://affilinet.framework.webservices/types" xmlns:ins1="http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF" xmlns:ins0="http://www.microsoft.com/practices/EnterpriseLibrary/2007/01/wcf/validation" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <tns:LogonRequestMsg>
      <tns:Password>password</tns:Password>
      <tns:WebServiceType>Publisher</tns:WebServiceType>
      <tns:Username>username</tns:Username>
    </tns:LogonRequestMsg>
  </env:Body>
</env:Envelope>

When sending this request to the web service I get this (error) response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
      <s:Fault>
        <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode>
        <faultstring xml:lang="en-US">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://affilinet.framework.webservices/Svc:LogonRequestMsg. The InnerException message was 'Error in line 1 position 775. 'EndElement' 'LogonRequestMsg' from namespace 'http://affilinet.framework.webservices/Svc' is not expected. Expecting element 'Username | Password | WebServiceType'.'.  Please see InnerException for more details.</faultstring>
        <detail>
          <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <HelpLink i:nil="true"/>
            <InnerException>
              <HelpLink i:nil="true"/>
            <InnerException i:nil="true"/>
            <Message>Error in line 1 position 775. 'EndElement' 'LogonRequestMsg' from namespace 'http://affilinet.framework.webservices/Svc' is not expected. Expecting element 'Username | Password | WebServiceType'.</Message>
            <StackTrace>   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ThrowRequiredMemberMissingException(XmlReaderDelegator xmlReader, Int32 memberIndex, Int32 requiredIndex, XmlDictionaryString[] memberNames)
 ... (loads more) ...
            </StackTrace>
            <Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type>
          </ExceptionDetail>
        </detail>
      </s:Fault>
    </s:Body>
</s:Envelope>

Any ideas what's wrong?
EDIT:
The request in soapUI looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:svc="http://affilinet.framework.webservices/Svc" xmlns:typ="http://affilinet.framework.webservices/types">

<soapenv:Header/>
<soapenv:Body>
  <svc:LogonRequestMsg>
     <!--Optional:-->
     <typ:Username>username</typ:Username>
     <!--Optional:-->
     <typ:Password>password</typ:Password>
     <typ:WebServiceType>Publisher</typ:WebServiceType>
     <!--Optional:-->
     <typ:DeveloperSettings>
        <!--Optional:-->
        <typ:SandboxPublisherID>?</typ:SandboxPublisherID>
     </typ:DeveloperSettings>
     <!--Optional:-->
     <typ:ApplicationSettings>
        <!--Optional:-->
        <typ:ApplicationID>?</typ:ApplicationID>
        <!--Optional:-->
        <typ:DeveloperID>?</typ:DeveloperID>
     </typ:ApplicationSettings>
  </svc:LogonRequestMsg>
</soapenv:Body>
</soapenv:Envelope>

Maybe the differences in the requests (generated by Savon and by soapUI) are the key!? Especially the different namespaces: svc/typ vs. env/tns. Any ideas? How can I tell Savon to use the svc namespace for the LogonRequestMsg?

A:

Looking into the WSDL of Affili.net it shows that username, password, WebserviceType etc have the wrong namespace.
EDITED for the namespace after another look into your example. Username, Password and WebServiceType are defined in the namespace ins2="http://affilinet.framework.webservices/types" which is tagged by "ins2" in your case.
The quick and dirty way to get over it is
client = Savon.client do
  wsdl "https://api.affili.net/V2.0/Logon.svc?wsdl"
end
message = {'ins2:Username' => 'username',
           'ins2:Password' => 'password',
           'ins2:WebServiceType' => 'Publisher'}

response = client.call(:logon, :message => message)


Q:

Microcontroller to Beaglebone data handling

I have an STM32F0 microcontroller wich is controlling an RS-485 bus interface. The sensors on this bus are providing 220 bytes of data every millisecond.
I want to get the data from the microcontroller to an Beaglebone black so I can store the data in files and FTP them to an server.
The problem here is I have only an gap of 200-300 usec for sending data and I can buffer max 2200 bytes on the STM32.
I tried to send the data over SPI interface, but the Beaglebone can only work master mode so I cant use DMA or a buffer on the Beaglebone. I also tried it with interrupts but they have an respond time form 1-3 milliseconds.
The SPI from the STM is max working on 24MHz which is fast enough to handle the data in the 200 usec.
Does anyone know a way in the form of an hardware buffer or something like that between these two devices. I prefer someone which communicates with SPI.
I tried an SD card already but I think it is to slow.
Thanks in advance,

A:

One method is to use the programmable real-time units in the Beaglebone. These let you run code independent from the main OS, thus avoiding things like the long interrupt latency. The SPI block only functioning in master mode appears to be an OS driver limitation, the hardware should be capable of it.


Q:

Shortcut keys don't work in Eclipse when I change keyboard language

When I change my keyboard layout from En to another language (Persian), the shortcut keys do not work in the new language.
For example ctrl+s didn't save my edit in a text file.

A:

This longstanding bug "Shortcut keys doesn't work with Arabic and other non-English keyboard", which affected all non-Latin keyboard layouts, has now been fixed as of version 4.7.2.
However, the version of Eclipse in the repositories is out of date, so you will need to install the latest version, which is available from the Eclipse website, and not by using the package manager.
More help on installing this way is also available here.


Q:

Calculation in Javascript returns NaN

I am trying to calculate in Javascript. But the script is returning NaN.
I have tried to convert the data with number, parseInt and parseFloat but it was not succesfull.
Does someone know what is wrong with my script?
Here is my Javascript
$('[id^=neg_pos]').each( function( i, e) {
  var quantity = e.options[e.selectedIndex].value;

  if ( quantity==='0') {

  } else if ( quantity==='1') {
    var num1 = Number(document.getElementsByName('price[]').value);
    var num2 = Number(document.getElementsByName('tax[]').value);

    var tv1 = num1 + num2;
    pos += tv1;

  } else {
    var num1 = Number(document.getElementsByName('price[]').value);
    var num2 = Number(document.getElementsByName('tax[]').value);

    var tv1 = num1 + num2;
    neg += tv1;
  }

document.getElementById('positive').value = pos.toFixed(2);
document.getElementById('negative').value = neg.toFixed(2);

});

The textboxes price[] and tax[] are dynamic textboxes that are created in Javascript.
Here are the textboxes:
The first textboxes are created in HTML:
<input type="text" name="price[]" id="price1" onkeypress="return isNumber(event, this)" data-srno="1">
<input type="text" name="tax[]" id="tax1" onkeypress="return isNumber(event, this)" data-srno="1">

The other textboxes are created in Javascript
$(document).on('click', '#add_row', function(){
  count++;
  $('#total_item').val(count);
  var html_code = '';
  html_code += '<input type="text" name="price[]" id="price'+count+'" onkeypress="return isNumber(event, this)" data-srno="'+count+'">';
  html_code += '<input type="text" name="tax[]" id="tax'+count+'" onkeypress="return isNumber(event, this)" data-srno="'+count+'">';

  $('#test').append(html_code);
});

A:

You should use document.getElementById() instead, like so:
var num1 = Number(document.getElementsByName('price[]').value);
var num2 = Number(document.getElementsByName('tax[]').value);

The reason was you were trying to access the value property of the array returned by getElementsByName, which doesn't exist - you would have had to use [0] first, to access the element itself.


Q:

History -c, where all the erased histories have been saved and in which directories though?

Usually, when i used (root@example ~ #  history )and it displayed a lot of commands which had been entered before. So, my question is : when i enter "history -c" is to delete all the history at the Unixprompt and where all those histories commands have been saved? which command should I enter to know where all those history command have been saved and in which directory?

A:

The bash command history will be saved in the location specified by the $HISTFILE environment variable. Normally it will be in ${HOME}/.bash_history.

A:

It is usually in the .bash_history file located in the home directory
For the root, .bash_history is located in the /root folder.
You may use
#find / -type f -name .bash_history #Run as root

to see the .bash_history files for all users.


Q:

Neo4j integration test failing on EOFException when using data fixtures

I'm building a Neo4j (2.2.3) unmanaged extension and trying to run integration tests. Following the example in the docs, I have:
@Test
public void testInsertInitiative() throws Exception {
    try ( ServerControls server = TestServerBuilders.newInProcessBuilder()
        .withExtension("/graph/initiative", InitiativeController.class)
        .withFixture(TestFixtures.foobar(x, y, z))
        .newServer() )
    {
        HTTP.Response response = //... I can't get this far...
    }
}

However, whenever I include a data fixture, the test fails to initialize on a:
java.io.EOFException: No content to map to Object due to end of input
at org.neo4j.harness.internal.Fixtures.ensureInstallSuccessful(Fixtures.java:127)
at org.neo4j.harness.internal.Fixtures.applyTo(Fixtures.java:110)
at org.neo4j.harness.internal.InProcessServerBuilder.newServer(InProcessServerBuilder.java:75)
at org.mycompany.myproject.MyTestClass.myTest(MyTestClass.java:87)

If I comment out the inclusion of the fixture, the test runs as expected, so the problem is definitely there (also deducible from the stack trace...). I've verified that my TestFixtures method generates a valid cypher statement by c/p'ing it into the console and executing it there successfully. I've also tried replacing it with a simple
.withFixture("CREATE (:foo)")

and had the same result.
This is happening both in version 2.2.3 and 2.2.2, and happens with or without loading my extension.
Following the debug trail down a couple of layers, I've found that the response received by the call to ClientResponse response = client.handle( req ) at line 109 in /harness/internal/Fixtures.java has a status of Server Error and an empty entity, which I assume is resulting in the EOF...
But why the server error? Again, I c/p'd the payload from the call made by the client there and posted it (successfully) to a non-test server.
Here are my pom dependencies:
<properties>
    <java.version>1.7</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <neo4j.version>2.2.3</neo4j.version>
</properties>
<dependencies>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>${neo4j.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j.app</groupId>
        <artifactId>neo4j-server</artifactId>
        <version>${neo4j.version}</version>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.neo4j.test</groupId>
        <artifactId>neo4j-harness</artifactId>
        <version>${neo4j.version}</version>
        <scope>test-jar</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.7</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.googlecode.lambdaj</groupId>
        <artifactId>lambdaj</artifactId>
        <version>2.3.3</version>
    </dependency>

</dependencies>

A:

Getting rid of this dependency will make the test pass in your SSCCE:
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>


Q:

OpenGL ES 2.0 Buffer Setup

I noticed that if I bind my depth buffer before the color buffer, the application works as intended:
glGenRenderbuffers(1, &_depthbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, _depthbuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, _sw, _sh);
glGenRenderbuffers(1, &_renderbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, _renderbuffer);
[_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:_eaglLayer];

However, binding the depth buffer afterwards causes nothing to render, even my glClearColor setting is ignored:
glGenRenderbuffers(1, &_renderbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, _renderbuffer);
[_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:_eaglLayer];
glGenRenderbuffers(1, &_depthbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, _depthbuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, _sw, _sh);

I've gotten to understand some of the flow of how OpenGL ES 2.0 works by researching the individual components thoroughly, but this seems as if it's the only thing that everyone just does in their tutorials/books, but doesn't explain why. Any ideas? Is this even an issue, or possibly something wrong in the rest of my setup? (if so I'll include all the code)
EDIT
@cli_hlt - the depth buffer is already being added to the framebuffer:
glGenFramebuffers(1, &_framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, _framebuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, _depthbuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _renderbuffer);

EDIT
Depth bound before:

Depth bound after:

A:

I may be totally wrong—I'm just getting a handle on this stuff myself—but as I understand it, glBind commands only tell OpenGL which renderbuffer/texture/whatever to use for subsequent functions. It's a weird model if you're used to object-oriented programming. In the boilerplate setup code you have to bind the buffer you created to the GL_RENDERBUFFER "slot" so the next glRenderbufferStorage() or -[EAGLContext renderbufferStorage:fromDrawable:] call knows what buffer to use. I think the problem is just that you're not binding the active GL_RENDERBUFFER back to your color buffer before you're calling -[EAGLContext presentRenderBuffer:], so you're actually showing the depth buffer. Adding
glBindRenderbuffer(GL_RENDERBUFFER, _renderbuffer);

before the presentRenderBuffer: call should fix this. …I think.


Q:

Custom Port on VorlonJS

I try to use VorlonJS to debug on remote devices. However it uses the Port 1337 which I am using for LiveReload to my Grunt Tasks. I can configure it Grunt Side but in the Vorlon Side Is there any options? I couldn't see it on Docs

A:

For now there is no options as vorlon --port=1234
But, We can with;
unix shell:
$ PORT=1234
More permanently:
$ export PORT=1234
In Windows:
set PORT=1234
In Windows PowerShell:
$ env:PORT=1234


Q:

jQuery dialog window with PHP input

The scenario I have on my hands is that I have a PHP generated table with multiple rows fetched from a database displayed on a page. Each row has a unique ID. I would like to be able to add the functionality to edit each row.
So far I am using the dialog from this website to create the dialog pop up which works with a static button (exactly how it works in the Animated example).
Simply put, I want to be able to click anywhere in the row to trigger the dialog, and pass the unique ID using jQuery to a PHP file to generate the content for the dialog.
So far here is my attempt at the content to display within the dialog.

To simply sum it up my problem, I can't get row to trigger a dialog even when I add
...
 it still doesn't open and the other problem passing a unique ID (named $db_id in the PHP script that generates each row into the AJAX script triggered by opening the dialog.
Thanks in advance!
Edit: It would probably be worth noting that I know extremely little about javascript/jQuery so please explain anything relating to it in the most simplest terms with given examples is possible! :)

A:

Assume you have the following html table on your page:

        one
        two
        three

        three
        four
        five

You can use the following to listen to the click events on any of the rows:
$( "#opener" ).on("click", "tr", function() {
    var id = $(this).attr('id');
    var dataString = 'id=' + id;

    alert(id);
});

In this case any click events on the "tr" elements will bubble up to the table with id of "opener".  Inside the event handler, this will refer to the element that was clicked so you can get the id of the row.  Note that you can also use the .click event as well, however the table has to exist in the DOM at the time the .click event is created.  Using the above will also work if you generate the table after you wire up the event.
Also, When making the AJAX call to your PHP page, I would use something like this:
$.ajax({
    url: edit.php,
    type: "POST",
    data: {
        id: id
    },
    success: function(response) {
        $('.ui-dialog-content').html(response);
    }
});

Then in PHP you should be able to access the id using:
$rowid = null;
if(isset($_POST["id"])) {
    $rowid = $_POST["id"];
}

A:

You can use custom data attributes in tags to store whatever info you need:

  ...

and the corresponding javascript:
$(document).ready(function() {
  $('.row').click(function() {
    var id = $(this).attr('data-id');
    console.log(id); // print the ID to the console
    // or send the ID to your php script (where you'll run
    // int_val() to verify it's an integer!)
  });
});

That solves the span / ID problem.
I would listen for any click on the
 via the sample code above. Give it a class or give the parent wrapper a class and listen for clicks on the .parent-class tr. I can revise this to be more helpful if you need.


Q:

jQuery-UI dialog current height and width

I want to show the current height and width of jQuery-UI dialog in real time inside dialog box. How can I do the same. I mean if I increase the height by dragging then current height will be updated.
Thanks

A:

Try this out: http://jsfiddle.net/bryanjamesross/ngrkf/
Should be enough to get you started. What you're looking for mainly is the resize event of the jQueryUI dialog.
Check docs here: http://jqueryui.com/demos/dialog/#event-resize

HTML:

    Width:

    Height:

JavaScript:
$('#dlg').dialog({
    resize: function(e,ui) {
        $('#w').text(Math.round(ui.size.width));
        $('#h').text(Math.round(ui.size.height));
    }
});


Q:

Changing a programs process name in task manager?

Okay so I've been looking around and I can't find an answer anywhere.
What I want my program to do is every time I run it, the name that shows up in the task manager is randomized.
There is a program called 'Liberation' that when you run it, it will change the process name to some random characters like AeB4B3wf52.tmp or something. I'm not sure what it is coded in though, so that might be the issue.
Is this possible in C#?
Edit:
I made a sloppy work around, I created a separate program that will check if there is a file named 'pb.dat', it will copy it to the temp folder, rename it to a 'randomchars.tmp' and run it.
Code if anyone was interested:
private void Form1_Load(object sender, EventArgs e)
{
    try
    {
        if (!Directory.Exists(Environment.CurrentDirectory + @"\temp")) // Create a temp directory.
            Directory.CreateDirectory(Environment.CurrentDirectory + @"\temp");

        DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory + @"\temp");

        foreach (FileInfo f in di.GetFiles()) // Cleaning old .tmp files
        {
            if (f.Name.EndsWith(".tmp"))
                        f.Delete();
        }

        string charList = "abcdefghijklmnopqrstuvwxyz1234567890";
        char[] trueList = charList.ToCharArray();
        string newProcName = "";

        for (int i = 0; i < 8; i++) // Build the random name
            newProcName += trueList[r.Next(0, charList.Length)];

        newProcName += ".tmp";

        if (File.Exists(Environment.CurrentDirectory + @"\pb.dat")) // Just renaming and running.
        {
            File.Copy(Environment.CurrentDirectory + @"\pb.dat", Environment.CurrentDirectory + @"\temp\" + newProcName);
            ProcessStartInfo p = new ProcessStartInfo();
            p.FileName = Environment.CurrentDirectory + @"\temp\" + newProcName;
            p.UseShellExecute = false;
            Process.Start(p);
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show("I caught an exception! This is a bad thing...\n\n" + ex.ToString(), "Exception caught!");
    }

    Environment.Exit(-1); // Close this program anyway.
}

A:

I would implement a host application to do this that simply runs and monitors a sub process (other executable). You may rename a file as such:
System.IO.File.Move("oldfilename", "newfilename");

and start the process like this:
Process.Start("newfilename");

This would mean that instead of one process you would have two, but the owner process only needs to be alive under startup - in order to change the name.


Q:

Classic ASP - Use Ajax to submit enquiry form without refresh

I've had a look through Google etc but can't find anything for what I'm after so asking my fellow SE members for a little help.
I have a form which is contained on my page and is consistent throughout the site. I would like to submit the enquiry form without the page refreshing which is the normal route with Classic ASP.
I have a separate ASP page that contains my mail script and that works fine and sends the email, however I would like to use Ajax to call that page, send the email and then inform the user that its been sent.
Any help would be appreciated.

A:

Classic ASP, ASP.NET, PHP or any other dynamc language, its all the same as what you're really doing is FORM POST ing, and that's HTML, not actually ASP.
Assuming that you have a form like
<form id="frm-submit" action="/SendEmail.asp" action="POST">

   ...

   <input type="submit" value="Submit form" />
</form>

add a little jQuery to the page as
$(function() {

   $("#frm-send").submit(function() {
      var data = $(this).serialize(),
          action = $(this).attr("action"),
          method = $(this).attr("method");

      $(".loading").show(); // show loading div
      $.ajax({
         url: action,
         type: method,
         data: data,
         success: function(data) {
             // all went well...
         },
         error: function(err) {
             // there was something not right...
         },
         complete: function() {
            $(".loading").hide(); // hide the loading
         }
      });

      return false; // don't let the form be submitted
   });

});

and you're ready to go.

in your sendMail.asp page, everything you send to Response.Write will be in the data variable of the success method, so after you send the email you have:
Response.Write("done")
Responde.Flush()
Response.End()

in the javascript part, you can handle it like:
success(data) {
    if(data === "done")
    {
       // Super duper! let's show the user a Thank you for submit page
       document.location = "/ThankYou.asp";
    }
}


Q:

How to get VisualStudio 2010 cool tools without spending $12,000

We are a small dev shop with 10 people, 3 of whom are currently doing .Net. The new VisualStudio 2010 tools look really nice, and we would like to use them - but it seems that many of them (historical debugging, UML tools, testing stuff) are only going to be available in the Ultimate Edition. And that costs $12,000. Or nearly forty grand for the three of us.
(See here for details).
Given that the architectural visualisation tools seem to be lifted straight from NDepend, which cost around €250 each (and is excellent), we just can't justify that sort of spending.
Now, we have a normal MSDN professional subscription, but that only got us one VS Team System, and I assume will not get us three 2010 Ultimates. Given that we have no use for the whole Team Foundation Server stuff, and just want the dev tools, what can we do?
EDIT:
Here is a list of the dev tools (leaving database and "testing lab" tools for another question) which are missing from the "Professional" version. An asterisk (*) means that the feature is in the "Premium" edition, no asterisk means only available in "Ultimate". What are the non-multi-thousand-dollar alternatives?

Testing:
Code Coverage   (*)
Test Impact Analysis   (*)
Coded UI Test   (*)
Web Performance Testing
Load Testing
Debugging & Diagnostics:
Static Code Analysis   (*)
Code Metrics   (*)
Profiling   (*)
IntelliTrace (Historical Debugger)
Architecture and Modeling:
UML & Layer diagram viewer   (*)
Architecture Explorer
UML 2.0 Compliant Diagrams (Activity,
Use Case, Sequence, Class, Component)
Layer Diagram and Dependency
Validation

A:

If you're a small dev shop, Microsoft will give you the full version of VS (and then some) for a few years. Check out the BizSpark program.

A:

Like you've said, some of the tools are just copies of other tools that are already available in the market. If I were in your position I'd be looking at getting a version of Visual Studio that's covers all the basics a professional .net developer needs and then look at alternative tools. There are heaps of great open source and commercial tools that do an excellent job for free or for a reasonable price.
The best part about third party tools, in my opinion, is that they tend to be able to improve and adapt quicker than the standard Visual Studio release cycle. Things like continuous integration servers, unit testing frameworks, mocking/isolation frameworks, source control etc are often best done by third party tools so that as things change in the industry you can adapt your tools without having to wait for Microsoft.

A:

Either you need the tools aand they'll pay for themselves in productivity. Or they are a would like to have. If the latter then you should consider what you absolute requirements are and start from there.
Besides 2010 isn't out yet so you have time to evaluate other solutions.


Q:

Get source jar files attached to Eclipse for Maven-managed dependencies

I am using Maven (and the Maven Eclipse Integration) to manage the dependencies for my Java projects in Eclipse. The automatic download feature for JAR files from the Maven repositories is a real time saver. Unfortunately, it does not include API documentation and source code.
How can I set up Maven to automatically also get the source and javadoc attachments and register them properly with Eclipse?

A:

I am sure m2eclipse Maven plugin for Eclipse - the other way around - can do that. You can configure it to download both the source files and javadoc automatically for you.
This is achieved by going into Window > Preferences > Maven and checking the "Download Artifact Sources" and "Download Artifact JavaDoc" options.

A:

mvn eclipse:eclipse -DdownloadSources=true

or
mvn eclipse:eclipse -DdownloadJavadocs=true

or you can add both flags, as Spencer K points out.
Additionally, the =true portion is not required, so you can use
mvn eclipse:eclipse -DdownloadSources -DdownloadJavadocs

A:

The other answers on this work, but if you want to avoid having to remember command line arguments, you can also just add to the downloadSources and downloadJavadocs config to the maven-eclipse-plugin section of your pom.xml:
<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                    ... other stuff ...
                </configuration>
            </plugin>
        </plugins>
    </build>
    ...
</project>


Q:

PHP version of CSS Media Queries

Can't find anything on the web for this, wanted to throw the question out there.
Is the a PHP version of CSS Media Queries?

A:

I'm under the assumption that you would want to do this for the purpose of detecting mobile browsers - if not, then this answer is slightly irrelevant.
You can check out Mobile ESP for a mobile User Agent detection library. It's very simple to use and works well in my experiences.


Q:

Can not run service on Windows

When I start "F5" in a project in Visual Studio 2015, the program show me the message:

Can not you start the service from the command line or in the
  debugger. The windows service must be installed 's First (using
  installutil.exe ) and then started with ServerExplorer , the
  administrative tool for Windows Services or the NET START command"

How can I resolve these?

A:

An alternative approach is to do it the way Windows Services were traditionally debugged.

Install the service (I set up a External Tool entry in VS to do this)
Run the service via the SCM
Attach the debugger (VS) to the running process - perform your debugging session
Stop and uninstall the service (I have a External Tool entry in VS for this as well)


Q:

socket.io not sending connect message to client on flashsocket

I'm using node.js server with socket.io plugin to connect between two clients (flash and js) on different devices
for the flash integration I'm using the FlashSocket.IO library
and have io.set('transports', ['websocket', 'flashsocket']); on my .js server file
while everything works fine in most of the computers - on some computers (I don't know if it's relevant but both of the computers that I checked are running Windows 8) - the connection doesn't work
when enabling debug on the server I see that for the working clients the server send 1:: message and for the not-working clients - it doesn't
this is part of the log for working client:
  debug - client authorized
  info  - handshake authorized 8JVqPB6MuJYJeMR3RVN_
  debug - setting request GET /socket.io/1/flashsocket/8JVqPB6MuJYJeMR3RVN_
  debug - set heartbeat interval for client 8JVqPB6MuJYJeMR3RVN_
  debug - client authorized for
  debug - flashsocket writing 1::
  connected - //my console.log call on io.sockets.on('connection', ...
  debug - flashsocket received data packet 5:0+::{"args":"7087623252","name":"register"}

and for the not working client:
  debug - client authorized
  info  - handshake authorized 0nztNzwvw260Pa-bRHef
  debug - setting request GET /socket.io/1/flashsocket/0nztNzwvw260Pa-bRHef
  debug - set heartbeat interval for client 0nztNzwvw260Pa-bRHef
  debug - client authorized for
  connected - //my console.log call on io.sockets.on('connection', ...

p.s.
it doesn't seem like a firewall issue - even when the firewall is off the problem keeps happening
Thank You!

A:

Eventually it was an antivirus related issue
one second before I got insane I found that the Avast that was installed on that computer blocked the connection - when the Web Shield was disabled - everything worked like a charm
(Installing the same Antivirus on my Win7 machine didn't reproduced the problem - maybe that was Win8+Avast issue)
Thanks anyway


Q:

JQuery droppable functionality doesn't work

I want to create an application that drops certain elements on other elements, using jquery library. The draggable feature seems to be working, but the droppable feature doesn't work. I tried to assign id to draggable and droppable, because it solved someone's problem (the solution for that person's problem was to change the library(the problem was the library)), which is similar to mine. I used jquery library and js (modified js embeded in the html document with it's code listed bellow) from here: http://superdit.com/2011/04/02/drag-drop-shopping-cart-using-jquery/. I would say again that everything works except the droppable feature.
Any help would be great! Thank you!
(Below is the html code (which includes js) and the css):

    Repartiţia electronilor pe orbitali, straturi şi substraturi pentru primele 36 de elemente

//superfunctia
function activateApp() {
    var infoSelected = document.getElementById("option_selected_text");
    var element= new Array();

    element[0]="";
    element[1] = "Hidrogen";
    element[2] = "Heliu";
    element[3] = "Litiu";
    element[4] = "Beriliu";
    element[5] = "Bor";
    element[6] = "Carbon";
    element[7] = "Azot";
    element[8] = "Oxigen";
    element[9] = "Fluor";
    element[10] = "Neon";
    element[11] = "Sodiu";
    element[12] = "Magneziu";
    element[13] = "Aluminiu";
    element[14] = "Siliciu";
    element[15] = "Fosfor";
    element[16] = "Sulf";
    element[17] = "Clor";
    element[18] = "Argon";
    element[19] = "Potasiu";
    element[20] = "Calciu";
    element[21] = "Scandiu";
    element[22] = "Titan";
    element[23] = "Vanadiu";
    element[24] = "Crom";
    element[25] = "Mangan";
    element[26] = "Fier";
    element[27] = "Cobalt";
    element[28] = "Nichel";
    element[29] = "Cupru";
    element[30] = "Zinc";
    element[31] = "Galiu";
    element[32] = "Germaniu";
    element[33] = "Arsen";
    element[34] = "Seleniu";
    element[35] = "Brom";
    element[36] = "Kripton";

    var simbol = new Array();

    simbol[0] = "";
    simbol[1] = "H";
    simbol[2] = "He ";
    simbol[3] = "Li";
    simbol[4] = "Be";
    simbol[5] = "B";
    simbol[6] = "C";
    simbol[7] = "N";
    simbol[8] = "O";
    simbol[9] = "F";
    simbol[10] = "Ne";
    simbol[11] = "Na";
    simbol[12] = "Mg";
    simbol[13] = "Al";
    simbol[14] = "Si";
    simbol[15] = "P";
    simbol[16] = "S";
    simbol[17] = "Cl";
    simbol[18] = "Ar";
    simbol[19] = "K";
    simbol[20] = "Ca";
    simbol[21] = "Sc";
    simbol[22] = "Ti";
    simbol[23] = "V";
    simbol[24] = "Cr";
    simbol[25] = "Mn";
    simbol[26] = "Fe";
    simbol[27] = "Co";
    simbol[28] = "Ni";
    simbol[29] = "cu";
    simbol[30] = "Zn";
    simbol[31] = "Ga";
    simbol[32] = "Ge";
    simbol[33] = "As";
    simbol[34] = "se";
    simbol[35] = "Br";
    simbol[36] = "Kr";

infoSelected.innerHTML = "Element: "+""+element[val.value]+""+"      "+"Simbol: "+""+simbol[val.value]+"";
$( ".electron_1" ).draggable({
    revert: true
});
$( ".electron_2" ).draggable({
    revert: true
});
$("#up_spin").droppable({
    accept: ".electron_1",
    activeClass: "drop-active",
    hoverClass: "drop-hover",
    drop: function(event,ui) {
        var elect1 = ui.draggable.html();
        var upid = ui.draggable.attr("id");
        var html = '
';
            html = html + '
';
            html = html + '×';
                html = html + elect1+'
';
                $("#up_spin").append(html);
    }
});

$("#down_spin").droppable({
    accept: ".electron_2",
    activeClass: "drop-active",
    hoverClass: "drop-hover",
    drop: function(event,ui) {
        var elect2 = ui.draggable.html();
        var downid = ui.draggable.attr("id");
        var html = '
';
                html = html + '
';
                html = html + '×';
                html = html + '
'+elect2+'
';
                $(".down_spin").append(html);
    }
});

}
</script>

  Cum se repartizează electronii pe orbitali, straturi şi substraturi

   Structura învelişului electronic

   Help(?)

 4p

 3d

 4s

 3p

 3s

 2p

 2s

 1s

 Z =

 <select id="val" name="val">
<option value="1" selected="selected">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
 </select>

 <input type="button" name="Submit" value="Start" class="confirmed" onclick="activateApp();"/>
 <input type="button" name="Submit" value="Resetare" class="erase" onclick="checkForm();"/>

// CSS

body {
    font-family: Arial, "Free Sans";
    margin: 0;
    padding: 0;
 }
#main {
//  position: fixed;
    background: #25bcde;
    margin-top: 0;
    padding: 2px 0 6px 0;
    text-align: center;
    border-bottom: solid 1px #118090;
}
#main a {
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    font-family: Arial;
}
#main a:hover {
    text-decoration: underline;
}

#config_container {
    width: 750px;
    margin: 0 auto;
    margin-top: 20px;
    margin-bottom: 10px;
}

#axis {
//  margin-left: 200px;
    margin-top: 0px;
    padding: 5px 0 5px 0;
    float: left;
}

.clear {
    clear:both;
}

.confirmed {
    display: inline;
//  position: absolute;
    background: #25bcde;
    width: 120px;
    height: 24px;
    margin-left: 10px;
    margin-right: 10px;
    text-align: center;
    float: left;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    font-family: Arial;
    text-decoration: underline;
    cursor: pointer;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    box-shadow: 0 1px 2px rgba(0,0,0,.5);
    border: 2px solid #25bcde;
    -webkit-border-radius: 2em;
    -moz-border-radius: 2em;
    border-radius: 2em;
    z-index: 9;
}

a:hover *.confirmed {
    font-style: italic;
}

.erase {
    display: inline;
//  position: absolute;
    background: #25bcde;
    width: 100px;
    height: 24px;
    margin-left: 5px;
    text-align: center;
    float: left;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    font-family: Arial;
    text-decoration: underline;
    cursor: pointer;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    box-shadow: 0 1px 2px rgba(0,0,0,.5);
    border: 2px solid #25bcde;
    -webkit-border-radius: 2em;
    -moz-border-radius: 2em;
    border-radius: 2em;
    z-index: 9;
}

a:hover *.erase {
    font-style: italic;
}

#orbital_container {
    display: block;
//  position: relative;
    width: 670px;
    margin-left: 5px;
    margin-top: 12px;
//  margin-bottom: 10px;
//  clear: right;
}

#orbital_content {
    display: table;
    margin-bottom: 20px;
}

.orbital_label {
    display: inline;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
    float: left;
    color: #6099cc;
    padding: 6px;
    margin-right: 14px;
}

.electron_pear {
    display: inline;
}

#up_spin {
    background: #ef7812;
    display: inline;
    float: left;
//  padding: 4px;
    margin: 0px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    box-shadow: 0 1px 2px rgba(0,0,0,.5);
    z-index: 0;
}

#down_spin {
    background: #ef7812;
    display: inline;
    float: left;
//  padding: 4px;
    margin: 0px;
    margin-right: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.5);
    box-shadow: 0 1px 2px rgba(0,0,0,.5);
    z-index: 0;
}

#control_container {
//  position: relative;
//  display: inline;
    width: 500px;
    float: right;
//  text-align: center;
}

#settings_container {
    display: block;
//  position: relative;
}

#settings_content {
    display: table;
}

.z_text {
    display: inline;
//  position: absolute;
    margin-right: 5px;
    background-color: #fefefe;
    float: left;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    font-family: Arial;

}

#val {
    display: inline;
//  position: absolute;
    margin-right: 10px;
    float: left;
//  font-size: 16px;
    font-weight: bold;
    z-index: 0;
}

.electron_1 {
    background-color: #ef7812;
    background-image: url('images/arrow-up.png');
    background-repeat:no-repeat;
    background-position: center bottom;
    display: inline;
    margin-left: 10px;
    margin-top: -5px;
    float: left;
    width: 29px;
    height: 29px;
//  font-size: 16px;
    cursor: pointer;
    z-index: 5;
}

.electron_2 {
    background-color: #ef7812;
    background-image: url('images/arrow-down.png');
    background-repeat:no-repeat;
    background-position: center bottom;
    display: inline;
    margin-left: 10px;
    margin-right: 10px;
    margin-top: -5px;
    float: left;
    width: 29px;
    height: 29px;
//  font-size: 16px;
    cursor: pointer;
    z-index: 5;
}

#option_selected_text {
    display: inline;
    margin-top: 5px;
    width: 480px;
    height: 16px;
    float: left;
//  text-align: left;
    font-size: 16px;
    font-weight: bold;
    color: #3e3e3e;
}

.drop-active {
    background-color: #68bf32;
}

.drop-hover {
    background-color: #32bf32;
}

.up_dropped {
    cursor: default;
}

.delete_mark {
    text-align: right;
    font-size: 3px;
}

A:

There are inconsistencies between your two draggable handlers, in the last line for the second one you use a class selector ".down_spin", where everywhere else you used id selector "#down_spin".
The other big problem is that no two DOM elements should have the same id in your document, try changing all up_spin and down_spin elements to have a class by those names and change your id selectors to class selectors. Make sure you make up your mind wether you want to use classes or ids by the above rules, as you use id in your static markup, but classes in your droppable handler's html injection.
Also in your down_spin draggable handler remove the '' bit from your html string concatenation, you haven't got it in the up_spin handler, and it's not right anyway.
And if you're using jQuery, it's best to be consistent and use it everywhere, change:
infoSelected.innerHTML = "Element: "+""+element[val.value]+""+"      "+"Simbol: "+""+simbol[val.value]+"";

to:
$(infoSelected).html("Element: "+""+element[val.value]+""+"      "+"Simbol: "+""+simbol[val.value]+"");

After all these clean-ups, it might just magically start working.


Q:

What does it mean to share code between server and client in Javascript?

I will be honest in saying that I did not quite understand one concept while digging into NodeJS. And this concept is about how NodeJS lets us share code between the server and client. What does this really mean? Does it mean that I can write a function that I perhaps call on the client side and it gets invoked as a remote method or does it mean that the code gets copied onto the client side and gets executed?
Can someone give me some intuitive example that I can wrap my head around with?

A:

It simply means that the code that is used on the server side can also be included as <script>s in the HTML, where applicable. The real challenge is finding opportunities where it is applicable.
One example is an input validation engine. We all know that only validation performed on the server is reliable, but client-side validation is still desirable for user experience. If a validation engine is designed in a generic enough fashion, the same code can be used on both client and server sides, avoiding a lot of duplicate effort.
Other examples include HTML templating libraries, data models, and various utility libraries such as underscore.js.


Q:

How do I define my CSS to display 'HelveticaNeue-Light' using Pixate Framework?

Clearification! This question is about the iOS framework Pixate (http://www.pixate.com), and not regular CSS inside of a UIWebView.
Code in default.css :
.title {
 font-family: 'Helvetica Neue';
 font-weight: light;
 font-size: 30px;
 color: #005284;

}
Code in view:
UILabel *label = [UILabel new];
label.styleClass = @"title";

Result when logging:
<UICTFont: 0x10d09e210> font-family: "HelveticaNeue-UltraLight"; font-weight: normal; font-style: normal; font-size: 30.00pt

When I try font-weight: medium; I get HelveticaNeue-Medium
When I try font-weight: 300; I get HelveticaNeue-UltraLight
When I try font-weight: 400; I get Helvetica Neue
When I try font-family: 'HelveticaNeue-Light'; I get .HelveticaNeueInterface-M3 ??? (I guess this is the default system font)
If I set the font  through code with
label.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:30];

It looks as it should, (and the log says HelveticaNeue-Light)
Here a screenshot. The one of the left is when using code, and the one on the right is when using Pixate with `font-family: 'HelveticaNeue-Light'

How do I get 'HelveticaNeue-Light' (like the one on the left in the screenshot above) using Pixate CSS ?

A:

This works on Mavericks and my iOS 7 simulator. Don't know about others.
.title {
    font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
    font-size: 30px;
    color: #005284;
}

Here is my test code:

Hello, World!

Hello, World!

And the result in Safari http://s.swic.name/TpEP

A:

You found a bug in Pixate and it has been fixed for Pixate Framework 2.1.


Q:

What is the DFT of a pure cosine wave cos(θ)

I want to find a DFT of a pure cosine wave cos(θ) sampled at N equally spaced points on the interval $[0, 2\pi)$
so for our cosine wave, I put my $x$ like this

$x=cos(\phi)$

then I just put it in DFT formula

$X[k]=\sum \cos(\phi)^{−j2\pi kn/N}$

and use euler furmula

$\cos(\theta) = (e^{j\theta} + e^{-j\theta})/2$

now we have

$X[k]=\sum(e^{j\theta} + e^{-j\theta})/2.(e^{−j2\pi nk/N})$

mathematically we can move 1/2 before  $\sum$ and separate the $\sum$ like down(because we have + )

$X[k]=1/2\sum(e^{j\theta})(e^{−j2\pi nk/N})+1/2\sum(e^{-j\theta})(e^{−j\pi nk/N})$

know I do not know if I doing this right or not!?
and what should I do next?

A:

If you want to take DFT of a cosine wave $cos(\theta)$ sampled at N equally spaced values between $[0, 2\pi]$, then you need to consider taking N-point DFT of the sequence : $$x[n] = cos[2\pi \frac{n}{N}], n = 0,1,2,...,N-1$$
$cos(\theta)$">
And, for this $x[n]$, you dont even have to apply the DFT formula. It can be done pretty simply by using the Euler's formula $$cos(\theta) = \frac{e^{j\theta} + e^{-j\theta}}{2}$$.
$$x[n] = cos[2\pi \frac{n}{N}] = \frac{e^{j2\pi\frac{n}{N}} + e^{-j2\pi\frac{n}{N}}}{2} = \frac{e^{j2\pi\frac{n}{N}} + e^{j2\pi\frac{n.(N-1)}{N}}}{2}$$
Now, see the above expression as Invere DFT and figure out that $X[k]$ will be non-zero only for 2 values of $k$, i.e. $k=1$ and $k= (N-1)$. But the magnitude of $X[1]$ and $X[N-1]$ won't be $\frac{1}{2}$.
I think you can do it now yourself to figure out the magnitude of $X[1]$ and $X[N-1]$.
Hint: The Magnitude will get scaled by the length of DFT.


Q:

Data sorting with R for XLConnect

Ok, so I have a workbook in Excel with sheets that look like this:
Date      1/2/15      1/3/15      1/4/15
Euro      3.54        2.50        #N/A
USD       3.20        3.30        3.35
Yen       2.50        2.35        2.40

The sheets are arranged exactly like this. I loaded each sheet individually via XLConnect such that:
wbFX <- loadWorkbook("fx.xlsx")
FX.high <- readWorksheet(wbFX, sheet=1)
FX.low <- readWorksheet(wbFX, sheet=2)
FX.close <- readWorksheet(wbFX, sheet=3)

One sheet is for closing prices, the other for low and the last one is closing prices.
I want to merge the currency rows (i.e: grouping Euro low, Euro high, Euro close) and create a table or dataframe such that I have:
Date            1/2/15      1/3/15      1/4/15
Euro close      3.54        2.50        #N/A
Euro low        3.20        3.30        3.35
Euro high       2.50        2.35        2.40

I only have very rudimentary knowledge of R and I'm not very familiar with the for() loop function in R. I understand the basics of it, but I'm struggling to reproduce what I want.
Suggestions would be very much appreciated!
UPDATED: Adding dput(FX.high) gives:
> dput(head(FX.high))
structure(list(Col1 = c("EUR CURNCY", "JPY CURNCY", "GBP CURNCY",
"CHF CURNCY", "AUD CURNCY", "CAD CURNCY"), X2016.08.30.00.00.00 = c(1.1192,
102.56, 1.312, 0.9815, 0.758, 1.3056), X2016.08.29.00.00.00 = c(1.1208,
102.39, 1.3172, 0.9807, 0.7582, 1.3048), X2016.08.28.00.00.00 = c(1.1341,
101.94, 1.3279, 0.9793, 0.7692, 1.3012), X2016.08.27.00.00.00 = c(1.1341,
101.94, 1.3279, 0.9793, 0.7692, 1.3012), X2016.08.26.00.00.00 = c(1.1341,
101.94, 1.3279, 0.9793, 0.7692, 1.3012), X2016.08.25.00.00.00 = c(1.1298,
100.62, 1.3264, 0.9688, 0.7639, 1.294), X2016.08.24.00.00.00 = c(1.1312,
100.61, 1.3273, 0.9684, 0.7634, 1.2958), X2016.08.23.00.00.00 = c(1.1355,
100.39, 1.3211, 0.9634, 0.7655, 1.2948), X2016.08.22.00.00.00 = c(1.1334,
100.93, 1.3157, 0.9649, 0.764, 1.2965), X2016.08.21.00.00.00 = c(1.136,
100.46, 1.3185, 0.9611, 0.7691, 1.2892), X2016.08.20.00.00.00 = c(1.136,
100.46, 1.3185, 0.9611, 0.7691, 1.2892), X2016.08.19.00.00.00 = c(1.136,
100.46, 1.3185, 0.9611, 0.7691, 1.2892), X2016.08.18.00.00.00 = c(1.1366,
100.5, 1.3173, 0.9627, 0.7723, 1.2858), X2016.08.17.00.00.00 = c(1.1316,
101.17, 1.3086, 0.9659, 0.7708, 1.2918), X2016.08.16.00.00.00 = c(1.1323,
101.29, 1.3051, 0.9735, 0.7749, 1.2934), X2016.08.15.00.00.00 = c(1.1204,
101.45, 1.2945, 0.9775, 0.7692, 1.2976), X2016.08.14.00.00.00 = c(1.1221,
102.27, 1.3035, 0.9766, 0.7725, 1.2994), X2016.08.13.00.00.00 = c(1.1221,
102.27, 1.3035, 0.9766, 0.7725, 1.2994), X2016.08.12.00.00.00 = c(1.1221,
102.27, 1.3035, 0.9766, 0.7725, 1.2994), X2016.08.11.00.00.00 = c(1.1192,
102.06, 1.3028, 0.9766, 0.775, 1.308), X2016.08.10.00.00.00 = c(1.119,
101.96, 1.3094, 0.9819, 0.7756, 1.3124), X2016.08.09.00.00.00 = c(1.1123,
102.53, 1.3049, 0.9844, 0.7687, 1.319), X2016.08.08.00.00.00 = c(1.1105,
102.66, 1.3097, 0.9842, 0.7672, 1.319), X2016.08.07.00.00.00 = c(1.1161,
102.06, 1.3175, 0.9831, 0.7664, 1.32), X2016.08.06.00.00.00 = c(1.1161,
102.06, 1.3175, 0.9831, 0.7664, 1.32), X2016.08.05.00.00.00 = c(1.1161,
102.06, 1.3175, 0.9831, 0.7664, 1.32), X2016.08.04.00.00.00 = c(1.1156,
101.67, 1.3346, 0.975, 0.7641, 1.3089), X2016.08.03.00.00.00 = c(1.1227,
101.57, 1.3372, 0.9739, 0.7616, 1.3148), X2016.08.02.00.00.00 = c(1.1234,
102.83, 1.3366, 0.9698, 0.7638, 1.3142), X2016.08.01.00.00.00 = c(1.1184,
102.68, 1.3273, 0.9703, 0.7615, 1.3127), X2016.07.31.00.00.00 = c(1.1197,
105.63, 1.3301, 0.981, 0.761, 1.3186), X2016.07.30.00.00.00 = c(1.1197,
105.63, 1.3301, 0.981, 0.761, 1.3186), X2016.07.29.00.00.00 = c(1.1197,
105.63, 1.3301, 0.981, 0.761, 1.3186), X2016.07.28.00.00.00 = c(1.1119,
105.51, 1.3248, 0.9868, 0.7549, 1.3192), X2016.07.27.00.00.00 = c(1.1065,
106.54, 1.3235, 0.995, 0.7566, 1.3253), X2016.07.26.00.00.00 = c(1.103,
105.89, 1.3176, 0.9928, 0.754, 1.3244), X2016.07.25.00.00.00 = c(1.0999,
106.72, 1.3165, 0.9897, 0.7492, 1.3242), X2016.07.24.00.00.00 = c(1.1041,
106.4, 1.3291, 0.9895, 0.7508, 1.3185), X2016.07.23.00.00.00 = c(1.1041,
106.4, 1.3291, 0.9895, 0.7508, 1.3185), X2016.07.22.00.00.00 = c(1.1041,
106.4, 1.3291, 0.9895, 0.7508, 1.3185), X2016.07.21.00.00.00 = c(1.106,
107.49, 1.3275, 0.9907, 0.7514, 1.3101), X2016.07.20.00.00.00 = c(1.103,
107.02, 1.3226, 0.9905, 0.7517, 1.3096), X2016.07.19.00.00.00 = c(1.1081,
106.53, 1.3276, 0.9878, 0.7592, 1.3054), X2016.07.18.00.00.00 = c(1.1084,
106.26, 1.3315, 0.9847, 0.7607, 1.3022), X2016.07.17.00.00.00 = c(1.1149,
106.32, 1.3481, 0.9847, 0.7676, 1.2988), X2016.07.16.00.00.00 = c(1.1149,
106.32, 1.3481, 0.9847, 0.7676, 1.2988), X2016.07.15.00.00.00 = c(1.1149,
106.32, 1.3481, 0.9847, 0.7676, 1.2988), X2016.07.14.00.00.00 = c(1.1165,
105.94, 1.3475, 0.9854, 0.7653, 1.2987), X2016.07.13.00.00.00 = c(1.112,
104.88, 1.3338, 0.9894, 0.7638, 1.3084), X2016.07.12.00.00.00 = c(1.1126,
104.99, 1.3295, 0.9894, 0.7658, 1.3133), X2016.07.11.00.00.00 = c(1.1075,
102.89, 1.3018, 0.9858, 0.7576, 1.314), X2016.07.10.00.00.00 = c(1.112,
101.28, 1.3019, 0.9866, 0.7574, 1.309), X2016.07.09.00.00.00 = c(1.112,
101.28, 1.3019, 0.9866, 0.7574, 1.309), X2016.07.08.00.00.00 = c(1.112,
101.28, 1.3019, 0.9866, 0.7574, 1.309), X2016.07.07.00.00.00 = c(1.1107,
101.41, 1.3047, 0.9792, 0.7539, 1.3021), X2016.07.06.00.00.00 = c(1.1112,
101.77, 1.3028, 0.9806, 0.7529, 1.3056), X2016.07.05.00.00.00 = c(1.1186,
102.59, 1.3291, 0.9774, 0.7545, 1.3017), X2016.07.04.00.00.00 = c(1.116,
102.8, 1.3341, 0.9759, 0.7545, 1.2926), X2016.07.03.00.00.00 = c(1.1169,
103.39, 1.335, 0.9781, 0.7503, 1.2975), X2016.07.02.00.00.00 = c(1.1169,
103.39, 1.335, 0.9781, 0.7503, 1.2975), X2016.07.01.00.00.00 = c(1.1169,
103.39, 1.335, 0.9781, 0.7503, 1.2975), X2016.06.30.00.00.00 = c(1.1155,
103.29, 1.3496, 0.9821, 0.7473, 1.3016), X2016.06.29.00.00.00 = c(1.113,
102.94, 1.3534, 0.9823, 0.7456, 1.3042), X2016.06.28.00.00.00 = c(1.1112,
102.84, 1.3419, 0.9837, 0.7415, 1.3108), X2016.06.27.00.00.00 = c(1.1084,
102.48, 1.3566, 0.9819, 0.7459, 1.312), X2016.06.26.00.00.00 = c(1.1428,
106.84, 1.5018, 0.9804, 0.7648, 1.3099), X2016.06.25.00.00.00 = c(1.1428,
106.84, 1.5018, 0.9804, 0.7648, 1.3099), X2016.06.24.00.00.00 = c(1.1428,
106.84, 1.5018, 0.9804, 0.7648, 1.3099), X2016.06.23.00.00.00 = c(1.1421,
106.17, 1.4947, 0.9602, 0.7616, 1.2847), X2016.06.22.00.00.00 = c(1.1338,
104.85, 1.4774, 0.9629, 0.7527, 1.2853), X2016.06.21.00.00.00 = c(1.135,
105.06, 1.4783, 0.9624, 0.7513, 1.2827), X2016.06.20.00.00.00 = c(1.1382,
104.85, 1.472, 0.9643, 0.7481, 1.2889), X2016.06.19.00.00.00 = c(1.1296,
104.83, 1.4388, 0.9659, 0.7411, 1.2968), X2016.06.18.00.00.00 = c(1.1296,
104.83, 1.4388, 0.9659, 0.7411, 1.2968), X2016.06.17.00.00.00 = c(1.1296,
104.83, 1.4388, 0.9659, 0.7411, 1.2968), X2016.06.16.00.00.00 = c(1.1295,
106.03, 1.4254, 0.9687, 0.744, 1.3086), X2016.06.15.00.00.00 = c(1.1298,
106.4, 1.4218, 0.9664, 0.7446, 1.2943), X2016.06.14.00.00.00 = c(1.1298,
106.42, 1.4271, 0.9669, 0.7405, 1.2873), X2016.06.13.00.00.00 = c(1.1303,
106.98, 1.4328, 0.9679, 0.7411, 1.2839), X2016.06.12.00.00.00 = c(1.1321,
107.26, 1.4473, 0.9658, 0.7438, 1.2784), X2016.06.11.00.00.00 = c(1.1321,
107.26, 1.4473, 0.9658, 0.7438, 1.2784), X2016.06.10.00.00.00 = c(1.1321,
107.26, 1.4473, 0.9658, 0.7438, 1.2784), X2016.06.09.00.00.00 = c(1.1416,
107.18, 1.4527, 0.9656, 0.7505, 1.2767), X2016.06.08.00.00.00 = c(1.1411,
107.39, 1.4601, 0.9659, 0.7482, 1.2761), X2016.06.07.00.00.00 = c(1.1381,
107.9, 1.466, 0.9719, 0.7464, 1.284), X2016.06.06.00.00.00 = c(1.1393,
107.66, 1.4529, 0.978, 0.7391, 1.2983), X2016.06.05.00.00.00 = c(1.1374,
109.14, 1.4582, 0.992, 0.7369, 1.3107), X2016.06.04.00.00.00 = c(1.1374,
109.14, 1.4582, 0.992, 0.7369, 1.3107), X2016.06.03.00.00.00 = c(1.1374,
109.14, 1.4582, 0.992, 0.7369, 1.3107), X2016.06.02.00.00.00 = c(1.122,
109.59, 1.4473, 0.9911, 0.727, 1.3144), X2016.06.01.00.00.00 = c(1.1194,
110.83, 1.4508, 0.9951, 0.7299, 1.3123), X2016.05.31.00.00.00 = c(1.1173,
111.35, 1.4725, 0.9951, 0.7267, 1.3134), X2016.05.30.00.00.00 = c(1.1145,
111.45, 1.4642, 0.9956, 0.7188, 1.3095), X2016.05.29.00.00.00 = c(1.1201,
110.45, 1.4689, 0.9949, 0.7235, 1.3068), X2016.05.28.00.00.00 = c(1.1201,
110.45, 1.4689, 0.9949, 0.7235, 1.3068), X2016.05.27.00.00.00 = c(1.1201,
110.45, 1.4689, 0.9949, 0.7235, 1.3068), X2016.05.26.00.00.00 = c(1.1217,
110.23, 1.474, 0.9928, 0.7244, 1.3037), X2016.05.25.00.00.00 = c(1.1167,
110.45, 1.4729, 0.9936, 0.7219, 1.3133), X2016.05.24.00.00.00 = c(1.1227,
110.13, 1.4642, 0.9938, 0.7228, 1.3188), X2016.05.23.00.00.00 = c(1.1243,
110.24, 1.4549, 0.9924, 0.726, 1.3174), X2016.05.22.00.00.00 = c(1.1237,
110.59, 1.4613, 0.9927, 0.725, 1.3162), X2016.05.21.00.00.00 = c(1.1237,
110.59, 1.4613, 0.9927, 0.725, 1.3162), X2016.05.20.00.00.00 = c(1.1237,
110.59, 1.4613, 0.9927, 0.725, 1.3162), X2016.05.19.00.00.00 = c(1.123,
110.38, 1.4663, 0.9923, 0.7242, 1.3154), X2016.05.18.00.00.00 = c(1.1316,
110.26, 1.4635, 0.9881, 0.7332, 1.3037), X2016.05.17.00.00.00 = c(1.1349,
109.65, 1.4524, 0.9809, 0.7366, 1.2955), X2016.05.16.00.00.00 = c(1.1342,
109.1, 1.4415, 0.9784, 0.7309, 1.2963), X2016.05.15.00.00.00 = c(1.138,
109.56, 1.4456, 0.9775, 0.7326, 1.2958), X2016.05.14.00.00.00 = c(1.138,
109.56, 1.4456, 0.9775, 0.7326, 1.2958), X2016.05.13.00.00.00 = c(1.138,
109.56, 1.4456, 0.9775, 0.7326, 1.2958), X2016.05.12.00.00.00 = c(1.1429,
109.4, 1.4531, 0.9726, 0.738, 1.2879), X2016.05.11.00.00.00 = c(1.1447,
109.38, 1.4488, 0.9762, 0.7402, 1.2942), X2016.05.10.00.00.00 = c(1.141,
109.35, 1.4478, 0.9763, 0.7374, 1.298), X2016.05.09.00.00.00 = c(1.142,
108.6, 1.448, 0.9736, 0.7385, 1.3015), X2016.05.08.00.00.00 = c(1.1479,
107.42, 1.4543, 0.973, 0.7478, 1.2952), X2016.05.07.00.00.00 = c(1.1479,
107.42, 1.4543, 0.973, 0.7478, 1.2952), X2016.05.06.00.00.00 = c(1.1479,
107.42, 1.4543, 0.973, 0.7478, 1.2952), X2016.05.05.00.00.00 = c(1.1494,
107.5, 1.4529, 0.9697, 0.7514, 1.2875), X2016.05.04.00.00.00 = c(1.1529,
107.46, 1.4572, 0.959, 0.7517, 1.2886), X2016.05.03.00.00.00 = c(1.1616,
106.68, 1.477, 0.9554, 0.7719, 1.2732), X2016.05.02.00.00.00 = c(1.1536,
106.82, 1.4696, 0.9605, 0.7672, 1.2571), X2016.05.01.00.00.00 = c(1.1459,
108.2, 1.467, 0.9672, 0.7669, 1.2587), X2016.04.30.00.00.00 = c(1.1459,
108.2, 1.467, 0.9672, 0.7669, 1.2587), X2016.04.29.00.00.00 = c(1.1459,
108.2, 1.467, 0.9672, 0.7669, 1.2587), X2016.04.28.00.00.00 = c(1.1368,
111.88, 1.4623, 0.9734, 0.7658, 1.2606), X2016.04.27.00.00.00 = c(1.1362,
111.75, 1.4622, 0.9753, 0.7765, 1.2694), X2016.04.26.00.00.00 = c(1.134,
111.47, 1.4639, 0.9767, 0.7765, 1.2688), X2016.04.25.00.00.00 = c(1.1278,
111.91, 1.452, 0.9794, 0.7729, 1.2717), X2016.04.24.00.00.00 = c(1.1309,
111.81, 1.4452, 0.9797, 0.7774, 1.2758), X2016.04.23.00.00.00 = c(1.1309,
111.81, 1.4452, 0.9797, 0.7774, 1.2758), X2016.04.22.00.00.00 = c(1.1309,
111.81, 1.4452, 0.9797, 0.7774, 1.2758), X2016.04.21.00.00.00 = c(1.1398,
109.9, 1.444, 0.9753, 0.7835, 1.275), X2016.04.20.00.00.00 = c(1.1388,
109.88, 1.441, 0.9733, 0.7829, 1.273), X2016.04.19.00.00.00 = c(1.1385,
109.49, 1.4419, 0.965, 0.7826, 1.2798), X2016.04.18.00.00.00 = c(1.1332,
108.99, 1.4291, 0.9679, 0.7759, 1.299), X2016.04.17.00.00.00 = c(1.1317,
109.73, 1.4242, 0.9688, 0.7734, 1.2903), X2016.04.16.00.00.00 = c(1.1317,
109.73, 1.4242, 0.9688, 0.7734, 1.2903), X2016.04.15.00.00.00 = c(1.1317,
109.73, 1.4242, 0.9688, 0.7734, 1.2903), X2016.04.14.00.00.00 = c(1.1295,
109.55, 1.4208, 0.9688, 0.7737, 1.2897), X2016.04.13.00.00.00 = c(1.1391,
109.41, 1.4279, 0.9672, 0.7716, 1.2828), X2016.04.12.00.00.00 = c(1.1465,
108.79, 1.4348, 0.9594, 0.769, 1.2921), X2016.04.11.00.00.00 = c(1.1447,
108.44, 1.4287, 0.9571, 0.763, 1.3016), X2016.04.10.00.00.00 = c(1.1419,
109.1, 1.4141, 0.9582, 0.7579, 1.3157), X2016.04.09.00.00.00 = c(1.1419,
109.1, 1.4141, 0.9582, 0.7579, 1.3157), X2016.04.08.00.00.00 = c(1.1419,
109.1, 1.4141, 0.9582, 0.7579, 1.3157), X2016.04.07.00.00.00 = c(1.1454,
109.9, 1.4157, 0.9581, 0.7637, 1.3181), X2016.04.06.00.00.00 = c(1.1432,
110.64, 1.4171, 0.9622, 0.7619, 1.3187), X2016.04.05.00.00.00 = c(1.1405,
111.36, 1.4279, 0.9605, 0.7632, 1.3219), X2016.04.04.00.00.00 = c(1.1413,
111.8, 1.4322, 0.9615, 0.7679, 1.3088), X2016.04.03.00.00.00 = c(1.1438,
112.58, 1.4372, 0.9626, 0.7701, 1.3147), X2016.04.02.00.00.00 = c(1.1438,
112.58, 1.4372, 0.9626, 0.7701, 1.3147), X2016.04.01.00.00.00 = c(1.1438,
112.58, 1.4372, 0.9626, 0.7701, 1.3147), X2016.03.31.00.00.00 = c(1.1412,
112.66, 1.4426, 0.9663, 0.7723, 1.3011), X2016.03.30.00.00.00 = c(1.1365,
112.81, 1.4459, 0.9672, 0.7709, 1.3081), X2016.03.29.00.00.00 = c(1.1303,
113.8, 1.4404, 0.9763, 0.7645, 1.3216), X2016.03.28.00.00.00 = c(1.122,
113.69, 1.4283, 0.9787, 0.7558, 1.3285), X2016.03.27.00.00.00 = c(1.1181,
113.32, 1.4159, 0.9788, 0.7535, 1.3285), X2016.03.26.00.00.00 = c(1.1181,
113.32, 1.4159, 0.9788, 0.7535, 1.3285), X2016.03.25.00.00.00 = c(1.1181,
113.32, 1.4159, 0.9788, 0.7535, 1.3285), X2016.03.24.00.00.00 = c(1.1188,
113.01, 1.4183, 0.9774, 0.7538, 1.3296), X2016.03.23.00.00.00 = c(1.1224,
112.91, 1.4227, 0.9766, 0.7649, 1.3219), X2016.03.22.00.00.00 = c(1.126,
112.49, 1.4398, 0.9736, 0.7643, 1.3139), X2016.03.21.00.00.00 = c(1.1288,
111.98, 1.4469, 0.9731, 0.7627, 1.3102), X2016.03.20.00.00.00 = c(1.1337,
111.76, 1.4514, 0.9717, 0.768, 1.3043), X2016.03.19.00.00.00 = c(1.1337,
111.76, 1.4514, 0.9717, 0.768, 1.3043), X2016.03.18.00.00.00 = c(1.1337,
111.76, 1.4514, 0.9717, 0.768, 1.3043), X2016.03.17.00.00.00 = c(1.1342,
112.96, 1.4503, 0.9787, 0.7657, 1.3133), X2016.03.16.00.00.00 = c(1.1242,
113.82, 1.4274, 0.9914, 0.7561, 1.3405), X2016.03.15.00.00.00 = c(1.1125,
114.14, 1.4306, 0.9896, 0.7528, 1.3402), X2016.03.14.00.00.00 = c(1.1176,
114.01, 1.4401, 0.9882, 0.7594, 1.3308), X2016.03.13.00.00.00 = c(1.121,
113.92, 1.4437, 0.9891, 0.7584, 1.3359), X2016.03.12.00.00.00 = c(1.121,
113.92, 1.4437, 0.9891, 0.7584, 1.3359), X2016.03.11.00.00.00 = c(1.121,
113.92, 1.4437, 0.9891, 0.7584, 1.3359), X2016.03.10.00.00.00 = c(1.1218,
114.45, 1.4317, 1.0093, 0.7512, 1.3398), X2016.03.09.00.00.00 = c(1.1035,
113.45, 1.4241, 1.0039, 0.7528, 1.3446), X2016.03.08.00.00.00 = c(1.1058,
113.52, 1.4276, 0.9971, 0.7473, 1.3425), X2016.03.07.00.00.00 = c(1.1026,
114.09, 1.4284, 1.0012, 0.7485, 1.3377), X2016.03.06.00.00.00 = c(1.1043,
114.26, 1.4248, 0.9989, 0.7443, 1.3471), X2016.03.05.00.00.00 = c(1.1043,
114.26, 1.4248, 0.9989, 0.7443, 1.3471), X2016.03.04.00.00.00 = c(1.1043,
114.26, 1.4248, 0.9989, 0.7443, 1.3471), X2016.03.03.00.00.00 = c(1.0973,
114.27, 1.4194, 0.9983, 0.7374, 1.3473), X2016.03.02.00.00.00 = c(1.0881,
114.56, 1.4093, 1.0009, 0.7301, 1.3499), X2016.03.01.00.00.00 = c(1.0894,
114.19, 1.4018, 1.0009, 0.7192, 1.3552), X2016.02.29.00.00.00 = c(1.0963,
113.99, 1.3946, 1.0038, 0.7168, 1.3587), X2016.02.28.00.00.00 = c(1.1068,
114, 1.4043, 0.9989, 0.7257, 1.3565), X2016.02.27.00.00.00 = c(1.1068,
114, 1.4043, 0.9989, 0.7257, 1.3565), X2016.02.26.00.00.00 = c(1.1068,
114, 1.4043, 0.9989, 0.7257, 1.3565), X2016.02.25.00.00.00 = c(1.105,
113.02, 1.3997, 0.9952, 0.7244, 1.3735), X2016.02.24.00.00.00 = c(1.1046,
112.27, 1.4028, 0.9953, 0.7213, 1.3859), X2016.02.23.00.00.00 = c(1.1053,
113.05, 1.4156, 1.0002, 0.7259, 1.3821), X2016.02.22.00.00.00 = c(1.1135,
113.39, 1.4332, 1.0004, 0.7247, 1.3813), X2016.02.21.00.00.00 = c(1.1139,
113.38, 1.4409, 0.9968, 0.7162, 1.3847), X2016.02.20.00.00.00 = c(1.1139,
113.38, 1.4409, 0.9968, 0.7162, 1.3847), X2016.02.19.00.00.00 = c(1.1139,
113.38, 1.4409, 0.9968, 0.7162, 1.3847), X2016.02.18.00.00.00 = c(1.115,
114.33, 1.4394, 0.9969, 0.7185, 1.3752), X2016.02.17.00.00.00 = c(1.1179,
114.51, 1.4339, 0.9942, 0.7187, 1.3899), X2016.02.16.00.00.00 = c(1.1193,
114.87, 1.4516, 0.9896, 0.7182, 1.3912), X2016.02.15.00.00.00 = c(1.1261,
114.73, 1.4567, 0.9889, 0.7172, 1.3867), X2016.02.14.00.00.00 = c(1.1334,
113.54, 1.457, 0.9791, 0.7129, 1.3965), X2016.02.13.00.00.00 = c(1.1334,
113.54, 1.457, 0.9791, 0.7129, 1.3965), X2016.02.12.00.00.00 = c(1.1334,
113.54, 1.457, 0.9791, 0.7129, 1.3965), X2016.02.11.00.00.00 = c(1.1376,
113.6, 1.4564, 0.9762, 0.7153, 1.4016), X2016.02.10.00.00.00 = c(1.1311,
115.26, 1.4578, 0.982, 0.7125, 1.3999), X2016.02.09.00.00.00 = c(1.1338,
115.85, 1.4516, 0.9875, 0.7096, 1.396), X2016.02.08.00.00.00 = c(1.1216,
117.53, 1.4547, 0.9973, 0.7129, 1.3978), X2016.02.07.00.00.00 = c(1.1246,
117.43, 1.4592, 0.9985, 0.7219, 1.3919), X2016.02.06.00.00.00 = c(1.1246,
117.43, 1.4592, 0.9985, 0.7219, 1.3919), X2016.02.05.00.00.00 = c(1.1246,
117.43, 1.4592, 0.9985, 0.7219, 1.3919), X2016.02.04.00.00.00 = c(1.1239,
118.24, 1.4668, 1.0074, 0.7243, 1.3798), X2016.02.03.00.00.00 = c(1.1146,
120.04, 1.4649, 1.0196, 0.7189, 1.4103), X2016.02.02.00.00.00 = c(1.094,
121.04, 1.4446, 1.0224, 0.7129, 1.4082), X2016.02.01.00.00.00 = c(1.0913,
121.49, 1.4445, 1.025, 0.7121, 1.4062), X2016.01.31.00.00.00 = c(1.0949,
121.69, 1.4413, 1.0257, 0.7141, 1.4109), X2016.01.30.00.00.00 = c(1.0949,
121.69, 1.4413, 1.0257, 0.7141, 1.4109), X2016.01.29.00.00.00 = c(1.0949,
121.69, 1.4413, 1.0257, 0.7141, 1.4109), X2016.01.28.00.00.00 = c(1.0968,
118.99, 1.4408, 1.0178, 0.7129, 1.4123), X2016.01.27.00.00.00 = c(1.0917,
119.07, 1.4355, 1.0189, 0.7082, 1.4157), X2016.01.26.00.00.00 = c(1.0874,
118.62, 1.4367, 1.0199, 0.7021, 1.4326), X2016.01.25.00.00.00 = c(1.0857,
118.86, 1.4332, 1.0184, 0.7032, 1.4293), X2016.01.24.00.00.00 = c(1.0877,
118.88, 1.4363, 1.0166, 0.7046, 1.4301), X2016.01.23.00.00.00 = c(1.0877,
118.88, 1.4363, 1.0166, 0.7046, 1.4301), X2016.01.22.00.00.00 = c(1.0877,
118.88, 1.4363, 1.0166, 0.7046, 1.4301), X2016.01.21.00.00.00 = c(1.0921,
117.81, 1.4249, 1.0147, 0.7018, 1.4541), X2016.01.20.00.00.00 = c(1.0976,
117.69, 1.4219, 1.0058, 0.6926, 1.469), X2016.01.19.00.00.00 = c(1.0939,
118.11, 1.434, 1.0082, 0.6957, 1.4589), X2016.01.18.00.00.00 = c(1.0942,
117.44, 1.4323, 1.0073, 0.6928, 1.466), X2016.01.17.00.00.00 = c(1.0985,
118.27, 1.4428, 1.0061, 0.7002, 1.4554), X2016.01.16.00.00.00 = c(1.0985,
118.27, 1.4428, 1.0061, 0.7002, 1.4554), X2016.01.15.00.00.00 = c(1.0985,
118.27, 1.4428, 1.0061, 0.7002, 1.4554), X2016.01.14.00.00.00 = c(1.0943,
118.28, 1.4445, 1.0092, 0.6997, 1.4397), X2016.01.13.00.00.00 = c(1.0888,
118.38, 1.4476, 1.0107, 0.7049, 1.438), X2016.01.12.00.00.00 = c(1.09,
118.07, 1.456, 1.0047, 0.7021, 1.4315), X2016.01.11.00.00.00 = c(1.097,
118.02, 1.4604, 1.0023, 0.7036, 1.4246), X2016.01.10.00.00.00 = c(1.0934,
118.83, 1.4645, 1.0052, 0.7077, 1.4178), X2016.01.09.00.00.00 = c(1.0934,
118.83, 1.4645, 1.0052, 0.7077, 1.4178), X2016.01.08.00.00.00 = c(1.0934,
118.83, 1.4645, 1.0052, 0.7077, 1.4178), X2016.01.07.00.00.00 = c(1.094,
118.76, 1.4641, 1.0081, 0.7086, 1.417), X2016.01.06.00.00.00 = c(1.0799,
119.17, 1.4682, 1.0121, 0.7172, 1.4109), X2016.01.05.00.00.00 = c(1.0839,
119.7, 1.4726, 1.0125, 0.7215, 1.4019), X2016.01.04.00.00.00 = c(1.0946,
120.47, 1.4816, 1.0063, 0.7305, 1.3983), X2016.01.03.00.00.00 = c(1.0867,
120.55, 1.476, 1.0083, 0.7304, 1.3856), X2016.01.02.00.00.00 = c(1.0867,
120.55, 1.476, 1.0083, 0.7304, 1.3856), X2016.01.01.00.00.00 = c(1.0867,
120.55, 1.476, 1.0083, 0.7304, 1.3856)), .Names = c("Col1", "X2016.08.30.00.00.00",
"X2016.08.29.00.00.00", "X2016.08.28.00.00.00", "X2016.08.27.00.00.00",
"X2016.08.26.00.00.00", "X2016.08.25.00.00.00", "X2016.08.24.00.00.00",
"X2016.08.23.00.00.00", "X2016.08.22.00.00.00", "X2016.08.21.00.00.00",
"X2016.08.20.00.00.00", "X2016.08.19.00.00.00", "X2016.08.18.00.00.00",
"X2016.08.17.00.00.00", "X2016.08.16.00.00.00", "X2016.08.15.00.00.00",
"X2016.08.14.00.00.00", "X2016.08.13.00.00.00", "X2016.08.12.00.00.00",
"X2016.08.11.00.00.00", "X2016.08.10.00.00.00", "X2016.08.09.00.00.00",
"X2016.08.08.00.00.00", "X2016.08.07.00.00.00", "X2016.08.06.00.00.00",
"X2016.08.05.00.00.00", "X2016.08.04.00.00.00", "X2016.08.03.00.00.00",
"X2016.08.02.00.00.00", "X2016.08.01.00.00.00", "X2016.07.31.00.00.00",
"X2016.07.30.00.00.00", "X2016.07.29.00.00.00", "X2016.07.28.00.00.00",
"X2016.07.27.00.00.00", "X2016.07.26.00.00.00", "X2016.07.25.00.00.00",
"X2016.07.24.00.00.00", "X2016.07.23.00.00.00", "X2016.07.22.00.00.00",
"X2016.07.21.00.00.00", "X2016.07.20.00.00.00", "X2016.07.19.00.00.00",
"X2016.07.18.00.00.00", "X2016.07.17.00.00.00", "X2016.07.16.00.00.00",
"X2016.07.15.00.00.00", "X2016.07.14.00.00.00", "X2016.07.13.00.00.00",
"X2016.07.12.00.00.00", "X2016.07.11.00.00.00", "X2016.07.10.00.00.00",
"X2016.07.09.00.00.00", "X2016.07.08.00.00.00", "X2016.07.07.00.00.00",
"X2016.07.06.00.00.00", "X2016.07.05.00.00.00", "X2016.07.04.00.00.00",
"X2016.07.03.00.00.00", "X2016.07.02.00.00.00", "X2016.07.01.00.00.00",
"X2016.06.30.00.00.00", "X2016.06.29.00.00.00", "X2016.06.28.00.00.00",
"X2016.06.27.00.00.00", "X2016.06.26.00.00.00", "X2016.06.25.00.00.00",
"X2016.06.24.00.00.00", "X2016.06.23.00.00.00", "X2016.06.22.00.00.00",
"X2016.06.21.00.00.00", "X2016.06.20.00.00.00", "X2016.06.19.00.00.00",
"X2016.06.18.00.00.00", "X2016.06.17.00.00.00", "X2016.06.16.00.00.00",
"X2016.06.15.00.00.00", "X2016.06.14.00.00.00", "X2016.06.13.00.00.00",
"X2016.06.12.00.00.00", "X2016.06.11.00.00.00", "X2016.06.10.00.00.00",
"X2016.06.09.00.00.00", "X2016.06.08.00.00.00", "X2016.06.07.00.00.00",
"X2016.06.06.00.00.00", "X2016.06.05.00.00.00", "X2016.06.04.00.00.00",
"X2016.06.03.00.00.00", "X2016.06.02.00.00.00", "X2016.06.01.00.00.00",
"X2016.05.31.00.00.00", "X2016.05.30.00.00.00", "X2016.05.29.00.00.00",
"X2016.05.28.00.00.00", "X2016.05.27.00.00.00", "X2016.05.26.00.00.00",
"X2016.05.25.00.00.00", "X2016.05.24.00.00.00", "X2016.05.23.00.00.00",
"X2016.05.22.00.00.00", "X2016.05.21.00.00.00", "X2016.05.20.00.00.00",
"X2016.05.19.00.00.00", "X2016.05.18.00.00.00", "X2016.05.17.00.00.00",
"X2016.05.16.00.00.00", "X2016.05.15.00.00.00", "X2016.05.14.00.00.00",
"X2016.05.13.00.00.00", "X2016.05.12.00.00.00", "X2016.05.11.00.00.00",
"X2016.05.10.00.00.00", "X2016.05.09.00.00.00", "X2016.05.08.00.00.00",
"X2016.05.07.00.00.00", "X2016.05.06.00.00.00", "X2016.05.05.00.00.00",
"X2016.05.04.00.00.00", "X2016.05.03.00.00.00", "X2016.05.02.00.00.00",
"X2016.05.01.00.00.00", "X2016.04.30.00.00.00", "X2016.04.29.00.00.00",
"X2016.04.28.00.00.00", "X2016.04.27.00.00.00", "X2016.04.26.00.00.00",
"X2016.04.25.00.00.00", "X2016.04.24.00.00.00", "X2016.04.23.00.00.00",
"X2016.04.22.00.00.00", "X2016.04.21.00.00.00", "X2016.04.20.00.00.00",
"X2016.04.19.00.00.00", "X2016.04.18.00.00.00", "X2016.04.17.00.00.00",
"X2016.04.16.00.00.00", "X2016.04.15.00.00.00", "X2016.04.14.00.00.00",
"X2016.04.13.00.00.00", "X2016.04.12.00.00.00", "X2016.04.11.00.00.00",
"X2016.04.10.00.00.00", "X2016.04.09.00.00.00", "X2016.04.08.00.00.00",
"X2016.04.07.00.00.00", "X2016.04.06.00.00.00", "X2016.04.05.00.00.00",
"X2016.04.04.00.00.00", "X2016.04.03.00.00.00", "X2016.04.02.00.00.00",
"X2016.04.01.00.00.00", "X2016.03.31.00.00.00", "X2016.03.30.00.00.00",
"X2016.03.29.00.00.00", "X2016.03.28.00.00.00", "X2016.03.27.00.00.00",
"X2016.03.26.00.00.00", "X2016.03.25.00.00.00", "X2016.03.24.00.00.00",
"X2016.03.23.00.00.00", "X2016.03.22.00.00.00", "X2016.03.21.00.00.00",
"X2016.03.20.00.00.00", "X2016.03.19.00.00.00", "X2016.03.18.00.00.00",
"X2016.03.17.00.00.00", "X2016.03.16.00.00.00", "X2016.03.15.00.00.00",
"X2016.03.14.00.00.00", "X2016.03.13.00.00.00", "X2016.03.12.00.00.00",
"X2016.03.11.00.00.00", "X2016.03.10.00.00.00", "X2016.03.09.00.00.00",
"X2016.03.08.00.00.00", "X2016.03.07.00.00.00", "X2016.03.06.00.00.00",
"X2016.03.05.00.00.00", "X2016.03.04.00.00.00", "X2016.03.03.00.00.00",
"X2016.03.02.00.00.00", "X2016.03.01.00.00.00", "X2016.02.29.00.00.00",
"X2016.02.28.00.00.00", "X2016.02.27.00.00.00", "X2016.02.26.00.00.00",
"X2016.02.25.00.00.00", "X2016.02.24.00.00.00", "X2016.02.23.00.00.00",
"X2016.02.22.00.00.00", "X2016.02.21.00.00.00", "X2016.02.20.00.00.00",
"X2016.02.19.00.00.00", "X2016.02.18.00.00.00", "X2016.02.17.00.00.00",
"X2016.02.16.00.00.00", "X2016.02.15.00.00.00", "X2016.02.14.00.00.00",
"X2016.02.13.00.00.00", "X2016.02.12.00.00.00", "X2016.02.11.00.00.00",
"X2016.02.10.00.00.00", "X2016.02.09.00.00.00", "X2016.02.08.00.00.00",
"X2016.02.07.00.00.00", "X2016.02.06.00.00.00", "X2016.02.05.00.00.00",
"X2016.02.04.00.00.00", "X2016.02.03.00.00.00", "X2016.02.02.00.00.00",
"X2016.02.01.00.00.00", "X2016.01.31.00.00.00", "X2016.01.30.00.00.00",
"X2016.01.29.00.00.00", "X2016.01.28.00.00.00", "X2016.01.27.00.00.00",
"X2016.01.26.00.00.00", "X2016.01.25.00.00.00", "X2016.01.24.00.00.00",
"X2016.01.23.00.00.00", "X2016.01.22.00.00.00", "X2016.01.21.00.00.00",
"X2016.01.20.00.00.00", "X2016.01.19.00.00.00", "X2016.01.18.00.00.00",
"X2016.01.17.00.00.00", "X2016.01.16.00.00.00", "X2016.01.15.00.00.00",
"X2016.01.14.00.00.00", "X2016.01.13.00.00.00", "X2016.01.12.00.00.00",
"X2016.01.11.00.00.00", "X2016.01.10.00.00.00", "X2016.01.09.00.00.00",
"X2016.01.08.00.00.00", "X2016.01.07.00.00.00", "X2016.01.06.00.00.00",
"X2016.01.05.00.00.00", "X2016.01.04.00.00.00", "X2016.01.03.00.00.00",
"X2016.01.02.00.00.00", "X2016.01.01.00.00.00"), row.names = c(NA,
6L), class = "data.frame")

A:

I haven't tested this, since I don't have your data files, so let me know if the code below gives you what you wanted. The steps are as follows:

Get the names of the three worksheets in the Excel workbook (I'm assuming they'll be something like "close", "low", and "high").
Read each worksheet into a list of data frames using lapply. The data in your worksheets is transposed (i.e., the variables are in rows instead of columns), so we we transpose the data so that each variable is in a column, and we also add an extra column that tells us which worksheet the data originally came from.
Combine the three data frames into a single data frame.
"melt" so that the three different currencies will be stacked in long format.

The final output, df, should be a data frame in "long" format that's ready for analysis.
library(reshape2)
library(XLConnect)

wbFX <- loadWorkbook("fx.xlsx")

# Get names of worksheets
sheets = getSheets(wbFX)

# Read the three worksheets into a list of data frames
df = lapply(sheets, function(sh) {
  dat = as.data.frame(t(readWorksheet(wbFX, sheet=sh)))
  dat$Date = as.Date(dat$Date)
  dat$Price_Type = sh
  dat
})

# Combine each list element into a single data frame
df = do.call(rbind, df)

# Melt to long format
df = melt(df, id.var=c("Date", "Price_Type"), variable.name="Currency", value.name="Price")


Q:

iPhone list style like UL LI

Is there a way to create a list style like the UL LI for HTML on the iPhone in a textView? Why i want this is because when i have a long text there will be minimal 2 rules text show.
Example:

Hello i'm a monkey
from the zoo!
Hello i'm a monkey
from the zoo!

A:

the best way that worked for me is to use a UIWebView and add the text as HTML.
this is apple recommendation for rich text.
    UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 130,300 ,230)];

webview.backgroundColor = [UIColor clearColor];
webview.opaque=NO;
webview.delegate=self;

    NSString *text = @"

item 1

item 2

";
NSString *cssPath = [[NSBundle mainBundle] pathForResource:@"style" ofType:@"css"];
NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];

NSString *html =[NSString stringWithFormat:@"<!DOCTYPE html><link rel=\"stylesheet\"  href=\"%@\" type=\"text/css\" />%@",cssPath,text];

[webview loadHTMLString:html baseURL:baseURL];
[self addSubview:webview];

And don't forget to create the "style.css" file in your project.
good luck
shani