Posts

Showing posts from May, 2010

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

asp.net - check if form was submitted from my website -

i have signin form on website inside page users can search stuff after signing in. there third party mobile application letting users signin through submitting form on signin.aspx page website. my question how can tell if form being submitted third party , not website? as claudio stated, can not reliably use "referer" value. value can spoofed. safer approach employ csrf token, or akin that. for example, include asp.net session id in hidden form element. then, when form submitted, compare value of form element user's session id. if not match, form submission didn't come website.

python - Discrete density plot in matplotlib -

Image
i have 2d numpy array , want create discrete density plot using it. discrete in sense @ each point (i,j) on plot dot should placed color should correspond value of (i,j) th element of 2d array. not want use imshow because not want interpolation , want control size dots placed. have tried imshow interpolation='nearest' ? close want? import matplotlib.pyplot plt import numpy np data = np.arange(100).reshape(10, 10) fig, ax = plt.subplots() ax.imshow(data, interpolation='nearest') plt.show()

version control - Migrating from Mercurial to Git -

Image
i know question asked before several times , marked "possible duplicate", none of them seems working correct. tried fast-export , gives error. how migrate mercurial git? need history. appreciated if listed step step. update: i tried fast export: cd ~ git clone git://repo.or.cz/fast-export.git git init git_repo cd git_repo ~/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo **[i error in line]** git checkout head this gives error: ..... hg-fast-export.sh: line 79: python: command not found thanks help! add hg-git mercurial push hg-repo git-target step-by-step guide a clone hg-git extension it's repository local path\to\hg-git b enable extension in (global mercurial.ini or repository's-specific .hgrc) [extensions] bookmarks = ... hggit = path\to\hg-git bookmark added long time ago, when extension wasn't part of tortoisehg|mercurial, not sure today's configuration c create new git-repository read|write access

sql server - How to convert a group of xls 2 tab delimited files using ssis? -

how convert group of xls files tab delimited files using ssis ? got script doing on google search.please sugest me how achieve using ssis dim objfso, objfile, objfiletsv dim strline, strnewline, strnewtext dim filenamelength, linelength, newfilename, linepos, quote, quotecount, totalfilesconverted objfso = createobject("scripting.filesystemobject") strcurpath = objfso.getabsolutepathname(".") totalfilesconverted = 0 each objfile in objfso.getfolder(strcurpath).files if ucase(right(objfile.name, 4)) = ".csv" filenamelength = len(objfile.name) - 4 newfilename = left(objfile.name, filenamelength) & ".tsv" objfile = objfso.opentextfile(objfile, 1) until objfile.atendofstream strline = objfile.readline linelength = len(strline) linepos = 1 strnewline = "" quote = fa

optimization - Division of high numbers in assembly -

i tried find location of crusor array of 1896(becomes whole console in 2d, 79*24). took location , divided 79. mov ax, [y-16h] dec ax mov bx, 79 div bx mov z, dl add z, dh mov dl, z mov z, al add z, ah mov dh, z i overflow error. can tell me doing wrong please? maybe suggest solution? div bx divides 32-bit number formed dx (high word) , ax (low word) bx . therefore need clear dx (e.g. xor dx,dx ) prior division avoid overflow. by way, sure don't want divide 80? i've never heard of 79-column console, although i'm no expert on such matters

c++ - what does it mean for `new` to be no-throw guaranteed when bad_alloc is not thrown -

from documentation of new : the first version (1) throws bad_alloc if fails allocate storage. otherwise, throws no exceptions (no-throw guarantee). to me, should mean code #include <new> struct a{ a(){ throw 0; } }; int main(){ try{ a* = new a; } catch(std::bad_alloc&){} } is fine. however, when compiling gcc (see here ), program terminates after throwing int . that's documentation of operator new , not same new expression. new expression calls operator new obtain memory and then calls constructor requested on memory. operator new not throw other std::bad_alloc , later call constructor can throw whatever user code wants. compare new expression operator new .

vim regex the pipe is not escaped in a execute command -

