Posts

magento - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'SUM((IFNULL(main_table.base_total_invoiced, 0) -

i on magento 1.9.1 , worked fine. wanted uppgrade zend framework 1.12.7 1.12.13. after uppdating got error message when logging in backend. -- sqlstate[42s22]: column not found: 1054 unknown column 'sum((ifnull(main_table.base_total_invoiced, 0) - ifnull(main_table.base_tax_invoiced, 0) - ifnull(main_table.base_shipping_invoiced, 0) - (ifnull(main_table.base_total_refunded, 0) - ifnull(ma' in 'field list', query was: select `sum((ifnull(main_table.base_total_invoiced, 0) - ifnull(main_table.base_tax_invoiced, 0) - ifnull(main_table.base_shipping_invoiced, 0) - (ifnull(main_table.base_total_refunded, 0) - ifnull(main_table.base_tax_refunded, 0) - ifnull(main_table.base_shipping_refunded, 0))) * main_table`.`base_to_global_rate)` `lifetime`, `avg((ifnull(main_table.base_total_invoiced, 0) - ifnull(main_table.base_tax_invoiced, 0) - ifnull(main_table.base_shipping_invoiced, 0) - (ifnull(main_table.base_total_refunded, 0) - ifnull(main_table.base_tax_refunded, 0) ...

ajax - Javascript trim whitespace on click -

i have email form field. on click, executes javascript ... $(document).on('click', '#add_delegate', function() { registrationhelper.added_delegate = true; // var button = $(event.target); var button = $(this); var uri = button.data('url'); if (typeof uri === 'undefined') { return false; } var input = $('#email_search'); var data = {email:input.val()}; data.text().replace(/ /g,''); var spinner = $('#delegate_add_spinner'); spinner.css({display:'inline-block'}); $.ajax({type:'post', url: uri, data:data}).success(function(card) { var html = $(card); var data_id = html.attr('data-id'); var existing_elem = $('.mini_addresscard[data-id=' + data_id + ']'); if (existing_elem.length < 1) { input.popover('hide'); // in seperate timeout because ie8 damn stupid; crashes if run directly settimeout(function () { $(...

Font missing with Crystal Reports generated PDF -

Image
i have crystal report 8.5 file, need export pdf. that report contains field need represent bar code. achieve use truetype font. if open generated pdf file on machine see bar code. but if open machine doesn't have font installed, see numbers. how can assure codebar visible on pdf if computer doesn't have font installed? if not want include font, can generate image , call via http. the barcode below generated using online barcode generator courtesy of wasp: http://www.waspbarcode.com/services/waspbarcode/barcodegen.ashx?symbology=code128&code=font_missing_31301980 steps report: create blank jpg using ms paint. resize without aspect ratio checked on. insert image placer holder such 50x323 png crystal report right-click on graphic , select format graphic... click on picture tab, click on formula, enter formula create formula url above. want retrieve barcode data database , concatenate prefix , barcode field together: "http://...

python - Flask and Jinja for loop skip if file contains errors -

i'm having issue trying display thumbs. problem when run jinja2 variable displays alt text, rather have skip or pass if thumb contains errors instead of displaying alt text. here code {% block content %} {% if games %} {% g in games if g.game_thumb %} <img src="static{{ g.game_thumb }}" class="img-rounded" alt="{{ g.game_name }}" width="150" height="150"> {%endfor%} {% endif %} {% endblock %} i ended solving via flask route via. from pil import image try: image.open(thumb).verify() print "image" except: print "failed" continue

Using PHP to Create XML; Accessing via Flash -

i working on project need continuously create , update xml file. feasible way php; can't use filereference in flash because save as; cannot use filestream because i'm using flash player, not air; don't want use sharedobject because need user able access data in xml multiple computers. basically, whenever user clicks on something, flash grabs color of object. need put color, each time clicked, xml file (there 1 file; stores of colors, , continuously updated). reason needs continuously updated because there no save button; once user exits page, they're done. need progress saved. is there way generate xml using php/flash? understand how generate xml file in php, i'm unsure on how update using flash (which uses php). the main idea have right use loader in as3 php file, grab php file's data, xml file. once load php file in flash, can modify xml file using flash? if not, how modify using flash php? sorry if confusing; spent hours creating couple different ...

module - How can I use import, from import and sys.append together in Python -

i have directory add sys.path import custom modules. correct/best way use import, import , sys.path together? mean if acceptable use sys.path.append in between "imports". for example: #!c:/python27 import sys sys.path.append('c:\\users\\user\\mypythonmodules') import writedata wd import os import csv collections import defaultdict edit: i should have mentioned writedata custom module want import wd . module writedata located in c:\\users\\user\\mypythonmodules yes, is. there no syntax or semantic rule in language prevents that. i not aware of "style" rule may breaking, in case, option providing pythonpath python interpreter.

asp.net mvc - Cannot display error message on Editor or EditorFor -

in mvc application, can display error messages inputs i.e. textboxfor , dropdownlist , etc. however, using same approach, cannot show validation error kendo().editor() or kendo().editorfor() . tried validationmessage beside validationmessagefor , not make sense. might problem be? view: <script type="text/javascript"> $(function () { //for using kendo validation: $("form").kendovalidator(); }); </script> //validation works textboxfor, dropdownlist, etc.: @html.labelfor(m => m.summary) @html.textboxfor(m => m.summary, new { maxlength = 50, @class = "k-textbox"}) @html.validationmessagefor(m => m.summary) //validation not work editor or editorfor: @html.labelfor(m => m.description, new { maxlength = 1000, @class = "editor-label" }) @(html.kendo().editor() //@(html.kendo().editorfor(m=>m.description) //also tried .name("description") .htmlattributes(new { @class...

c# - How to make TableLayoutPanel with resizable cells like using Splitter -

got tablelayoutpanel 1 column , n rows needed cells resizable somthing splitter component between cells. without using splitcontainer. may other idea without tablelayoutpanel? it depends on want it: datagridview brings interactivity, cells neither controls nor containers.. you can try if tablelayoutpanel subclass want: public partial class splittablepanel : tablelayoutpanel { public int splittersize { get; set; } int sizingrow = -1; int currentrow = -1; point mdown = point.empty; int oldheight = -1; bool isnormal = false; list<rectanglef> tlprows = new list<rectanglef>(); int[] rowheights = new int[0]; public splittablepanel() { initializecomponent(); this.mousedown += splittablepanel_mousedown; this.mousemove += splittablepanel_mousemove; this.mouseup += splittablepanel_mouseup; this.mouseleave += splittablepanel_mouseleave; splittersize = 6; } void spli...

How do I change CSS submenu width so it doesn't used the same width as the main menu? -

i'm using css submenus working ul > li > ul > lu. current css code using: #nav li:hover ul.sub {left:1px; top:38px; background: #bbd37e; padding:3px; border:1px solid #5c731e; width:100%; height:auto;} the width find top menu, within sub menu, uses original width value top menu. if change width 325%, submenu wide enough top menu wide. i've been messing css format, can't seem submenu hold own 100% width value separate top menu. does have solution on how use 100% width match contents, , not value of top menu? if wants peak see mean, can have here: http:// i have set 100% width show results of submenu. due way have css written, want change following rule in css file: #nav li:hover li:hover ul, #nav li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover li:hover ul { left: 100%; /* may want use "left:calc(100% + 3px);" account padding */ width: auto; }

javascript - Web API call to controller not working, breakpoints not hit, prior versions of code no longer work (UPDATED WITH ANSWER) -

a view in intranet asp.net mvc website uses web api render image thumbnails when user hovers on documents (normally, graphic appears looks first page of document). i'm stuck because code working before; i'm not sure if outside code modification third party (or bad code on part) broke it, don't see image thumbnails. i'm having difficulty determining happened. here's i've done far: modified code directly this 1 of first things do: presume mistake due kind of error (or forgot do). problem area focused on javascript/jquery snippet, inside <script> area of code on view: $(".tile2").each(function () { $(this).tooltip({ content: "<img src='/jportal/api/portaldocument/thumbnail?u=" + this.id + "' />" }); }); the .tile2 class reference each individual document rendered on page. $(this).tooltip *has code thumbnail functionality. * this.id is reference unique id each file (which looks long ...

c# - POST to my localhost on port 5587 -

Image
i want able write code interacts app running on computer listening on port 5587. static void main(string[] args) { httppost("http://localhost:5587", "/send/?username=testingname&password=testingpw"); } public static string httppost(string uri, string parameters) { system.net.webrequest req = system.net.webrequest.create(uri); req.proxy = webrequest.defaultwebproxy; //add these, we're doing post req.contenttype = "application/x-www-form-urlencoded"; req.method = "post"; //we need count how many bytes we're sending. params should name=value& byte[] bytes = system.text.encoding.ascii.getbytes(parameters); req.contentlength = bytes.length; system.io.stream os = req.getrequeststream(); os.write(bytes, 0, bytes.length); //push out there os.close(); system.net.webresponse resp = req.getresponse(); if (resp == null) return null; system.io.streamreader sr = new system.io.st...

assembly - Converting binary word microinstruction to mnemonic -

Image
the binary words i'm referring image: i have found believe correct answers. want double check , sure. line1: r[33] <- sext13(r[37]); line2: r[33] <- add(r[rs1], r[33]); goto 1793; line3: r[33] <- add(r[rs1], r[rs2]); if r[ir[13]] goto 1810; i appreciate can give me yes right at least if r[ir[13]] means bit 13 of %ir , not register number ir[13] possibly r0 or r1 ir[13] bit. a more detailed analysis: line 1 amux b bmux c cmux wr rd alu binary 100101 0 000000 0 100001 0 0 0 1100 meaning 37 mir 0 mir 33 mir no wr. no rd. sext13(a) cond jump addr binary 000 00000000000 meaning use next address 0 encodes: r33 = sext13(r37) , move next microcode location . line 2 amux b bmux c cmux wr rd alu binary 000...

ASP.net what is MasterPageFile attribute? -

<%@ page title="" language="c#" masterpagefile="~/views/shared/site.master" inherits="system.web.mvc.viewpage<modelcentral.abmodel>" %> asp.net means masterpagefile attribute? each .aspx page can reference master page. master page can define general layout specific page (obviously can use masterpage multiple pages). imagine have standard website main menu, content area , footer. master page include main menu , footer since don't change. master page contains <asp:contentplaceholder> later populated content of .aspx-page. a master page can contain multiple <asp:contentplaceholder> . in .aspx-page can use <asp:content> control populate <asp:contentplaceholder> content. note have match contentplaceholderid of <asp:content> correct id of `. read this article more information on subject.

