Search Results

Search found 3 results on 1 pages for 'durian'.

Page 1/1 | 1 

  • inserting unique date into txt document

    - by durian
    I'm trying this script to insert only a unique date into a text file, but it isn't working properly: $log_file_name = "logfile.txt"; $log_file_path = "log_files/$id/$log_file_name"; if(file_exists($log_file_path)){ $not = "not"; $todaydate = date('d,m,Y'); $today = "$todaydate;"; $strlength = strlen($today); $file_contents = file_get_contents($log_file_path); $file_contents_arry = explode(";",$file_contents); if(!in_array($todaytodaydate,$file_contents_arry)){ $append = fopen($log_file_path, 'a'); $write = fwrite($append,$today); //writes our string to our file. $close = fclose($append); //closes our file } else { $append = fopen($log_file_path, 'a'); $write = fwrite($append,$not); //writes our string to our file. $close = fclose($append); //closes our file } } else{ mkdir("log_files/$id", 0700); $todaydate = date('d,m,Y'); $today = "$todaydate;"; $strlength = strlen($today); $create = fopen($log_file_path, "w"); $write = fwrite($create, $today, $strlength); //writes our string to our file. $close = fclose($create); //closes our file } The problem is with the if else statement where it should be written if it's already in the array.

    Read the article

  • OpenGL or OpenGL ES

    - by zxspectrum
    What should I learn? OpenGL 4.1 or OpenGL ES 2.0? I will be developing desktop applications using Qt but I may start developing mobile applications in a few months, too. I don't know anything about 3D, 3D math, etc and I'd rather spend 100 bucks in a good book than 1 week digging websites and going through trial and error. One problem I see with OpenGL 4.1 is as far as I know there is no book yet (the most recent ones are for OpenGL 3.3 or 4.0), while there are books on OpenGL ES 2.0. On the other hand, from my naive point of view, OpenGL 4.1 seems like OpenGL ES 2.0 + additions, so it looks like it would be easier/better to first learn OpenGL ES 2.0, then go for the shader language, etc Please, don't tell me to use NeHe (it's generally agreed it's full of bad/old practices), the Durian tutorial, etc. Thanks

    Read the article

  • How to add Listview in tab activity?

    - by sandip armal
    I have one "SubjectTabActivity" and i need to show listview on this activity. But when i want to implement ListActivity it doesn't show listActivity. I have two(addchapter,addsubject) xml file with "SubjectTabActivity". and i need to show my database item il list view in respective xml file. but i don't understand how to do that? How to add Listactivity in TabActivity?. Please give me any reference or code. Thanks in advance.. Here is my reference code. public class MasterMainActivity extends TabActivity { LayoutInflater layoutInflater = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.master); Intent intent=getIntent(); setResult(RESULT_OK, intent); layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); TabHost tabHost = getTabHost(); TabHost.TabSpec tab1spec = tabHost.newTabSpec("tabOneSpec"); ImageView imgView = new ImageView(this); imgView.setBackgroundResource(R.drawable.subject); tab1spec.setIndicator("Subject", imgView.getBackground()); tab1spec.setContent(new TabContentLayout()); TabHost.TabSpec tab2spec = tabHost.newTabSpec("tabTwoSpec"); tab2spec.setContent(new TabContentLayout()); ImageView imgView1 = new ImageView(this); imgView1.setBackgroundResource(R.drawable.chapter); tab2spec.setIndicator("Chapter", imgView1.getBackground()); tabHost.addTab(tab1spec); tabHost.addTab(tab2spec); } private class TabContentLayout implements TabHost.TabContentFactory { @Override public View createTabContent(String tag) { View view = null; if(tag.equals("tabOneSpec")) { try { //static final String[] FRUITS = new String[] { "Apple", "Avocado", "Banana", // "Blueberry", "Coconut", "Durian", "Guava", "Kiwifruit", //"Jackfruit", "Mango", "Olive", "Pear", "Sugar-apple" }; view = (LinearLayout) layoutInflater.inflate(R.layout.subjecttabview, null); //setListAdapter(new ArrayAdapter<String>(this, R.layout.subjecttabview,FRUITS)); } catch(Exception e) { e.printStackTrace(); } } if(tag.equals("tabTwoSpec")) { try { view = (LinearLayout) layoutInflater.inflate(R.layout.chaptertabview, null); } catch(Exception e) { e.printStackTrace(); } } return view; } } How to add ListActivity in this TabActivity

    Read the article

1