i trying create operator pending mapping markdown headers, exercise in learning vim script hard way here line vimrc: autocmd filetype markdown :onoremap ih :<c-u>execute "normal! ?\\(^==\\+$\\|^--\\+$\\)\r:nohlsearch\rkvg_"<cr> i have error e486: pattern not found: \(^==\+$|^--\+$\) i tried modifications have same result, it's pipe never escaped ! inside :map command, use <bar> instead of pipe symbol: autocmd filetype markdown :onoremap ih :<c-u>execute "normal! ?\\(^==\\+$\\<bar>^--\\+$\\)\r:nohlsearch\rkvg_"<cr> that long :normal command (that executes search, ex command, , more commands, separated \r ) ugly. you'd better use :call search(...) instead of ? command, , factor out multiple commands :function .

asyncsocket - c# ReceiveAsync lag -

while trying read data tcp socket using receiveasync.completed, experience few ms delay (1-5ms, once in while) between time data arrives application , time arrives machine. use wireshark compare timestamps, psh bit turned on messages , application not busy or blocking anything. missing ? thanks. with such small delay come anywhere, garbage collector kicking in delay easily. wireshark isn't operating on same level application. it's getting data @ different times because system supplying little faster. or maybe times off. maybe times off. such small difference hard tell. i bet you're not doing wrong.

read json data in java -

i'm in situation have read json data , insert sqlite table. json data in format : { "result": "success", "data": { "userid": "873", "volume": "0.5", "schoolid": "0", "schoolname": "", "preferredlanguageid": "1", "fname": "robin", "lname": "singh", "email": "rob@live.com", "password": "password1111", "isparent": "0", "countryid": "254", "stateid": "143", "state": "", "city": "san diego", "coins": "0", "zip": "", "players": [] } } jsonobject json = new jsonobject(jsonstring); s

database - Diagnosing the cause of slow Oracle application -

we have windows application saves data oracle database - nothing particularly complicated, adding row few numbers table. application has been installed @ 1 of clients many years , has worked absolutely fine. however, have relocated oracle servers country , complaining application running slowly. i sure can related network speeds @ end, , not our application. are there tools out there diagnose exact cause of slowness? also, there modified in program make work faster in situations oracle database remote? thanks! update a user has fill in few numbers in textboxes , clicks button, sends these results database. updates 'summary' table users session, saving how many times user has clicked button. that's 1 insert , 1 update. other thing audit trail saves 20 one-column rows of data table. enough make application slow down point it's unusable? we're not doing reconnecting every time send sql query - connection made once @ start of program , closed when exits.

Rails conditions don't work for me with includes with nested calls -

i'm trying this: @usages = quoteproduct.includes(:quote => :event).where(:quote => {:booked => "1"}).where(:quote => {:event => { 'end_at >= ?', @quote.event.start_at }}) notice condition @ end of last where. but get: syntax error, unexpected ',', expecting tassoc ... => {:event => { 'end_at >= ?', @quote.event.start_at }}) any idea i'm doing wrong? ...{ 'end_at >= ?', @quote.event.start_at }... i believe style of condition requires array. ['end_at >= ?', @quote.event.start_at]

jquery - DataTables plugin changes header & footer background color accidentally -

i'm using datatables jquery plugin display grid. have modal popup changes background color of entire form and, accidentally, background color of before mentioned table's header & footer background color. code used initialize popup: var modalbackground = $("#modalbackground"); var notifications_archiveholder = $("#notifications_archiveholder"); var notifications_showarchivepopupholder = $("#notifications_showarchivepopupholder"); var archiveurl = "@url.action("archive")"; var showarchiveurl = "@url.action("showarchive")"; function showarchivepopup() { $.get(archiveurl, function (content) { if (notifications_archiveholder.html().length <= 10) { notifications_archiveholder.html(content); initarchivepopup(); } }) } function initarchivepopup() { modalbackground.show(); //set positon var h = $(window).height(); var w = $(w

tsql - Return number of working days between 2 dates minus weekend and bank holidays -

Image
hi trying script tsql function return number of working days between 2 dates minus weekend days , uk public holidays, here have far (due lack of experience there may syntax errors etc, appreciate corrections): create function dbo.fn_workdays (@startdate datetime, @enddate datetime) --define output data type. returns int --calculate return of function. begin return (select (datediff(dd,@startdate, @enddate)+1)-(datediff(wk,@startdate, @enddate)*2)-(case when datename(dw, @startdate) = 'sunday'then 1 else 0 end)-(case when datename(dw, @enddate) = 'saturday' 1 else 0 end) )end go now have access table (or can copy if need be) stored uk bank holidays here screeny of setup: im new tsql , struggling way through list of bankhols , remove them returning int of function , therefore return correct number of working days between 2 dates passed function. any , advice appreciated (especially if written in easy understand form ;) ) i hav