node.js - Tailable cursor closing when reaching end of collection -

i attempting stream data mongodb capped collection follows: var query = {}; var options = {tailable: true, awaitdata: true, numberofretries: number.max_value}; var stream = mycoll.find(query, options).stream(); stream.on('data', function(doc){ console.log(doc); }).on('error', function (error){ console.log(error); }).on('close', function () { console.log('closed'); }); this prints documents expected upon reaching end of collection stream closes. possible prevent happening? looking have program print data arrives in collection, waiting @ end of collection indefinitely more data. solved problem. turns out issue wasn't formatting options correctly. mycoll.find().tailable(true, { awaitdata: true ,numberofretries: number.max_value}).stream(); is correct , works expected.

zend framework2 - How can I use > and < operation in zf2 doctrine custom repository -

i want run $qry = $qb2->where("n2.userfk!=0 , n2.id >1 <20") in doctrine repository not working. giving error > , < operators. use expressions : $expr = $qb2->expr(); $qry = $qb2->andwhere( $expr->neq('n2.userfk', 0) $expr->andx( $expr->gt('n2.id', 1), $expr->lt('n2.id', 20) ) );

objective c - iOS Customize UItableView header -

Image
i new ios development. pretty familiar android , android studio struggling ios , xcode. basically want add title header, under title provided through creating uitableview. there way through storyboard, or code better option? if so, how should attempt this. have not been able find google searching , information have found isn't incredibly applicable. this first question can't add picture. looks , want add second title display date , location under event name: event name ------------- from storyboard can drag uiview uitableview, above cells in table, become headerview. there can drag whatever want view.

