Posts

php - Codeigniter get_file_info() returns filename as false -

i building codeigniter based file browser having problem file information. i have loaded helpers: $this->load->helper('file'); $this->load->helper('directory'); when called var_dump(get_file_info('gui/default/uploads/profile_200x200.jpg')); here result: (note path relative site_url() ) array (size=4) 'name' => boolean false 'server_path' => string 'gui/default/uploads/subfold/profile_200x200.jpg' (length=47) 'size' => int 9714 'date' => int 1386054354 but when called get_filenames() or get_dir_file_info() same built-in file helper displays filenames correctly. experience or idea causes this? due bug function (read here ) use workaround: $file = 'gui/default/uploads/profile_200x200.jpg'; $fileinfo = get_file_info($file); if(!$fileinfo['name']) $fileinfo['name'] = basename($file);

algorithm - Testing tetrahedron-triangle intersection -

i want determine whether given triangle intersects tetrahedron. not want compute solution polygon(if exists) itself. there library/package/published practical algorithm can used solve problem directly (unlike attempt below)? i think last resort have use standard polygon-polygon intersection algorithm implementations solve problem indirectly . my attempt on problem: thought of breaking problem of polygon-polygon intersection. each triangular face(say t1 ) of tetrahedron , given triangle t2 , thought of doing following: compute intersection(a line) between planes corresponding each triangle, l1 . for each triangle: for each edge of triangle l2 , compute point of intersection p between l1 , l2 . test(maybe using parametric form) of l2 , if point lies on edge l2 . if both triangles t1 , t2 , there exists at least one edge on intersection point p lies, implies triangles(and hence given tetrahedron , triangle t2 ) do intersect. create orthonormal fr...

html - Get some space on top when scrolling to a <h2 id="..."> link -

this question has answer here: fixed position navbar obscures anchors [duplicate] on html page have link like: <a href="/page.htm#something"> the other page (page.htm) looks like: <h1>header</h1> <p>some text</p> <h2 id="something">the header 2</h2> etc. when follow link page.htm#something header2 on top of browser. my wish room abow it, let's 1em or so. of course can use: <a name="something"><br /></a> <h2>the header 2</h2> but that's ugly , needs lot more typing. is there way link positioned lower in webbrowser? <h2 style="padding-top:20px">the header 2</h2> i understood you?

sql server - Foreach Container to loop through Multiple Excel File to load -

Image
i have had packages in past looping through multiple text files in folder , loading sql server tables. now asked create package loop through multiple excel files in folder , load them sql server table. i went through following steps create package assuming shouldn't different have in other packages loops through multiple flat file. added execute sql task , truncating staging table, simple truncate table statement. added foreach loop container . selected foreach file enumerator , created variable called file_path data type string. added data flow task . added excel data source . , configured excel connection manager selecting 1 'excel' file in destination folder. (at point configured correctly not showing red cross or warring messages.) then selected excel file connection manager , in properties windows under expressions , selected connection string property , used user variable @user::file_path . at point excel data source showing red cross need...

java - Intent betwen 2 applications -

i ask if can pass other application data using intent. if it's possible, how can clicking button , passing other application? b1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { intent intention = new intent(?????); startactivity(intention); } }); to pass data 1 activity need add intent. e.g, intent intention = new intent(this, destclass.class); int value = 10; intention.putextra("key", value); startactivity(intention); and in destclass's oncreate() , intent with, bundle extras = getintent().getextras(); if (extras!= null) { extras.getint("key"); } to send application. create intent shown in android docs . intent sendintent = new intent(); sendintent.setaction(intent.action_send); sendintent.putextra(intent.extra_text, "this text send."); sendintent.settype("text/plain"); startactivity(sendintent); note in case android system allows a...

java - JNA Windows get process path -

i found code on stackoverflow explain how running process on windows, name , pid kernel32 kernel32 = (kernel32) native.loadlibrary(kernel32.class, w32apioptions.unicode_options); tlhelp32.processentry32.byreference processentry = new tlhelp32.processentry32.byreference(); winnt.handle snapshot = kernel32.createtoolhelp32snapshot(tlhelp32.th32cs_snapprocess, new windef.dword(0)); try { while (kernel32.process32next(snapshot, processentry)) { system.out.println(processentry.th32processid + "\t" + native.tostring(processentry.szexefile)); } } { kernel32.closehandle(snapshot); } my question is: how can process path? using jna, need define moduleentry32 structure , map required functions : import java.util.arrays; import java.util.list; import com.sun.jna.native; import com.sun.jna.pointer; import com.sun.jna.structure; import com.sun.jna.platform.win32.kernel32; import com.sun.jna.platform.win32.windef; import com.sun.jna.win32.w32apioptio...

java - How to persist tomcat sessions across restarts while using IntelliJ idea -

it seems intellij clears tomcat related folders across redeploy/restart. means every time restart tomcat intellij, have re-login our app. is there way persist tomcat sessions across restarts when using within intellij idea? the intellij configuration local tomcat instance has checkbox "preserve sessions across restarts". check that, , sessions should preserved. by way, i've seen number of developers waste lot of time on years messing around tomcat plugins in eclipse , intellij, trying figure out how them work in manner similar production. the easiest answer far use regular tomcat instance, , forego ide integration. 1 easy thing replace this, if using maven (you using build tool, aren't you?) use maven tomcat plugin .