iphone - How to wait in NSThread until some event occur in iOS? -

how wait inside nsthread until event occur in ios? eg, created nsthread , started thread loop. inside thread loop, there condition check whether message queue has messages. if there message, call corresponding method operation, else should wait until message queue gets populated new message. is there api or methods available wait until event occur? for example nsthread *thread = [nsthread alloc]....@selector(threadloop) - (void)threadloop { // expecting api or method wait until messages pushed message queue if (...) { } } any should appreciated. you can use nscondition. attach example code "ready-for-test" in viewcontroller @interface viewcontroller () @property (strong, nonatomic) nscondition *condition; @property (strong, nonatomic) nsthread *athread; // use property indicate want lock _athread @property (nonatomic) bool lock; @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup

algorithm - Creating a dynamic points averaging script -

i'm kind of person that's happy sit , use trial , error on extended period try , work out. totally stuck , thought perhaps may able point me in right direction. i trying create script allow 1-6 players assigned number of objects each of has specific points value. the script needs average out number of points each player awarded. it needs able have new set of objects added distribute based on accrued number of points gained , try , distribute them keep total equal possible. [tl;dr bit] let's there 6 players. in round 1 6 boxes "won": 2 big boxes @ "1000pts", 2 medium @ "500pts" , 2 small @ "250pts". the script have award boxes 1 each player. p1 1000 p2 1000 p3 500 p4 500 p5 250 p6 250 let's same amount of boxes won in round two. script going have calculate gets keep scores close possible. p1 250 p2 250 p3 500 p4 500 p5 1000 p6 1000 would give totals of p1 1250 ps 1250 p3 1000 p4 1000 p5 1250 p6 1250 a

php - Magento Product Images Not Resizing -

i uninstalled extension , afterwards of product images displayed on category pages resized 135x135 instead of 209x209 . checked list.phtml , found: <a href="<?php echo $_product->getproducturl() ?>" title="<?php echo $this- >striptags($this->getimagelabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(209); ?>" width="209" height="209" alt="<?php echo $this->striptags($this->getimagelabel($_product, 'small_image'), null, true) ?>" /></a> although looks right me find random css attribute appears culprit cannot find source of rule. img[attributes style] { width: 135px; height: 135px; } you can see problem here an extension overwriting template product list, file modified ( list.phtml ) isn&

ios - CBPeripheral didUpdateValueForCharacteristic, maid synchrone -

i have ble peripheral build on known (by me) serial peripheral. serial peripheral have whole home maid lib, implement serial protocol. protocol follow rule : send message receive answer. right. have re-implemented communication on bluetooth, using corebluetooth.framework , work not bad. main problem wait until didupdatevalueforcharacteristic called before considering reply. (thank stackoverflow guys, have found number of reply here have save life) but when talking device must : - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { dispatch_async(m_processingqueue, ^{ bool ok = [myperipheral excecutecommand]; }); } if : - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { bool ok = [myperipheral excecutecommand]; } the didupdatevalueforcharacteristic not called. execute command times out, , return false. didupdatevalueforcharacteristic called after all, data in it. i

browser - Peer to peer with WebRTC and Flash fallback -

webrtcs peerconnection gaining ground on chrome, firefox , chrome beta android. remaining browsers still need fallback. presumably flash work fine, since incorporates peer peer connections since 2010 roughly. is there library containing utilizing webrtcs peerconnection , fallback mechanism using flash? if not, i'm interested in developing myself. caveats when doing this? i'm interested in data transfers.

mysql - Pass variable into subquery -

i extract clients' offers each project and, in case have more 1 offer, average value. i have following query: select @projectid := projects.id projectid, (select sum(`offers`) (select avg( `price` ) `offers` `sales` `sales`.`projectid` = @projectid , `sales`.`active` = 'yes' group `sales`.`clientid` ) `average` ) `outstanding` projects projects.active = 'yes' order outstanding asc my problem @projectid not passed subquery, , don't understand how should solve issue. can please give me advices? remember sql declarative language, not imperative one. many problem solved using join , subqueries without "variables". so... ... i'm not sure understand -- need "for each project sum of average offers each client", trick: select s.projectid, sum(offers) ( select projectid, clientid, avg(price) offers sales active = 'yes' group projectid, clientid ) s join projects on s.projectid

c# - Resize PictureBox as resizing the form -

i'm loading multiple images panel (multiple pictureboxes inside panel ) , resize images windows form resized. here code: foreach (string filename in ofdmulti.filenames){ picbox[i] = new picturebox(); picbox[i].size = new system.drawing.size(256, 256); picbox[i].sizemode = pictureboxsizemode.zoom; picbox[i].dock = dockstyle.fill; i++; } but don't see multiple images, 1 , stretched fully, may wrong? you have multiple issues code. first off, line of code ensure see 1 picturebox ...likely last 1 added: picbox[i].dock = dockstyle.fill; second, don't see setting picturebox location , going point(0, 0) , meaning overlap extent regardless of dock setting. if trying nice arrangement, such tiled, use tablelayoutpanel . allow describe grid pattern rows , columns , add picturebox controls grid. there other options, of course, depending upon goal.

git - Fabric -f option not working -

i've been using fabric local machine while , have decent deploy script i'd call during post-receive hook git. in order accomplish have following code, of verified until fab command: deploy=... # code determine if should deploy if [[ $deploy ]] ; tmpfile="/tmp/$(basename $0).$$.tmp" git cat-file blob release:fabfile.py > $tmpfile fab -f $tmpfile deploy:servername.mycompany.com rm $tmpfile fi i've checked each step of way, , i'm positive tmpfile being created correctly (it contains fabfile). manually running steps above w/ made file in /tmp/ results in same behavior. the worst part "reminds" me can use -f specify fabfile...which am. this because wants file .py @ end. change temp file use file extension , work. it's artifact of fab's wanting allow people use python style directory classes fabfile/__init__.py picked -f fabfile example of behavior here: ╭─mgoose@macintosh ~ ╰─$ fab -f tmp.py test [localhost

Ruby On Rails Mail Routine Not sending -

i have ror if statement supposed record , send emails based on login can tell me wrong in syntax? this working there 2 test cases return activerecord::recordnotfound (couldn't find signon userw1 = xxx@example.com): app/models/order.rb:219:in `submit_order' class order < activerecord::base # note: ensure setup methods here include , filter on # query_account_number security measure. establish_connection "web_#{rails_env}" has_many :order_details, :dependent => :destroy, :order => 'id desc' def self.delete_item query_account_number, login, id order = order.first(:conditions => {:account_number => query_account_number, :login => login}) detail = order.order_details.first(:conditions => {:id => id}) detail.destroy if detail # here delete order, have chosen leave not have # questionable gaps in ids. end def self.verify_upc1 upc_rule, upc1 "invalid upc prefix" unless item.first(:conditio

javascript - Strange jQuery behaviour -

i know $("#sendingtype").val(2) sets value of select 2. so, why goes else?? $(function () { $("#calculate").click(function () { var result = $("#sendingtype").val(); var day1 = eval(result) + 3; var day2 = eval(result) + 10; var day3 = eval(result) + 2; if ($("#sendingtype").val(2)) { $("#result").text(day1 + " , " + day2 + " days."); } else { $("#result").text(day1 + " , " + day3 + " days."); } }); }); i aware not correct way code if statement. solved : thank jason , juhana. code not go else, thought because value of select influences if result. if different results because of new select value. fiddle looks me runs true branch regardless: http://jsfiddle.net/tmwrv/ which makes sense. setting value 2 , not checking value. statement $("#sendingtype").val(2) retu

PHP syntax help for checking multiple IDS in an array -

i using contact form 7 in wordpress , had create custom hook form action url. have working if want check if particular forms "id" exist, , if send url. code looks this: add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); function wpcf7_custom_form_action_url($url) { global $wpcf7_contact_form; if ($wpcf7_contact_form->id === 333) { return 'http://mydomain.com/leads/'; } else { return $url; } } however, have 4 forms want check see if of them exist send same url above (where domain url). if try adding multiple ids breaks. have tried: add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); function wpcf7_custom_form_action_url($url) { global $wpcf7_contact_form; if ($wpcf7_contact_form->id === 333 || 334 || 335 || 336) { return 'http://mydomain.com//leads/'; } else { return $url; } } the code a