docker - How to make Secure Gateway Client to resolve the hostname of the destination's host -

i use hostname instead of ip address destination's host in bluemix secure gateway. use docker secure gateway client. tried realize editing /etc/hosts of host os in docker secure gateway client installed , running sg client --net=“host” or --add-host=hosname:ip address. secure gateway service seems not use dns regarding following q&a's answer, tried use /etc/hosts. how resolve sg client's enotfound error but couldn't succeed, sg client got enotfound. teach me how make secure gateway client resolve hostname of destination's host. [results of --net=“host“] i confirmed host os resolved hostname. #ping httpserver1 ping httpserver1 (192.168.56.1) 56(84) bytes of data. 64 bytes httpserver1 (192.168.56.1): icmp_seq=1 ttl=128 time=7.10 ms 64 bytes httpserver1 (192.168.56.1): icmp_seq=2 ttl=128 time=6.89 ms i ran sgclient --net=“host“ # docker run -it ibmcom/secure-gateway-client xxxxxxxxxx --net=“host“ ibm bluemix secure gateway client ver...

javascript - Showing wrong date conversion in angular v1.1 -

i having time="2015-06-26t18:50:07.000z" using angularv1.1 ,i can not use utc , dont have milliseconds well, have time string in html <div ng-app='myapp' ng-controller="myctrl"> {{date | date:"mm/dd/yyyy" }} </div> in controller var x="2015-06-26t18:50:07.000z" var app=angular.module('myapp',[]); app.controller('myctrl',function($scope){ $scope.date=x; }); where want output 06/26/2015 , showing 06/27/2015 may problem of gmt or utc whatever . please suggest me ,what can show 06/26/2015 fiddle: http://jsfiddle.net/obv10wd9/2/ please check one. you can this. var x="2015-06-26t18:50:07.000z" var app=angular.module('myapp',[]); app.controller('myctrl',function($scope){ var date=new date(x); $scope.date = new date(date.gettime() +(date.gettimezoneoffset()*60000)); console.log(typeof $scope.date) }); here updated fiddle

