Skip to content

Instantly share code, notes, and snippets.

<?php
$maxSize = (int) $_GET['size'];
$times = (int) $_GET['times'];
set_time_limit(0);
echo "<h2>Number of repeated tests: " . $times . "</h2>";
echo "<table border='1'>";
echo "<thead><tr><th>Items</th><th>Time Array</th><th>Memory Array</th><th>SplFixedArray</th><th>Memory SplFixedArray</th><th>Array/SplFixedArray ratio</th><th>Speed increase by SplFixedArray</th><th>Memory reduction by SplFixedArray</th></tr></thead>";
package com.example.sampleapp;
import java.util.ArrayList;
import java.util.HashMap;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.SimpleAdapter;
public class MoreScreen extends ListActivity {
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/screen_about_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:id="@+id/screen_title_bar"
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/category_title">
<CheckBoxPreference
android:key="preferenceKey"
android:title="@string/preferenceTitle"
android:defaultValue="false"
android:layout="@layout/checkbox_preference"
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project Licensed under the
Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License. -->
<!-- Layout for a Preference in a PreferenceActivity. The Preference is able
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/checkbox_checked" /> <!-- checked -->
<item android:state_checked="false"
android:drawable="@drawable/checkbox_unchecked" /> <!-- default -->
</selector>
SELECT contract.* FROM `contract` WHERE contract.ORDER_ID='1' AND ((contract.CONTRACT_TO > '2011-06-07' OR contract.CONTRACT_TO = '-0001-11-30') AND contract.CONTRACT_FROM <= '2011-06-07') ORDER BY contract.CONTRACT_FROM ASC,contract.CONTRACT_ID ASC
SELECT contract.* FROM `contract` WHERE contract.ORDER_ID='1' AND ((contract.CONTRACT_TO > '2011-06-07' OR contract.CONTRACT_TO = '0000-00-00') AND contract.CONTRACT_FROM <= '2011-06-07') ORDER BY contract.CONTRACT_FROM ASC,contract.CONTRACT_ID ASC
$contractObjectCollection = ContractQuery::create()
->filterByOrderId($this->getID())
->condition('contractToAfterNow', 'Contract.ContractTo > ?', date('Y-m-d'))
->condition('contractToIsNul', 'Contract.ContractTo = ?', '0000-00-00')
->combine(array('contractToAfterNow', 'contractToIsNul'), 'or', 'contractToCondition')
->condition('contractFromIsFilledIn', 'Contract.ContractFrom <= ?', date('Y-m-d'))
->combine(array('contractToCondition', 'contractFromIsFilledIn'))
->orderByContractFrom('asc')
->orderByContractId('asc')
->find();
<?php
if ($_POST['topn'] > 0 && (int) $_POST['topn'] <= 20){
$topn = (int) $_POST['topn'];
$client = new SoapClient("http://footballpool.dataaccess.eu/data/info.wso?wsdl");
$result = $client->TopGoalScorers(array('iTopN' => $topn));
// Note that $array contains the result of the traversed object structure
$array = $result->TopGoalScorersResult->tTopGoalScorer;
print "