Posts

Showing posts from May, 2010

JQuery UI Tabs, Change tab URL (JQuery 1.10+) -

is there way modify link tab in jquery ui through jquery/javascript? sample problem a tab have url "http://thanksforyourhelp/greatly/appreciated/" if form submitted on tab, data written database. response gives id of row added database. next time specific tab visited link should 'http://thanksforyourhelp/greatly/appreciated/id' where id known since response form (ajax here well) sent back. when response came i've reload current tab url having id in it. prior jquery 1.10. can this $("#tabs").tabs("url", index, url); how can in jquery ui 1.10+. url method removed in jquery 1.10? do in complete of form submit. change url of active tab , reloads tab. var tabs = $("#tabs"); var currenttabindex = tabs.tabs("option", "active"); var tab = $(tabs.data('uitabs').tabs[currenttabindex]); tab.find('.ui-tabs-anchor').attr('href', "http://thanksforyourhelp/greatly/app...

javascript - HTML5 Lives are not updating -

i have maze go through mouse , have function lives wich is var life = 3; function lives(){ life --; } the way displaying lives is <script type="text/javascript"> document.write("<div id='hp'>" + "lives: " + life + "</div>"); </script> i calling function these blocks arnt updating lives help! <img id="a1" src="blackpixel.png" onmouseover="lives()"/> your onmouseover update value of variable lives , not update display of lives. can add line after line --; : document.getelementbyid('hp').innerhtml = 'lives: ' + life;

how to upload image in php using iOS -

i new in web services in php don't behavior of ios upload image write down php code can me wrong in php code or there wrong in ios code $picname = $_files['name']['pic_data']; move_uploaded_file($_files["file"]["tmp_name"], 'images/'.$picname); i think must sending this: xhrregister.send({ file : selectedphoto }); and can in php this: if ($_files["file"]["error"] > 0) { // error } else { $filename = uniqid() . $_files["file"]["name"]; $filetype = $_files["file"]["type"]; move_uploaded_file($_files["file"]["tmp_name"], 'images/' . $filename); }

java - Bash non scrolling terminal output -