c# - How to Share My News on Facebook on Windows Phone 8 -

i on windows phone project. project includes latest news various categories. i'm done getting news web service on device. need share these news on facebook, twitter etc.. how can ? i checked https://developers.facebook.com/ couldn't find idea or found, here http://facebooksdk.net/docs/phone/ . is there idea ? me please. need put button @ end of news , need share them on social platforms. waiting answers four-eye. thank much. use sharestatustask private void button_click(object sender, routedeventargs e) { //themessagestatus message want post fb/twitter sharenewsarticle(themessagestatus); } private void sharenewsarticle(string message) { sharestatustask sst = new sharestatustask(); sst.status = message; sst.show(); } this let user choose social network update (e.g. fb, twitter etc..)

jQuery UI Sortable animations -

i have grid-like list, , have sortable functionality working in it, planned. want animate every item except 1 being manipulated smoothly slide in list. have example set here: http://jsfiddle.net/wpmte/ . <ul id="sort"> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> </ul> the css: ul { margin: 0; padding: 0; } li { display: inline-block; margin: 5px; padding: 5px; background: #0f0; width: 25%; } .ui-sortable-placeholder { height: 0 !important; } and finally, js: $('#sort').sortable({ }); how can animate elements fill in space transitions rather jumping? here's how did it: // needed allow multiple placeholders animate var placeholdernumber = 0; $('#new-

