Posts

javascript - Force Masonry/similar to ignore flow and fill gaps instead -

masonry/isotope/freetile , rest great job @ absolute positioning elements in grid/container. however, when element takes full width of grid/container, creates massive gaps not acceptable outcome. here jsfiddle problem: http://jsfiddle.net/qnf3a/1/ there's enough room on top of red div place green one. however, different libraries tend respect flow opposed "leave no gaps" philosophy. does know of alternative js library or similar trick avoid gaps? - code jsfiddle... html: <div id="container"> <div class="block half"></div> <div class="block full"></div> <div class="block half"></div> <div class="block half"></div> <div class="block half"></div> </div> css: #container{ width: 600px; background-color: #eee; } .block{ float: left; } .half{ width: 300px; height: 100px; background-co...

python - How can I make folder in AWS S3 bucket with django-storages? -

i tried following: f = default_storage.open('test/', 'w') f.write('') f.close() but returned error: the xml provided not well-formed or did not validate against our published schema there no such thing folder in s3. if save file path 'fake' directory structure. https://stackoverflow.com/a/2141499/682968 add folder in amazon s3 bucket

c# - TeeChart RedCross Error Continued -

this post corresponds answer on previous post... before upload simple project you, let me try else: noticed when swap points series colorgrid series same thing happens, but, when (with colorgrid series) use "mycolorgrid.yvalues[gridposition] = val" instead of mycolorgrid.add(x, y, z) works. there way can use points series in same way, ie, allocate points first time, , use xvalues[idx] = x, , yvalues[idx] = y update points? problem seems happen when use add method, clear method. when update values xvalues , yvalues etc. problem seems solved! thing is, can not work on points series...it easy colorgrid series: (int r = 0; r < 128; r++) { (int d = 0; d < 128; d++) { mycolorgrid.yvalues[d * 128 + r] = some_value; } } mycolorgrid.beginupdate(); mycolorgrid.endupdate(); question 1: how achieve same points series? question 2: ...

c# - WCF Teseract error: Attempted to read or write protected memory... on exe works fine -

i use teseract v2 ocr image, it's work fine in exe, when try on wcf everythime exception: attempted read or write protected memory. indication other memory has been corrupted. the same code on exe (work) , wcf (exception): var processor = new tesseractprocessor(); processor.setvariable("tessedit_char_whitelist", metadata.textregexpattern); processor.init(@"../../tessdata/" + language + ".traineddata", language, 3); processor.setpagesegmode(_pagesegmentationmode); processor.analyselayout(source); return processor.recognize(image.fromfile(filepath)); // here's problem recognize method

c# - Repeat a listbox that opens files -

hello want listbox playlist repeat after last file played. how reset index repeats start of listbox? shownextimage handles media 1 one show on mediaelement. dispatchertimer shows images 20 seconds , continues. this got. dictionary<string, string> listbox1dict = new dictionary<string, string>(); public static list<string> images = new list<string> { ".jpg", ".jpe", ".bmp", ".gif", ".png" }; // bildtyper som stöds public static list<string> movies = new list<string> { ".wmv", ".wav", ".swf", ".mp4", ".mpg", ".avi" }; list<string> paths = new list<string>(); dispatchertimer dispatchertimer = new dispatchertimer(); dispatchertimer nextimagetimer = new dispatchertimer(); int x = 20; private int currentsongindex = -1; private void shownextimage() { if (currentsongindex == -1) ...

reflection - Java - How Can I Check If A Class Is Inheriting From Some Class Or Interface? -

i need check: public static boolean check(class<?> c, class<?> d) { if (/* c inherits d */) return true; else return false; } how can ? and possible without c.newinstance() ? title wrong @ first time. it's correct. use isassignablefrom if(d.isassignablefrom(c)){ // d superclass of c // in other words, c inherits d } determines if class or interface represented class object either same as, or superclass or superinterface of, class or interface represented specified class parameter. returns true if so; otherwise returns false. if class object represents primitive type, method returns true if specified class parameter class object; otherwise returns false. source

codeigniter - jQuery autocomplete retrieve with an image -