some programs produce output bash in way user experience strings changes values rather rows printed(bash scrolls down able show changing output). phenomena called? how achieved in e.g java program or bash script. how can output parsed? printing new lines using special function? top 1 program uses "phenomena" of outputting data okey cursors used. then how can parse them in java? tried code not print anything public static void exetest(string [] args) throws ioexception{ if (args.length <= 0) { system.out.println("empty command"); return; } process process = new processbuilder(args).start(); inputstream = process.getinputstream(); inputstreamreader isr = new inputstreamreader(is); bufferedreader br = new bufferedreader(isr); system.out.printf("output of running %s is:", arrays.tostring(args)); string line; while ((line = br.readline()) != n...

matlab - Create new 3D matrix from current 3 2D matrices -

i have 3 2d matrices, each of them represents values in dimension (x,y , z) , each of size 640x480. want put them in new matrix of size 307200x3 matrix have 307200 rows , each rows carries x,y , z values e.g x y z 1 3 4 2 1 3 3 1 1 . . . 307200 rows and on. can advise me how can this? are looking this? a = [x(:) y(:) z(:)];

java - Introduction on Opencv and JavaCV -

this question has answer here: javacv vs opencv runtime point of view 3 answers what opencv , javacv? please give simple introduction or meaning.please tell me how useful in programming language. opencv library used computer vision applications. made c/c++. javacv java implementation of same api. planning use for? if know java may able make due javavc. if plan work on embedded system opencv way go. hear khronos releasing version of openvx hardware accelerator opencv. here opencv api: http://docs.opencv.org/index.html

iphone - How to display HTML resources downloaded as zipped file in iOS -

i have requirement in have download zipped files(basically contains web resource html/js/css files) internet ios device using ios application , display content of zipped file using application. starting point of application index.html file. first have download zip file server using library asihttp have unzip zipped file using ssziparchive specific folder in document folder load uiwebview nsurl made path of index.html file inside unzipped folder.

javascript - Best way to ask confirmation from user before leaving the page -

i building registration page if user leaves, want pop css box asking him if sure or not. can accomplish feat using confirm boxes, client says ugly. i've tried using unload , beforeunload, both cannot stop page being redirected. using events, return false, maybe there's way cancel other returning false? another solution i've had redirecting them page has popup, problem if want leave page, , wasn't mistake, lose page trying go to. if user, irritate me. the last solution real popup window. thing don't main winow have destination page while pop have page. in opinion looks disjoint. on top of that, i'd worried popup blockers. just add everyones comments. understand irritating prevent users exiting page, , in opinion should not done. right using confirm box @ point. happens it's not "preventing" user leaving, client wants make suggestion if user having doubts registering. if user halfway through registraiton process , leaves reason, client want...

Can't access node-taxonomy.tpl.php through page-taxonomy-term.tpl in Drupal 6 -

i literally cry i've been trying customize taxonomy page template in drupal 6 site. what did created page-taxonomy-term.tpl.php created node-taxonomy.tpl.php entered following code in template.php function templatename_preprocess_node(&$vars) { if (arg(0) == 'taxonomy') { $suggestions = array( 'node-taxonomy' ); $vars['template_files'] = array_merge($vars['template_files'], $suggestions); } my taxonomy page picking page-taxonomy-term.tpl.php correctly doesn't pick node-taxonomy.tpl.php , tried ... any please :( thanks below few tips , attempts do: if working on subtheme, copy node.tpl.php parent theme folder under subtheme (mandatory in drupal 6 themes). try check if node-taxonomy suggestions correctly added in object $node. var_dump($node) inside main node.tpl.php , check if present. last tips: check permission of file tpl, maybe not readable web server.

php - How to limit requests for the Image from remote server -

i have free image upload center.can limit requests files on server remote servers? how? in example: if test.png requested more 1000 per day, until next day requests not accepted or redirected other path. it depended on webserver. yes, can store image lists in mysql or handle images true php, if need simple control files request limitation, can webserver, firewall ! nginx know can limited requests accepted special folder.

Does bitmap of an image remains constant throughout the lifecycle of the android application? -

okay might silly question ask. bitmap of image remains constant traversing through different activities in android. well issue : have activity image view having default image. previewing image picked gallery if user wants it. so move on next activity displaying image user picked gallery. if user hasn't picked image want show default image. please note not 1st default image in 2nd activity. if bitmap remains in drawables folder, can access every activity , remain "constant" (if that's meant). if you're using bitmap in code (to set background of imageview ), can changed - othwerise if in drawables - it's usable, can manipulate it, never change basic status (in folder).

googletest - Can I give better names to value-parameterized tests in gtest? -

i use value-parameterized tests in gtest. example, if write instantiate_test_case_p(instantiationname, footest, ::testing::values("meeny", "miny", "moe")); then in output see test names such as instantiationname/footest.doesblah/0 "meeny" instantiationname/footest.doesblah/1 "miny" instantiationname/footest.doesblah/2 "moe" is there way make these names more meaningful? i'd see instantiationname/footest.doesblah/meeny instantiationname/footest.doesblah/miny instantiationname/footest.doesblah/moe instantiate_test_case_p accepts optional 4th argument can used purpose. see https://github.com/google/googletest/blob/master/googletest/include/gtest/gtest-param-test.h#l1409 .

How to provide consistent timing of audio sequencing across various Android devices and OS Versions? -

i have created metronome-type application specified swing interval of 750 milliseconds on pendulum , playing single audio file @ maximum swing arc... repeating swinging of pendulum , playing of sound indefinitely. however, finding actual timing of execution of code varies dramatically device-to-device , performs variance on single device. intent swing pendulum @ rate of 80 beats per minute , play audio file each "beat". adjusted 750 millisecond setting accommodate time required play audio file. reduced millisecond setting 750 down 680. tested using various devices , found results of 1 minute run of metronome performed dramatically differently timing tested various android devices though defining timing elements based on milliseconds. i using android soundpool access .wav file play sound. i found quite few references soundpool timing issues , concerns have not yet found viable , reliable solution deliver consistent timing application this. it seems swing of pendulum ...

Dynamic button,Text and picturebox creation in c# -

here doing 1 project . questions present in images. when project loads , "start exam " button present in screen. after pressed button , should create picturebox, textbox , button each image specified path. users have enter answer in textbox created dynamically . after dynamic submit button clicked every image, textbox values have store in listbox. dont know how values textbox. can me out . here coding : picturebox[] pics = new picturebox[100]; textbox[] txts = new textbox[100]; button[] butns = new button[100]; flowlayoutpanel[] flws = new flowlayoutpanel[100]; private void button1_click( object sender , eventargs e) { (int = 0; < listbox1.items.count; i++) { flws[i] = new flowlayoutpanel(); flws[i].name = "flw" + i; flws[i].location = new point(3,brh); flws[i].size = new size(317,122); flws[i].backcolor = color.darkcyan; flws[i].borderstyle = borderstyle.fixed3d; ...

php - Laravel: returning results from multiple related tables using eloquent -

i'm using laravel 4 , in particular i'm looking answer uses eloquent orm. i have table " tasks " containers client_id , user_id assigned each row. client_id refers client on " clients " table , user_id refers user on " users " table. what want do : show tasks , display " clients " name , " users " first_name so result in (blade) view: @foreach($tasks $task) <tr> <td>{{ $task->user->first_name }}</td> <td>{{ $task->client->name }}</td> <td>{{ $task->description }}</td> </tr> @endforeach the above view spits out $task->client->name fine unfortunately shows "trying property of non-object" when add line $task->user->first_name my controller looks this: $tasks = task::with(array('user', 'client'))->get(); return view::make('index', compact('tasks')); as unde...

iphone - Where to build custom UITableViewCell: in layoutSubviews or initWithStyle:reuseIdentifier? -

as understand, there seem 3 ways of laying out custom table view cell: in interface builder. in layoutsubviews . in initwithstyle:reuseidentifier: . what's difference between second , third methods? also, why not drawrect ? p.s. i'm following chapter 9 of book pro ios table views tim duckett , we're building custom uitableviewcell s. author shows how lay out cell in same order above, don't know whats difference between last 2 since both away ib. noticed, though, author sets frames in layoutsubviews unlike in initwithstyle:reuseidentifier: properties concerning of view set (e.g., background image, background color, etc.). you should create cell subviews in - initwithstyle: (uitableviewcellstyle) style reuseidentifier: (nsstring*) resueidentifier and layout them in layoutsubviews. -initwithstyle:reuseidentifier method called once @ initialization, cell may have incorrect frame @ moment. thats why need layout in layoutsubviews method, it...

projection - GDAL SetProjection is not Retrieved after assigning WGS84 -

i got code set geographic projection geotiff file. podataset = (gdaldataset *) gdalopen( filename.c_str(), ga_update); ogrspatialreference osrs; char *pszsrs_wkt = null; osrs.setwellknowngeogcs( "wgs84" ); osrs.exporttowkt( &pszsrs_wkt ); osrs.setprojcs( pszsrs_wkt ); std::cout<<"setted proj: "<<pszsrs_wkt<<endl; cplerr err = podataset->setprojection( pszsrs_wkt ); std::cout<<"proj error: "<<err<<endl; double adfgeotransform[6]; cplerr err2 = podataset->getgeotransform( adfgeotransform ); std::cout<<"error: "<<err2<<endl; std::string str = podataset->getprojectionref(); std::cout<<"retrieved proj: "<<str<<endl; result proj: geogcs["wgs 84",datum["wgs_1984",spheroid["wgs 84",6378137,298.257223563,a uthority["epsg","7030"]],towgs84[0,0,0,0,0,0,0],authority["epsg","6326...

php - Compute time difference for night shift time record -

i computing time difference of night shift schedule using time only lets have data: $actual_in_time = 6:45 pm //date july 30, 2013 $actual_out_timeout = 7:00 //date july 31, 2013 i have compute time difference time in should converted whole time, therefore $actual_in_time = //(some code convert 6:45 pm 7:00 pm) $converted_in_time = $actual_in_time; now here code that: $actual_out_time += 86400; $getinterval = $actual_out_time - $converted_in_time; $hours = round($getinterval/60/60, 2, php_round_half_down); $hours = floor($hours); i not getting results wanted. how compute time difference basis time? you can use second parameter in strtotime relative time. $start = strtotime($starttime); $end = strtotime($endtime, $start); echo ($end-$start)/3600;

c# - Ajax.BeginForm absolute url MVC CORS -

is there way ajax.beginform output absolute url rather relative one? i trying forms working cors on site hosted on server. @ moment parsing form jquery onsuccess in ajax options. i not pointers tutorial on writing extension handy is there way ajax.beginform output absolute url rather relative one? yes, need specify url in ajaxoptions , not use overload takes action , controller names: @using (ajax.beginform(new ajaxoptions { url = url.action("foo", "bar", null, "http") })) { ... } url.action has overload specify protocol used generates absolute urls. , if wanted use same protocol 1 used request current action instead of hardcoding use following: @using (ajax.beginform(new ajaxoptions { url = url.action("foo", "bar", null, request.url.scheme) })) { ... }

continuous integration - Executing Bower in a CI Environment, such as Jenkins -

my jenkins running on centos 6 node.js 0.10.15 , bower 1.0.3 . i have shell task executes following: npm install bower install grunt clean package the bower installation fails when building: + bower install path.js:360 throw new typeerror('arguments path.join must strings'); ^ typeerror: arguments path.join must strings @ path.js:360:15 @ array.filter (native) @ object.exports.join (path.js:358:36) @ object.<anonymous> (/usr/lib/node_modules/bower/node_modules/ update-notifier/node_modules/configstore/configstore.js:9:7) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) @ require (module.js:380:17) build step 'execute shell' marked build failure when i'm executing bower install in terminal while logged in j...

c# - Send Android class to WCF webservice -

i trying use rest, send exposed webservice. 400 (bad request.) how property send model across rest, correctly map model on other side. don't want do, have 100 parameters exposed individually in connection point. [operationcontract] [webinvoke( method = "post", uritemplate = "savedata", bodystyle = webmessagebodystyle.wrappedrequest, responseformat = webmessageformat.json, requestformat = webmessageformat.json)] void savedata(datum data); but unable pass valid datum object. // build json string jsonstringer vehicle; try { vehicle = new jsonstringer() .object() .key("datum") .object() .key("id").value(5) .key("name").value("test") .key("no").value(54) .key("description").v...

wss - Sharepoint search returns different results from different computers -

there strange behavior wss3. have list couple of elements have dash in name, instance xxx-111 or yyy-22. if search elements on computer correctly returns element. if make same search on computer (with same sharepoint account of course) result empty. going on? missing something? thanks. maybe web front ends out of sync. rdp each of front ends, , place jpg in 12 hive. picture should number of web front end respectively. in list/document library's dispform.aspx file, use spd reference jpg 12 hive using html tag. when view page, show web front end you're looking at. this way can see web front end has syncing problem. if...that's problem.

javascript - Why can't I see my data from my drop down list saved in my database on myphp? -

i started programming im pretty new this! why can't see data drop down list saved in database on myphp? my code: <fieldset> <legend> selecteer uw categorie </legend> nieuwecategorie: <input name="nieuwecategorie" type="radio" class="form_1" value="y" onclick=" if(document.getelementbyid('namenew').disabled==true) { document.getelementbyid('namenew').disabled=false } if(document.getelementbyid('aa').disabled==false) { document.getelementbyid('aa').disabled=true } "/>yes <input name="nieuwecategorie" type="radio" class="form_1" checked="true" value="n" onclick=" if(document.getelementbyid('namenew').disabled==false) { document.getelementbyid('namenew').disabled=true } if(document.getelementbyid('aa')....

.htaccess - Apache: Missing folders rewritten to php-files -

i have site url http://localhost/my-site/ . file called test.php exists on root, folder named test not exist. when open link http://localhost/my-site/test/ , file test.php opened. should not give 404 error instead? have no .htaccess file doing funny business. rewriting seems done before .htaccess file being run, rewrite rule of test/ not match anything. rewrite rule of test.php match. i using wampserver 2.2 apache 2.4.2. this sounds mod_negotiation/multiviews issue. in appropriate place (say, in vhost config, or in htaccess file in my-site 's directory, include in options - multiviews: options -multiviews

scroll - Bootstrap 3 long modal scrolling background on Android -

i have long modal doesn't display on android mobile device, buttons bellow bottom of screen, modal doesn't scroll @ grayish background behind modal does, there css/js trick lock background , allow modal scroll while 1 displayed ? this supposed fixed bootstrap 3, not working me. able fix wit combination of -webkit-overflow-scrolling css property , setting max-height of modal. since wanted modal fill whole screen, had wire javascript detect mobile devices , set max-height of .modal-content viewport height of device here did solve using library called jrespond: add css modals @media (max-width: $screen-xs-max) { .modal-dialog { .modal-content { -webkit-overflow-scrolling: touch; overflow-y: auto; } } } add jrespond application https://github.com/ten1seven/jrespond/edit/master/js/jrespond.js add following code main.js script /* code handles responsive modal mobile */ var jres = jrespond([{ label: 'handheld'...

c# - The authentication provider returned an error. Please verify your entry and try again -

edit: turns out due characters in languages , characters such i/u etc. [httppost] /*[authorize(roles = "admin")]*/ public actionresult register(registermodel model) { if (modelstate.isvalid) { var users = _userdb.userprofiles.where(x => x.username == model.username); if (users.any()) { modelstate.addmodelerror("error", "username exists."); return view(model); } try { if (model.isadmin == false) { websecurity.createuserandaccount(model.username, model.password, propertyvalues: new { cellphone = model.cellphone, email = model.email, socialno = model.socialno, departme...

jquery - find a specific id within a html dl -

i want match value (html) of dd tag against variable. example, if id of dd tag equal id1 need match value of against stored variable. i have far, doesn't fall alert var matcheditem = msg.d[1][0]["matcheditem"]; var matchedtag = msg.d[1][0]["matchedtag"]; $('dd').find( $("#" + matchedtag) ).each( function () { if ( matcheditem == $(this).html() ) { alert("we have match"); } }); * edit ** matcheditem = 'brian' matchedtag = 'customer name' so, each customer name. if brian matched alert. any pointers appreciated. assuming matchedtag id of element want html of..then should work if ($("#" + matchedtag).html()==matcheditem){ alert("we have match"); }

windows installer - Slipstream multiple .msp patches in an administrative install point and verify it -

i install several .msp patches in administrative install point of msi setup. did 1 msp file command "msiexec /p patch.msp" know if possible , safe apply several patches administrative install point e.g "msiexec /p patch1.msp patch2.msp patch3.msp" or administrative installation , patch installation simultaneously e.g "msiexec /a setup.msi /p patch1.msp patch2.msp patch3.msp" also, there way verify patch applied successfully? think exit code of installation process enough? thank you, j. first, run msiexec /a setup.msi select path then apply patches: msiexec /a [path step one]setup.msi /p patch1.msp msiexec /a [path step one]setup.msi /p patch2.msp msiexec /a [path step one]setup.msi /p patch3.msp

android - highlight a certain word in a TextView -

do know how highlight word in textview? with highligt mean use italic typeface word "hua hin" in following string. the sandy beaches of hua hin , popular resort town in thailand. must use textview in textview acomplish this? i set text in onpostexecute-method of asynctask: protected void onpostexecute(bitmap[] bitmap) { (int = 0; < nmbrofimages; i++) { imageview[i].setimagebitmap(bitmap[i]); textview[i].settext(scrolltext[i]); textview[i].setvisibility(textview.visible); } loadalertdialog(); } i have text in xml-file if italic want can go textview[i].settext(html.fromhtml(<i>some part</i> other text); else can go spnnable here example in answer.

f# - Is there a way to restart FSI in Visual Studio? -

i'm learning f#, , keep accidentally writing infinitely recursive functions.. when call these in f# interactive (fsi) through visual studio (2010 or 2012), can't find way out of other restart visual studio. there other - ideally faster - way out? right click in f# interactive window, , select reset interactive session . cancel interactive evaluation should work if want cancel current running function keep previous results.

Prevent adding token to jQuery-TokenInput -

i using jquery-tokeninput in application.i have list of items, when enter text if matched text in list should not added. for example: if had list["abc","def","xyz"]. so if enter in "xyz" in jquery-tokeninput textbox, should not add. thanks, naresh. i'd work onadd event, , use remove function call. try along these lines. (it need debugging, think principle should work.) var list = ["abc","def","xyz"]; var newti = $("#myti").tokeninput("search.php", { propertytosearch: "val", onadd: function(item){ if ($.inarray(list,item.val)) selector.tokeninput("remove", item); }, });

php - New image is created but the old one is shown JS(AJAX) -

i have ajax function function getoutput() { var ajax = getrequest(); document.getelementbyid('output').innerhtml = "<br/>"; ajax.onreadystatechange = function() { if(ajax.readystate == 4) { document.getelementbyid('output').innerhtml = ajax.responsetext; } } document.getelementbyid('output').innerhtml = "<br/><img src=img/ajax-loader.gif><br/><br/>"; ajax.open("get", "graph_2.php", true); ajax.send(null); } html <form > <input type="image" src=img/button.jpg class=mygtukas onclick='getoutput(); return false;'> </form> <span id=output></span> which calls php code create graph. first time works fine, when user changes graph parameters , press button again (page doesn't reload) shows old graph dough there new graph created , saved in server. this because of cache of b...

html - Are property values in CSS case-sensitive? -

i have observed css properties, font-family declared quotation marks, perhaps case-sensitive, other not... how web-browsers , "html renderers" must interpret? same in css context (xml, svg, etc.) , other applications? what standards about? example: adobe indesign exported both, font-family:'optima bold' , font-family:'optima bold' . can "normalize lower case" (ex. merge similar classes)? notes references incomplete , in conflict: sitepoint.com/font-family "note font family names may case sensitive on operating systems"... valid xhtml, updated html5? font-family unique case-sensitive value? is necessary use lowercase every element , attribute , properties in css , xhtml ? indirectly "... use lowercase every properties...", , answers not negate it. comparing this question/answers , the point here , perhaps, can translated (personal) objective considerations: there (objective!) normative (w3c spec of cs...

dotnetrdf - Retrieving Specific RDF Graph Triples Based on Predicate Nodes -

i using dotnetrdf send sparql construct query , evaluate resulting igraph . for start, trying find uri nodes represent individuals of given type, say, http://www.example.com/interestingthing so, use gettripleswithpredicateobject method , passing http://www.w3.org/1999/02/22-rdf-syntax-ns#type predicate , http://www.example.com/interestingthing object. method expects 2 objects implementing inode interface , trying find respective nodes graph's geturinode method . problem: predicate not found. when looking @ igraph object in debugger, seems geturinode can find contained in nodes enumeration of graph - , contains uri nodes have been used subjects or objects, none used predicates. now, predicate uri nodes evidently there - can see them when exploring triples object of graph. appear in triple instances can retrieved directly object, , can found in predicatenodes property of same object. interestingly, querying methods of igraph such gettripleswithobje...

c# - defining bindings for elements in a collection in xaml wont work -

Image
i have simple control collection of elements. want add elements in xaml , bind element . however when bind bar.value in xaml never works. minimal example: [contentproperty("bars")] public class foocontrol : control { private observablecollection<ibar> _bars = new observablecollection<ibar>(); public observablecollection<ibar> bars { { return _bars; } } } public interface ibar { string value { get; } } public class bar : dependencyobject, ibar { public static readonly dependencyproperty valueproperty = dependencyproperty.register("value", typeof(string), typeof(bar), new propertymetadata("<not set>")); public string value { { return (string)getvalue(valueproperty); } set { setvalue(valueproperty, value); } } } <window x:class="wpftestapplication.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="htt...

java - Using SWTBot on a Maven Project -

i relatively new swtbot. i have installed through "install new software" in eclipse. i trying use on swt application imported existing maven pom.xml . application not eclipse plugin. standalone plain swt application. the problem can't seem able import of swtbot's classes in test case. i wondering if there maven artefact may need add? not finding one. if there more complex setup, how can set up? if installed swtbot plugin/bundle via eclipse you'll need eclipse plugin project depends on bundle hold tests. create new plugin project , edit manifest file import swtbot bundle. you need run configuration launch application under test. i'm not sure how can achieved standalone maven project, there's way. if project under test eclipse application, you'd need right-click on swtbot test , select run swtbot test. don't have eclipse swtbot , running atm can't give more detail, sry [ edit ] imho should first try test dummy eclipse...

java - How to load an FSdirectory index file as a RAMdirectory in Lucene? -

i have index file in hard fsdirectory size 2gb. want load in ram have better search speed. use code behind: directory dic=new ramdirectory(fsdirectory.open(new file("file path")), iocontext.default); but i'm not sure if work. know work or not? other way better on? i'll glad of suggestion.thanks. yes can construct ramdirectory it's discouraged in case. ramdirectory not designed used large data set (more 100mb). gc intensive, long construct , consume precious java heap space. if have perf issues please make sure follow guidelines descibed in this lucene faq don't forget descent search speed os needs cache part of index memory. in order must let free mem available os. if have 16gb of physical ram , 8gb index should configure jvm xmx 8g. nice linux tool check mem htop, print ram used process green (your heap space) , ram used filecache yellow (the index data). some developpers perform warm queries @ application startup prevent first user ...

php - Stripping shortcodes AND the content inside of them in Wordpress? -

in wordpress can use strip_shortcodes($content) remove shortcode brackets when showing excerpt of post, content inside shortcode? usually shortcodes things buttons/youtube links/etc, contents "click here" or youtube url, strip_shortcodes ends in excerpt this: raw post: "[button]click here[/button] lorem ipsum aptem" excerpt output: "click here lorem ipsum aptem" how can remove button contents (click here) brackets? thanks acording codex http://codex.wordpress.org/function_reference/strip_shortcodes , testing remove shortcodes , content.

c# - Accessing MDF file thread safety -

is mdf file access (when attached sqlexpress) thread safe? i have local mdf file deployed along wpf client application. i'm using mdf file persist client-specific settings. there may many threads selecting , updateing same rows @ same time , accessing file via sql connection provider simultanously. now, i'm asking wether or not can treat thread syncronization same way remote sql server databases (just leave work sql connection provider) or have wrap db calls inside critical section? thanks! i'm confused, it's microsoft sql database running on database server manages table , row locking , conflicts long use optimistic concurrency in clauses when updating rows. example update settings set = 'val' = 'old val' so of course it's thread safe.

html - twitter bootstrap screen size logic and best practices -

Image
i building responsive site using bootstrap 3. here desktop version(only header included): here mobile version: what concept achieving layout change using bootstrap 3, in usage of grid classes or media queries? i appreciate short example. thank you you use responsive utility 'hidden-lg' (hides on desktop) , 'hidden-sm' (hides on tablets/phones) css classes this.. <div class="navbar navbar-inverse hidden-sm"> <div class="container"> .. menu here </div> </div> <div class="hidden-lg text-center"> <!--custom select menu here--> <select><option>contact us</option><option>about</option><option>link</option</select> </div> demo: http://www.bootply.com/70810 but, more typical bootstrap "thing do" use nav-collapse collapse menu on smaller devices: http://www.bootply.com/cskelly/70636

ios - How to handle if app is opened from URL in didFinishLaunchingWithOptions method? -

when ios application opened url appdelegates's methods called in such sequence: 1. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions 2. - (bool)application:(uiapplication *)application handleopenurl:(nsurl *)url how know in didfinishlaunchingwithoptions method if application opened url or not. may there launching options miss? you can inspect launchoptions passed - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions . look section launch options keys in reference docs , uiapplicationlaunchoptionsurlkey

web services - Embedding security details in a SOAP message -

i working @ client have developed web service includes security context detail (like user credentials or saml token alternative) inside wsdl definition of service. is normal practice embed authorization credentials inside soap message? expect authentication details handled outside of message , should not passed inside message. can possibly point me documentation describes best practices around this?

java - Map hibernate many-to-one with the foreign key in subclass joined table -

i'm mapping entities using hibernate 3 project , explained i've got kind of this: student entity ( tstudent table) universitystudent entity ( tuniversitystudent table) university entity ( tuniversity table) universitystudent extends student , has own attributes, university itself, foreign key tuniversitystudent table. mapped subclass student class, using discriminator field: <class name="mycompany.student" table="tstudent" discriminator-value="basic"> <id name="id" column="id" type="integer"> <generator class="native" /> </id> <discriminator column="type" /> <property name="name" column="name" /> <property name="surname" column="surname" /> <property name="phonenumber" column="phone_number" /> <subclass discriminator-value=...

asp.net - how to populate my API call URL with the model binder parameters -

i have following view, fields should sent part of api call:- @using (html.beginform( "createprocess","rack", formmethod.post )) { <table width="650" bgcolor="#ffffff" cellpadding="5" cellspacing="0" style="border:1px #ccc solid" align="center"> <tr> <th colspan="4">save asset form</th> </tr> <tr> <td align="right" width="142">name</td> <td><input type="text" class="txt" name="assetname" style="width:160px;" /></td> <td width="142" align="right">asset type</td> <td><input type="text" class="txt" name="assettype" value="" style="width:160px;" /></td> </tr> ...

ruby - How to adapt usual method into method of the Class? -

need beginner(training purpose). example, have method custom_uniq , want work standard .uniq ([1, 2, 1, 3, 3].uniq >> [1,2,3]) def custom_uniq(arr) new_arr = [] arr.each |elem| new_arr << elem if new_arr.include?(elem) == false end new_arr end so, particular part should modify insert working method right class? class array def custom_uniq ????????? ???????? end end arr = [1,2,3,1,3,4,5,77] arr.custom_uniq >> [1,2,3,4,5,77] class array def custom_uniq new_array = [] each |elem| # call each method on self here new_array << elem unless new_array.include?(elem) end new_array end end or, @toro2k suggested, make use of enumerable#each_with_object method: class array def custom_uniq each_with_object([]) |elem, new_array| new_array << elem unless new_array.include? elem end end end

Exception Occurs While Opening a Downloaded Excel Sheet(.xls) In Asp.Net -

Image
i download excel sheet using following code. the above code starting code of logic.after downloaded, open excel sheet.it shows warning this because of warning,when im trying upload same page mysql database using asp.net.it shows exception "page not in correct format". this entire logic downloading excel sheet protected void download_click(object sender, eventargs e) { exporttoexcel(sqldatasource1, "studentmarks"); } public void exporttoexcel(sqldatasource datasrc, string filename) { //add response header response.clear(); response.addheader("content-disposition", string.format("attachment;filename={0}.xls", filename)); response.charset = ""; response.contenttype = "application/ms-excel"; //get data database mysqlconnection cn = new mysqlconnection(datasrc.connectionstring); // string query = datasrc.selectcommand.replace("\r\n", " ").re...