forms - Validating radio buttons in php -

i'm new php , trying write code test whether or not user has clicked radio button in response survey question. there numerous radio buttons. if haven't clicked on 1 i'd issue error user. i've tried couple of approaches, haven't found works. here current code , error message get. php script, i've tried of 3 following examples: .... if ($_post['degree_type'] == "ms"||"ma"||"mba"||"jd"||"phd") { $degree_type = ($_post['degree_type']); } else if ($_post['degree_type'] == null) { $errors[] = 'please select degree type.'; } if (isset($_post['degree_type'])) { $errors[] = 'please select degree type.'; } else { $degree_type= $_post['degree_type']; } if (array_key_exists('degree_type', $_post)) { $degree_type = ($_post['degree_type']); } else { $errors[] = 'pleas

javascript - Referencing Js script in one localhost site, from another localhost site -

i trying set automatic jslint tests grab js files target website, , using selenium run against test site perform jslint tests using url of js file. i running problems trying test locally, 2 different localhost websites. $(function () { $.ajax({ url: "http://code.jquery.com/jquery-latest.min.js", //url: "http://localhost:62338/scripts/test.js", // url other local site datatype: "text" }).done(function (data) { var myresult = jslint(data); .. }); }); if run above code url pointing @ jquery url, works fine , jslint analyses file. breaking if try point @ js file in other localhost site. if view network inspector in chrome, says call script cancelled. any ideas why not able access locally hosted js file in way? i using mvc4 web project, way. edit : had no luck cors or pointing ip, dominic's answer led me question , able disable security on chrome. don't option @ all, test lo

vba - Excel macro causes corruption to workbooks it pastes to -

i'm working on macro copy input values user (in table on sheet, not prompt) , pastes them specific target workbooks. code seems work once , in working happens target workbooks , error saying files format or extension not valid. these design tables solidworks , open fine when solidworks references them though. can me figure out why happening? here code. sub copysalesinfo() 'turn off screen updating 'application.screenupdating = false 'copy input sales driver sheets 'define dims dim wkbksales workbook dim wkbkmasterdriver workbook dim wkbkdoorformingdriver workbook dim wkbkdoorasmdriver workbook dim wkbkboxasmdriver workbook dim salessheet worksheet dim masterdriversheet worksheet dim doorformingdriversheet worksheet dim doorasmdriversheet worksheet dim boxasmdriversheet worksheet 'set workbook , worksheet locations (hard code) set wkbksales = thisworkbook set wkbkmasterdriver = workbooks.open("s:\aluminum\box configurator\test 20x box config plain\20

ios - What is a good way for an app user-agent string looking like iPhone/Chrome/Whatever to most of the websites? -

we making ios , android app has webview part of functionality. , when views our own website, tuning pages in-app view (e.g. cut out header app has own chrome anyway). rest of web show and.. here problem comes. we identify ourselves in user-agent string "ourapp/0.9.24 (iphone; ios 6.1.2; scale/2.00)")" similar iphone, not iphone , websites including www.google.com show desktop pages instead of mobile optimized ones. has had similar issues? suggestions on how make user string identify our app yet iphone of web sites including www.google.com? p.s. typical iphone browser string looks following: "mozilla/5.0 (iphone; cpu iphone os 5_0_1 mac os x) applewebkit/534.46 (khtml, gecko) mobile/9a405" i think result you're seeing expected. sites sniff user-agent in order determine how display content. essentially, you're creating "unknown" agent far rest of world concerned, default typically show desktop version. perhaps can use defa

asp.net mvc 4 - PayPal with MVC -

i have following sample call paypal's rest api make payment. works fine i'd use new mvc app. guess needs adapted make use of mvc helper methods eg redirecttoaction rather server.transfer etc. has converted sample run in mvc4 controller action? // ###payer // resource representing payer funds payment // payment method // `paypal` payer payr = new payer(); payr.payment_method = "paypal"; random rndm = new random(); var guid = convert.tostring(rndm.next(100000)); string baseuri = request.url.scheme + "://" + request.url.authority + "/paymentwithpaypal.aspx?"; // # redirect urls redirecturls redirurls = new redirecturls(); redirurls.cancel_url = baseuri + "guid=" + guid; redirurls.return_url = baseuri + "guid=" + guid; // ###details // let's specify det

c - Difference between binary zeros and ASCII character zero -

gcc (gcc) 4.8.1 c89 hello, i reading book pointers. , using code sample: memset(buffer, 0, sizeof buffer); will fill buffer binary 0 , not character zero. i wondering difference between binary , character zero. thought same thing. i know textual data human readable characters , binary data non-printable characters. correct me if wrong. what example of binary data? for added example, if dealing strings (textual data) should use fprintf . , if using binary data should use fwrite . if want write data file. many suggestions, the quick answer character '0' represented in binary data ascii number 48. means, when want character '0' , file has these bits in it: 00110000 . similarly, printable character '1' has decimal value of 49, , represented byte 00110001 . ( 'a' 65, , represented 01000001 , while 'a' 97, , represented 01100001 .) if want null terminator @ end of string, '\0' , has 0 decimal value, , byt

Extjs / Javascript: How to put images vertically - aligned with other fields (textboxes,combos) in a multiple line panel with hbox layout? -

Image
how can arrange images in panel 'hbox' layout , in same time, keep them aligned other fields in form ? common form fields in extjs have margin-bottom of 5px , height of 22px , way can think right put image considering field defaults. problem comes when have multiple lines in panel, in internet explorer especially. basically, want form this: what tried far (first created image directly, not item in container --> same result): createimageitem: function(config) { return ext.create('ext.container.container', { width: 16, height: 22, items: [{ xtype: 'image', padding: 3, src: 'resources/images/arrowleft.png'}], margin: '0 5 5 5' }); } in chrome looks fine, in ie images go 1px every row. don't know why. is there other way this? perfect nicer way , don't bother pixels , calculations. thank you! i using extjs version 4.0.7 you use ext.isie property set dimensions based on brows

Can't find Android App in Google play Store -

i have own app called geoperks-rewards you, problem not able find app google play store handsets , in tablet pc>can tell me might reason behind this.i cannot models , os versions, appearing random models. the app compatibility depends on many factors, i.e. screen sizes, os version, device hardware support, features added in app, etc... information provided on android developer website google. can go through topic filters on google play , maybe revise manifest.xml file of app. might idea why not compatible several devices.

jpa - Hibernate : programmatically adding an index -

how can add index database column definition of property. pseudo code like, //iterate through mappings of persistent classes. if(entityclass instanceof myclass) { // version property of class // make sure index added in schema column } is possible ? using jpa hibernate persistent provider

c - Peculiar Errors with free -

i debugging project i've been working on while, , have encountered crazy errors involving free . can't upload code, because there no way tell problem lies (about 2500 lines of code split 22 files), explain know. to start with, gdb being used whole debugging process. error seems rise call free . following error message gdb , after program exits sigabrt : *** error in `application': free(): invalid next size (normal): 0x08052008 *** ======= backtrace: ========= /lib/i386-linux-gnu/libc.so.6(+0x767e2)[0xb7e467e2] /lib/i386-linux-gnu/libc.so.6(+0x77530)[0xb7e47530] application[0x8049aef] application[0x804a8aa] application[0x8048bee] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0xb7de9935] application[0x8048a51] ======= memory map: ======== 08048000-08050000 r-xp 00000000 00:16 1571817 application 08050000-08051000 r--p 00007000 00:16 1571817 application 08051000-08052000 rw-p 00008000 00:16 1571817 application 08052000-08073000 rw-p 00000000 00:00 0

angularjs - how to mock ngModel? -

so testing controller, referencing property specified ngmodel in dom. while testing controller, don't have template. whenever $scope.foo.property being accessed in controller, throws error. in test, can define property before instantiate controller : it('should mock ng-model', inject(function($rootscope, $controller) { $rootscope.foo = { property: 'mock value' }; $controller('mycontroller', {$scope: $rootscope}); })));

filter - SQL Query to Add Values from Column X for Every Entry That Has Y -

i need write query going calculate sum of 1 column depending on values of another. need sum of drug administered each patient in 1 of db's tables. table has account number column (x), drug id column (y) , amount administered column (z). thing there can multiple rows each account number need pull total amount of drug administered each patient account number. in essence need query return sum of z for every x clause @ end using column y. hope explaining because thinking confuses me! appreciated. guys! this simple group query, i'm not sure what's confusing you. select x, sum(z) total_z table y = 123 group x

windows - Copying a folder in the command prompt -

i trying copy folder 1 directory in cmd in windows 7. i have found commands copying individual files: copy test.txt "c:\newlocation" which works fine. trying this: copy "c:\test" "c:\newlocation" doesn't work. wants take contents of directory , move them over. there anyway copy folder , move opposed entire directory contents? thanks. use xcopy instead of copy: xcopy "c:\test" "c:\newlocation" /s /e source

testing - Monitor Java application with VisualVM -

i have few java programs running on ec2 instance. want profile them using visualvm. not web applications run on jetty or tomcat. did go through stuff mentioned here , dont know how set visualvm after generate jar files commands. can me out? thanks you attach visualvm pid of process want profile. if that's jetty or tomcat or other java ee app server, means pid of app server. if not, it's pid of jvm that's running app. if you've got jvm installed on ec2 instance, i'd recommend looking in jvm /bin folder see if jvisualvm.exe there. if is, fire in separate command shell , attach pid of application.