Posts

c# - Visual Studio shuts down repeatedly when formatting code -

"microsoft visual studio 2013 has stopped working" i format code using ctrl e + d. works, causes visual studio shut down. can't pinpoint why this. perhaps it's setting i'm missing (or accidentally changed)? work computer never this. personal computer. this happens 99% of time on views, not code in classes, css, or js . i've attempted make sure html/code correct (no red underlines or green "for html") when formatting, hoping solves problem. can format code on view, on same view, format again (after changes), , it'll (vs) shut down. does happen else? windows 8 visual studio 2013 ultimate webessentials i don't have resharper installed. i have enough memory cpu isn't 100% its memory problem,please clear recent,%temp% , temp files run command afirst of close windows . eg:in windows press start+r -->run command window appears then type recent , hit enter .then select , delete files then type %temp...

javascript - How to display row of images in a repeater control vertically instead of horizontally -

i'm trying make image slider repeater control in asp.net. have div repeater control in images, can't figure out how make display vertically instead of horizontally. can point me correct css style? i've tried using vertical-align property on div. here link javascript file carosuellite <script type="text/javascript" src="scripts/jquery-1.11.3.js"></script> <script type="text/javascript" src="scripts/jquery.jcarousellite.js"> </script> <div class="container"> <div id="navicontainer"> <ul> <asp:repeater id="rptslider" runat="server"> <itemtemplate> <li><a href="#"> <asp:image id="imgslide1" runat="server" imageurl='<%#container.dataitem %>' height="128" ...

elasticsearch - enabling TTL on an entire index -

question pretty straight forward, there way enable ttl on index level. means types created under index inherit enabled ttl. on documentation said "you can provide per index/type default _ttl value follows", wasn't able request ttl on index level. in case isn't possible, workaround can suggested ? in our environment new types created time, , data has removed after not needed anymore. you can accomplish using default option under mapping. under index , if put configuration under_default_ applied mappings these configurations not defined under same index. curl -xput "http://localhost:9200/test_index" -d'{ "mappings": { "_default_": { "_ttl": { "enabled": true } } } }'

php - File_exists function is not working -

Image
since problem on file_exists() , seems function should goes root directory, when determine file location on file_exists function declare base url because tests file location server not url : wrong code $dir = base_url()."assets/produits/"; foreach ($rows $row) { $nom = $row->nshape; $type = array(".jpeg", ".jpg"); foreach ($type $ext) { echo "<br>i'm in foreach loop <br>"; $file_name = $dir . $nom . $ext; if (file_exists($file_name)) { echo "i'm in file_exists function<br>"; $img_src = $file_name; } else { echo "i'm in else statement <br>"; echo $file_name."\n"; $img_src = $dir . "none.png"; } } } the problem full name there treat doesnot exists, i've made echos check did ...

Entity Framework 6, Transaction Scope, Context and SaveChanges -

question pertains transaction scope , context.savechanges() . if i'm processing million records foreach , , save after every, let's say, 1000 records calling context.savechanges() inside transaction scope , fails after 10 000 have been processed , savechanges() called, saved data rolled back? example: using(transactionscope ts = new transactionscope( transactionscopeoption.requiresnew, new timespan(0, 10, 0))) { int counter = 0; using (myentities context = new myentities()) { foreach(var item in context.items) { //process item if(counter >= 1000) { context.savechanges(); //if fail here, saved changes rolled back? counter = 0 } } context.savechanges(); } ts.complete();//what here? } the transaction scope takes precedence long dbcontext enrolled in it, default. thus, if don't call transactionscope.complete (e.g. because d...

Unable to upload file when using JQuery file upload, Spring MVC and Spring Security. -

i implementing simple website image upload. frameworks in use jquery file upload spring mvc spring security i've implemented form , controller file upload when trying read files, files seems unavailable. i've struggled security _csrf while i've figured out. when try read files no files can read when reaching controller. here source code https://gist.github.com/adelinghanaem/f67b311cda7aa9efe83c after lot of debugging , checking spring security/mvc architecture i've came with: @requestmapping(value = "/upload", method = requestmethod.post) public responseentity<uploadpictureresult> pictureupload(firewalledrequest initialrequest) { defaultmultiparthttpservletrequest request = (defaultmultiparthttpservletrequest) initialrequest.getrequest(); try { multipartfile multipartfile = request.getfile("files[]"); list<multipartfile> multipartfilelist = request.getfiles("files[]"); ...

mysql - select all rows that have more than two matching composite keys in a table -

mysql fiddle i have composite table , i'm trying select rows has both 1 , 2 in pk2 column. can see, i've write query job using join... yeah. it's okay not satisfying. i'm afraid if code messy , slower adding more joins in query when needs more 10 constraints. is there faster & cleaner way same result? assumption: there can more 10 constraints in worst scenario. unlikely possibly. what i've tried far: i tried using union didn't work & thought it's 1 of worst options choose when comes performance efficiency. i tried in (....) it's same or b... not intended. i tried subquerying in clause... more constraints has, worse nightmare becomes. this sounds "set-within-sets" query. approach group by , having . provides flexible logic handling many different situations: select t1.pk1 t1 pk2 in (1, 2) group t1.pk1 having count(*) = 2; this assumes rows in table unique (otherwise use count(distinct) . here s...