r - Error: term has fewer unique covariate combinations than specified maximum degrees of freedom -

i'm trying smooth mortality data, error when try call smooth.demogdata(...) . don't have lot of years work (just 2004-2014), , ages 1-11. need have smoothed mortality data able run lee-carter models. > us.demog.age = demogdata(us_rates.age, us_counts.age, ages = 1:11, years = 2004:2014, type="mortality", name="total", label="us") > smooth.age = smooth.demogdata(us.demog.age) error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) : term has fewer unique covariate combinations specified maximum degrees of freedom the matrix data have demography data call follows: > us_counts.age 135618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 150988, 125213, 0, 0, 0, 0, 0, 0, 0, 0, 0 144797, 144686, 117643, 0, 0, 0, 0, 0, 0, 0, 0 145921, 138953, 136791, 110374, 0, 0, 0, 0, 0, 0, 0 146350, 139452, 131145, 128469, 103897, 0, 0, 0, 0, 0, 0 159301, 139080, 130705, 122500, 120655, 97922, 0, 0, 0, 0, 0 169750, 151355, 130195, ...

c# - Microsoft Access OledbDataReader read values error -

i connecting ms access file jet engine x64,but worked x86 platform. getting error while trying read data long sizecounter = 0, rowindex = 0; var secondvalues = new object[batchsize][]; (var secondindex = 0; secondindex < secondvalues.length; secondindex++) secondvalues[secondindex] = new object[reader.fieldcount]; while (reader.read()) { //todo:error here... reader.getvalues(secondvalues[sizecounter]); sizecounter++; if (notifyafter > 0 && (rowindex % notifyafter == 0 && rowindex > 0 && rowscopied != null)) { rowscopied(this, new rowscopiedeventargs(rowindex)); } if (sizecounter == batchsize) { runbulkcopy(secondvalues); sizecounter = 0; } rowindex++;...