Skip to content

Instantly share code, notes, and snippets.

View necronet's full-sized avatar
👨‍💻
Hello old friend!

Jose Ayerdis necronet

👨‍💻
Hello old friend!
View GitHub Profile
public class CustomExpandableListAdapter<T> extends BaseExpandableListAdapter{
private Context contexto;
protected HashMap<String, List<T>> mapList;
public CustomExpandableListAdapter(Context contexto,HashMap<String, List<T>> mapList) {
this.mapList=mapList;
this.contexto=contexto;
}
@Override
public T getChild(int groupPosition, int childPosition) {
T value=mapList.get(getMapGroup(groupPosition)).get(childPosition);
return value;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
protected TextView genericView() {
TextView txtView = new TextView(ctx);
txtView.setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, 64));
txtView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
txtView.setPadding(38, 0, 0, 0);
return textView;
}
//Vistas para el Grupo
@Override
public View getGroupView(int groupPosition, boolean isExpanded,View convertView, ViewGroup parent) {
TextView txtView = genericView();
String text=getGroup(groupPosition).toString();
txtView.setText(text);
return txtView;
}
//Vistas para el Child
@Override
public int getChildrenCount(int groupPosition) {
int size=mapList.get(getMapGroup(groupPosition)).size();
return size;
}
@Override
public String getGroup(int groupPosition) {
String group=(String)getMapGroup(groupPosition);
return group;
<?php
$file_script="data.sql";
//possible option: restore|backup
$action="restore";
$user="root";
$pwd="root";
$bd="test";
if($action=="restore"){
<?php
$file_script="data.sql";
//possible option: restore|backup
$action="restore";
$user="root";
$pwd="root";
$bd="test";
if($action=="restore"){
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.blognecronet.miproyecto</groupId>
<artifactId>MySQLProyecto</artifactId>
<version>1.0</version>
/*Este codigo esta en start.php*/
<?php
/*La funcion my_echo($string) es la funcion que publicaremos*/
function my_echo($string) {
return $string;
}
/* Exponemos la funcion con el metodo propio del API RESTful de Elgg */
<?php
function mySecureMethod($parametro=60) {
return 'Metodo Verificado Parametro parametro: '.$minutes;
}
expose_function("test.secureMethod",
"mySecureMethod",
array("parametro" => array('type' => 'int',