i need using autocomplete image inside result (similar how facebook's autocomplete works). however, want start basics... great example found here: http://jsfiddle.net/k5q5u/249/ <input id="auto" type="text" /> css: img { width: 25px; height: 25px; padding-right: 10px;} .ui-autocomplete > li { height: 40px; } javascript: $(document).ready(function () { $("#auto").autocomplete({ source: function (request, response) { $.ajax({ url: "http://api.stackoverflow.com/1.1/users", data: { filter: request.term, pagesize: 10 }, jsonp: "jsonp", datatype: "jsonp", success: function(data) { response($.map(data.users, function(el, index) { return { value: el.display_name, ...

c# - Client datetime vs Server datetime -

i have c# web application has been installed in server , database in server. accessing application india. when user sign up, choose reporting date calender control has current system date time selected default , user creation date inserted background c# code. since using application in local country browser, that's why both dates different. there anyway resolve conflicts. obuser.creationdate = datetime.now instead of datetime.now use: datetime.utcnow . utcnow acording msdn : gets datetime object set current date , time on computer, expressed coordinated universal time (utc).

Android: Error when pressing back button, even after finishing the previous activity -

i getting nullpointer exception somewhere near line using getintent.getextra(). this error log: 04-25 14:19:43.718: e/androidruntime(10031): fatal exception: main 04-25 14:19:43.718: e/androidruntime(10031): java.lang.runtimeexception: unable start activity componentinfo{com.example.attendence/com.example.attendence.userpage}: java.lang.nullpointerexception 04-25 14:19:43.718: e/androidruntime(10031): @ android.app.activitythread.performlaunchactivity(activitythread.java:1651) 04-25 14:19:43.718: e/androidruntime(10031): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1667) 04-25 14:19:43.718: e/androidruntime(10031): @ android.app.activitythread.access$1500(activitythread.java:117) 04-25 14:19:43.718: e/androidruntime(10031): @ android.app.activitythread$h.handlemessage(activitythread.java:935) 04-25 14:19:43.718: e/androidruntime(10031): @ android.os.handler.dispatchmessage(handler.java:99) 04-25 14:19:43.718: e/androidruntime(1003...

php - Using die() in functions under CodeIgniter -

i'm writing web application in codeigniter , i'm trying apply user activation. function is_active() { $active_state = $this->my_model->check_active(); if ($active_state == 'no') { $this->load->view('activation_page'); die(); } } above code produce blank page , if remove die(); if print out members_area alongside activation_page so how can force load requested view , exit? obviously not going inside if statement, meaning if user not active, load activation page. still don't have else, load view if user active. try: if ($active_state == 'no') { $this->load->view('activation_page'); } $this->load->view('members_area'); note: might want revert if condition. looks more logical check if user active, otherwise fallback activation page. edit: please refer code: http://paste.laravel.com/pfo note 2: 1 of many possible soluti...

css - MVC 4 data validation message increases width of my form -

Image
i creating quite simple form model. have generated scaffolded "edit" view validation. 1 validation "url" type , causing me problems. i have in view: <div class="editor-label"> @html.labelfor(model => model.server) </div> <div class="editor-field"> @html.editorfor(model => model.server) @html.validationmessagefor(model => model.server) </div> this css #content section contains rendered view: #content { border:solid; border-width:thin; position:relative; margin-left: auto ; margin-right: auto ; text-align:center; margin-top: 50px; min-width:480px; max-width:800px; display:table; padding: 30px; } when page loaded, #content 480px wide , elements inside take space possible (editor-field elements , element submit buttons set 100%, nothing else has width set in css). when "required" validation message displayed on fields...

jquery - DatePicker in MVC4 -

i using @html.jqueryui().datepickerfor helper method in mvc4 application. showing calender correctly @ first time not showing once form posted. can tell me missing in it? i suspect using ajax submit form , in case of successful submission refreshing contents , date picker no longer bound input field. inside success callback of ajax request need rebind it: success: function(data) { $('#some_id').html(data); $('#id_of_your_input_element').datepicker(); } or if using ajax.beginform subscribe success event in ajaxoptions: @using (ajax.beginform(new ajaxoptions { success = "success", updatetargetid = "someid" })) { ... } and write success callback: function success(data) { $('#id_of_your_input_element').datepicker(); }

c# 4.0 - Not found exception When start the ManagementEventWatcher -

not found exception times while starting maagementeventwatcher my code sample given below : try { string scopepath = @"\\.\root\default"; managementscope managementscope = new managementscope(scopepath); wqleventquery query = new wqleventquery( "select * registrykeychangeevent " + "hive = 'hkey_local_machine'" + @"and keypath = 'hardware\\devicemap\\serialcomm'"); registrywatcher = new managementeventwatcher(managementscope, query); registrywatcher.eventarrived += new eventarrivedeventhandler(serialcommregistryupdated); registrywatcher.start(); } catch (exception ex) { console.writeline(ex.message); if (registrywatcher != null) { registrywatcher.stop(); } } exception: not found @ syste...