Posts

Java md5, the PHP way -

i have been working on hours, can't work. basically developing rest client in java rest server in php. both client , server have compute md5 of string , server compare them authentication (kinda). on server, php code is: md5("gettokenapi_keybf8ddfs845jhre980543jhsjfro93fd8capi_ver1tokeniud9er£jdfff"); that generates: 4d7b2e42c3dfd11de3e77b9fe2211b87 nice! here code client: import java.security.*; .... string s = "gettokenapi_keybf8ddfs845jhre980543jhsjfro93fd8capi_ver1tokeniud9er£jdfff"; byte[] bytesofmessage = s.getbytes("utf-8"); messagedigest md = messagedigest.getinstance("md5"); byte[] thedigest = md.digest(bytesofmessage); system.out.println("string2: " + thedigest); system.out.println("string3: " + new string(thedigest)); that generates: string2: [b@42e816 string3: m{.b�����{��!� how can java compute md5 sum same way php does, please? thanks, dan give try: public ...

How to get the formula cell value(data) using apache poi -

i using apache poi3.5 , java 1.6 application. here, have 1 problem using formula... my cell has formula(sheet2!c10) , data inside cell string type...how access cell want display formula. my cell has formula(sheet2!c11) , data inside cell number type...how access cell want display formula. my cell has formula(sheet2!c10) , data inside cell date type...how access cell , want display formula. for formula cell, using poi3.8. workbook xlsworkbook = null; cell cell = null; formulaevaluator formulaeval = xlsworkbook.getcreationhelper().createformulaevaluator(); string value=formulaeval.evaluate(cell).formatasstring();

many to many - List object properties delimited by comma in CodeIgniter with DataMapper OverZealous Edition -

i have 2 classes - students , groups many-to-many relationship. on student page, want show details , list groups belongs to, delimited comma. students controller: class students extends controller { function __construct() { parent::__construct(); } function index() { $this->get_all_students(); } function get_all_students() { $s = new student(); $data['students'] = $s->select('id, name, email')->get(); $this->load->view('students', $data); } function view($id) { $s = new student(); $s->get_by_id($id); $s->groups->get(); $data['student'] = $s; $this->load->view('student_view', $data); } } i can student's details in student_view: name: <?php echo $student->name; ?> e-mail: <?php echo $student->email; ?> groups: <?php foreach ($student->groups $group) : ?> <?php echo anchor("/groups/$gro...

Android text clipping problem with EditView inside a TableLayout -

Image
i've got small clipping problem haven't been able solve using edittext view in tablerow. whatever try, edittext view either clipped (attached screenshot), or, if set shrinkcolumns either 0 or 1, label text disappears (and edittext view takes whole width). layout follows: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="10dip"> <tablelayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <tablerow android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:paddingright="10dip" android:layout_...

web applications - How to graph mixed data series with total 500k points -

i need draw graph of response time of various requests webapp. have parsed access logs application produce data file in following format: datetime,responsetime,requesttype for example: 09/nov/2010:21:00:00,0.002,event 09/nov/2010:21:00:01,0.040,action my data file has 500k lines different request types mixed up. lines ordered time. what best tool drawing 500k points on 1 graph line per request type, time along x axis , response time along y axis? in end wrote java program parse data fewer data points graph in excel. code specific particular use case won't bother paste in here.

Tutorial To learn about java mobile application development -

i want develop java mobile applications.i not find best tutorial.can 1 guide me best , easiest tutorial. thanks in advance . j2me 1. http://www.j2meforums.com/wiki/index.php/tutorials 2. http://www.java2s.com/tutorial/java/0430_ j2me/catalog0430 _j2me.htm 3. http://developers.sun.com/mobility/learn/midp/getstart/

Generate Excel Spreadsheet from CSV (ASP.NET C#) -

possible duplicate: create excel (.xls , .xlsx) file c# i have code generates zip file contains multiple csv files , streams user (no file saved on server). however, want create excel workbook instead (can traditional xls or office open xml xlsx format) each csv 'file' being spreadsheet. how can this, without resorting office automation on server or commercial 3rd party component? you can use oledb generate simple tables in excel files. note need generate temp file on server. example . note example incorrect , needs use oledbconnectionstringbuilder , this: oledbconnectionstringbuilder builder = new oledbconnectionstringbuilder(); if (isopenxml) builder.provider = "microsoft.ace.oledb.12.0"; else builder.provider = "microsoft.jet.oledb.4.0"; builder.datasource = filename; builder["extended properties"] = "extended properties=\"excel 8.0;hdr=yes;\"" using (var con = new oledbconnecti...