Posts

Showing posts from March, 2010

odoo - Onchange method not saving -

so have onchange method looks it's working. when enter new value in onchange field triggers method writes value in field. example code: @api.onchange('xx_next_air_shipment') def _onchange_air_shipment(self): self.xx_next_air_value = self.xx_next_air_shipment * self.xx_price_unit on screen looks correct, when press save value seem lost? i tried editing write method, debugged , saw correct values in parameter returned write method correct values still didn't save database: @api.one def write(self, vals): openerp.pydev import pydevd return self.write(vals) update method code, @api.multi def write(self, vals): openerp.pydev import pydevd return super(class_name,self).write(vals) @daniel reis right method's result turns infinite loop.

ios - Attempting to mask a circle around an image not working -

i have image attempting mask circle around image appears round. works circle comes point on top , bottom. profileimageview.layer.cornerradius = profileimageview.frame.size.width/2; profileimageview.layer.maskstobounds = yes; should code drawing perfect circle? seems draw circle in 1 place in 2 other places, not working correctly. i have had best results masking image view cashapelayer : cgfloat radius = self.profileimageview.frame.size.width / 2.0; uibezierpath *path = [uibezierpath bezierpathwitharccenter:cgpointmake(radius, radius) radius:radius startangle:0 endangle:m_pi * 2.0 clockwise:true]; cashapelayer *layer = [cashapelayer layer]; layer.path = path.cgpath; layer.linewidth = 0; self.profileimageview.layer.mask = layer;

html - CSS Animation not working in Chrome -

i using familiar script make text blinking css. text blinking in every browser except google chrome. including in inspector view of chrome can see styles there , not inherited. link inside ul/li element if put link outside of if blink effect working inside it not working. here part of code: #container ul li:last-child { float: right; animation-duration: 900ms; animation-name: blink; animation-iteration-count: infinite; animation-direction: alternate; -webkit-animation: blink 900ms infinite; /* safari , chrome */ } #container ul li { font: bold 14px/32px"lato", "trebuchet ms", arial, helvetica, sans-serif; font-weight: 600; display: block; height: 32px; color: #becbb2; text-decoration: none; letter-spacing: 0.5px; box-sizing: border-box; transition: .2s ease-in; -o-transition: .2s ease-in; -moz-transition: .2s ease-in; -webkit-transition: .2s ease-in; } @keyframes blink { { color: #ff0000;...

sql - How can I improve this query? Trying to figure out where to do indexing -

i've been given task improve below query because it's kinda slow. select 9 fieldcount, a.accountname field1, u.fullname field2, a.city field3, a.state field4, a.zip5 field5, count(distinct c.contact_id) field6, count(distinct l.lead_id) field7, a.account_id field8, a.createdatetime field9, row_number() on (order a.createdatetime desc) rownum dynamic_account left join dynamic_contact c on a.account_id = c.account_id left join dynamic_lead l on a.account_id = l.account_id, static_list ls, static_list lc, static_user u (a.account_id > 0) , (a.source_id = ls.list_id) , (a.category_id = lc.list_id) , (a.accountsr01_id = u.user_id) group accountname, lc.title, u.fullname, a.city, a.state, a.zip5, a.account_id, a.createdatetime can please give me pointer of how joint can improved or put index? thanks edit: below create scripts of tables generated sql management studio. dynamic_account: create table [dbo].[dynamic_account]( [account_id] [int] identity(1,1) not null, [r...

java - How marker interface are identified by JVM? -

this question has answer here: how marker interface handled jvm 6 answers i have gone through few question in stack overflow not find suitable answer. raising more clarity. i know marker interface interface no methods. when implement marker interface example serializable declares class implementing becomes eligible serialization. my question how jvm understands objects of class implementing serializable interface should serialized. if write interface no methods , hope objects of class implements serialized i'll not work way. is possible create custom marker class.? they aren't 'identified jvm' @ all. they're identified java code interested in them, example objectoutputstream , via instanceof operator.

logging - Docker container logs taking all my disk space -

i running container on vm. container writing logs default /var/lib/docker/containers/container_id/container_id-json.log file until disk full. currently, have delete manually file avoid disk full. read in docker 1.8 there parameter rotate logs . recommend current workaround? docker 1.8 has been released log rotation option. adding: --log-opt max-size=50m when container launched trick. can learn more at: https://docs.docker.com/engine/admin/logging/overview/

linux - Bash while loop `done' syntax error unexpected token -

learning bash scripting in linux on virtualbox. i'm writing script uses while loop ask text file write if decide not overwrite existing file, among other things. here's code: #!/bin/bash bool="true" counter="true" while [ "${bool}" == "true" ] ; bool="false" if [ "${counter}" == "true" ] ; if [ $# -eq 1 ] ; ff=$1 fi else read -p "enter .txt file write to: " ff fi txt=".txt" if [[ $ff != *$txt* ]] ; echo $ff ff="$ff$txt" echo $ff fi if [ -w $ff ] ; var="true" while [ "${var}" == "true" ] ; var="false" read -p "${ff} exists. want overwrite it? y/n: " yorn if [ $yorn == "y" ] ; echo "'$ff' being overwitten" elif [ $yorn == "n" ] ; echo "let's try again......

php - how to protect uploads folder with .htaccess to only allow images in wordpress site -

i have question need protect site uploading and/or executing scripts or files other images in wordpress site. but have tried few variations .htaccess file , no success. the wordpress have wp-content/uploads folder uploads stored. , inside it's sorted based on year / month combination in folders. used example wordpress site somehow locks entire folder , can't see images. <files ^(*.jpeg|*.jpg|*.png|*.gif)> order deny,allow deny </files> so there working way on making available upload , sort images inside wp-content/upload folders , later on access them. think problem there subfolders sinside uploads or wrong ? so htaccess solution won't affect can upload recursively effect access subdirectories. rewriteengine on #if file not have 1 of theses extensions rewritecond %{request_uri} !\.(png|jpg|jpeg|gif)$ #then should marked forbidden. rewriterule .*$ - [f] that should it.

method writeDescriptor in android ble always return false in lollipop -

when test code on 5.0.1 android version method writedescriptor return false . tested on 4.3 , 4.2.2 devices , it's returning true method: public void setcharacteristicnotification(bluetoothgattcharacteristic characteristic, boolean enabled) { if (mbluetoothadapter == null || mbluetoothgatt == null) { log.w(tag, "bluetoothadapter not initialized"); return; } mbluetoothgatt.setcharacteristicnotification(characteristic, enabled); // specific heart rate measurement. if (uuid_heart_rate_measurement.equals(characteristic.getuuid())) { bluetoothgattdescriptor descriptor = characteristic.getdescriptor( uuid.fromstring(samplegattattributes.client_characteristic_config)); descriptor.setvalue(new byte[]{0x02}); boolean status = mbluetoothgatt.writedescriptor(descriptor); if(status) ...

assembly - 6502 assembler random number problems -

i playing around 6502 assembler here: http://skilldrick.github.io/easy6502 i have made puts random color pixel in random place on screen: ldy #$00 ; clear y loop: jsr genpos ; put new position in memory lda $fe ; random number color sta ($10), y ; put pixel on screen jmp loop genpos: sta $10 ; store accumulator in low lda $fe ; new random number (why, oh why?) , #$03 ; mask out low 2 bits (=numbers 0-3) clc ; clear carry flag adc #2 ; add 2 (= numbers 2-5) sta $11 ; store number in high rts i trying use few instructions possible. problem if don't put lda $fe in genpos sub routine pixels drawn in strange pattern if have lda code works perfectly. can't comprehend why - can give me hint? regards, jacob it making fine low byte! line: lda $fe ; new random number (why, oh why?) goes on decide high byte, , if don't generate new random number, y value dependent on lowest 2 bits of x value, causing diagonal...

ios - How to add UIButton Programmatically from a NSObject Class -

i trying create uibutton in nsobject class. error " use of unresolved identifier view. figured needs have uiviewcontroller work. is there work around create multiple buttons on multiple view controllers. missing? func createbutton () { let button = uibutton(); button.settitle("add", forstate: .normal) button.settitlecolor(uicolor.bluecolor(), forstate: .normal) button.frame = cgrectmake(15, -50, 200, 100) view.addsubview(button) } declare method definition parameter-argument in want add button : func createbutton (view:uiview) { let button = uibutton(); button.settitle("add", forstate: .normal) button.settitlecolor(uicolor.bluecolor(), forstate: .normal) button.frame = cgrectmake(15, -50, 200, 100) view.addsubview(button) }

ant - crosswalk project build for android failed -

i'm trying build android app using crosswalk. followed official guide to set up. , succeed in building example project . after when try build own html5 project, builds failed. error outputs: starting application build (arm) * checking keystore signing no keystore provided signing. using xwalk's keystore debugging. please use valid keystore when distributing app market. * updating project xwalk_core_library * checking external extensions * copying native libraries arm * building android apk package crosswalk embedded (arm) [javac] warning: [options] source value 1.5 obsolete , removed in future release [javac] warning: [options] target value 1.5 obsolete , removed in future release [javac] warning: [options] suppress warnings obsolete options, use -xlint:-options. [javac] 3 warnings [javac] warning: [options] source value 1.5 obsolete , removed in future release [javac] warning: [options] target value 1.5 obsolete , removed in future re...

pointers - How is a destructor call `fn drop(&mut self)` call inserted when the owning variable is immutable? -

it understanding when variable type implements drop goes out of scope, call fn drop(&mut self) function inserted, , passed newly-created mutable reference variable going out of scope. however, how possible in cases variable immutably bound, , illegal borrow mutably? here's example of i'm talking about: fn main() { let x = vec![1, 2, 3]; let y = &mut x; } which produces following error: cannot borrow immutable local variable x mutable expected. something similar must happen when x getting dropped, because drop expects mutable reference. the owner of variable gets decide mutability when variable binding created, it's not intrinsic value itself: fn main() { let x = vec![1, 2, 3]; let mut z = x; let y = &mut z; } you can think of dropping happening when last programmer-named variable binding gives ownership of variable. magical drop-fairy takes ownership of now-unneeded variable, , uses mutable binding. drop-fairy ...

java - JavaFX: JFXPanel in JFrame - Prevent JMenuBar mnemonics -

i have jfxpanel's contained within jframe has jmenubar top. menus have mnemonics associated them, though jfxpanel's have button's mnemonics associates them well. pressing alt + c invokes jfxpanel close button action, opens collections menu jmenubar. suggestions how handle? adding jfxpanel did trick: this.addkeylistener(new keylistener() { @override public void keytyped(keyevent e) { if(e.isaltdown()) { e.consume(); } } @override public void keyreleased(keyevent e) { if(e.isaltdown()) { e.consume(); } } @override public void keypressed(keyevent e) { if(e.isaltdown()) { e.consume(); } } });

xml parsing - How to Deserialize XML Array items? -

i having trouble deserializing xml. accountinformation work wont work leauge elements. xml doesnt contain tag "leauges" , dont want add tag work. there other way "fix" it? have tried diffrent solutions deserialized result of leauges comes empty. missing? any appreciated! se code below: update: i have modified code , xml wont work anyway. waht missing here? [serializable] [xmlroot(elementname = "leaugecollection", namespace = "")] public class leaguecollection { [xmlarray("leagues")] [xmlarrayitem("league",typeof(league))] public league[] league { get; set; } [xmlelement(elementname = "accountinformation")] public string accountinformation { get; set; } } [serializable()] public class league { [xmlelement(elementname = "id")] public int id { get; set; } [xmlelement(elementname = "name")] public string name { get; set; } [xmlelement(element...

php create class with no variables to pass in function -

lets have class function in it: classes.php class foobar{ function writeword($word){ return $word; } } on page call class need initialize class, call later. php2.php require_once('classes.php'); $something = new foobar(); echo $something->writeword('dog'); the problem here php comes , says foobar missing arguments on line 1. how can solve this?

desktop - Java IO Permission Denied. but canWrite is true -

i'm working on small utility supposed insert files program directory. , when comes writing file failes java.io.filenotfoundexception (permission denied) this code (kind of messy, debugging alot) while(ze!=null){ string filename = ze.getname(); file newfile = new file(outputfolder + file.separator + filename); system.out.println("file unzip : "+ newfile.getabsolutefile()); //create non exists folders //else hit filenotfoundexception compressed folder new file(newfile.getparent()).mkdirs(); new file(newfile.getparent()).setwritable(true,false); if(newfile.isdirectory()){ newfile.mkdir(); newfile.getparentfile().setreadonly(); newfile.setreadable(true); newfile.setexecutable(true); if(newfile.setwritable(true)){ system.out.println("permission set success"); }else{ system.out.println("permission set failed...

jquery - J QUERUY issue not working the hyperlink -

my link forwarding jsp not working something wrong in not workng need on : $("<td>").addclass("labelsearchdata") .append("<a>") .attr("href", "/mng/admin/detailcustomlabelsummary") .text(checkvalue(node, "label")) .appendto(trow); orginal code : $("<td>").addclass("labelsearchdata") .text(checkvalue(node, "label")) .appendto(trow); .append() returns object appended to, not object you're appending. code calling .attr , .text on <td> , not <a> you're adding. , when call .text() , replaces <a> appended. try: $("<td>").addclass("labelsearchdata") .append($("<a>", { href: "/mng/admin/detailcustomlabelsummary", text: checkvalue(node, "label") })) .appendto(trow);

preventdefault - jQuery prevent default not working on form submit -

i trying test getting image size form, , instead of submitting form, want preventdefault, , show alert instead. here script: <script type="text/javascript"> function update1() { event.preventdefault(); var fileupload = document.getelementbyid("uploadfile"); if (typeof (fileupload.files) != "undefined") { var size = parsefloat(fileupload.files[0].size / 1024).tofixed(2); alert(size + " kb."); } else { alert("this browser not support html5."); } } </script> and here html: <form action="" method="post" enctype="multipart/form-data"> <div class="owner-panel owner-panel-space-4"> <div class="owner-panel-body"> <div class="row"> <div class="col-md-4"> <h4>image</h4> </div> <div cl...

javascript - Negation of regular expression -

i have regular expression: var regex = /^[-.:_a-za-z0-9]*/; but need test string see if has characters not match expression. i have tried var regex =/^[^-.:_a-za-z0-9]*$/; but did not catch characters looking for. basically, need regular expression can use in javascript find character not - . : . a-z a-z or 0-9 in javascript string variable. thisshouldpass thisshou[][]ldfail i suspect want remove anchors , * : var regex =/[^-.:_a-za-z0-9]/;

c# - Updated to VS 2015, Azure 2.7, publish fails 'Access to path ... denied' -

i have cloud service project 3 worker roles. (vs 2013, azure 2.5) published fine. when vs 2015 available, installed on clean vm , installed azure 2.7. promoted old solution , can build , run locally fine. can build cloud service project. when try publish or package, following error , build fails. error: access path 'c:\users[username]\appdata\local\temp\3xhd2e4m.wlw\roles[rolename]\base\x86\msshrtmi.dll' denied. c:\program files\msbuild\microsoft\visualstudio\v14.0\windows azure tools\2.7\microsoft.windowsazure.targets 3003 when go temp - there no directory corresponding 3xhd2e4m.wlw. my resolution attempts far include: removing worker roles solution , trying publish - fails same error remaining project. removed read-only temp tried set build x64 need since blocking deployment , testing. i have same problem. according answer in post ( deploying azure: "access path ... msshrtmi.dll denied" ), problem related issue azure sdk 2.7 , solv...

visual studio 2015 - Interpolate string c# 6.0 and Stylecop -

Image
i using stylecop version : 4.7.49.0 has used latest interpolate string functionality in c# 6.0 example var totalunits = getunitsgettotalissuedshares(myid); var teststring = $"test units :{totalunits}, have been shipped."; when build stylecop error sa0102 - because stylecop cant parse file. doesn't seem there new version of stylecop can handle 6.0 yet? error :sa0102: syntax error has been discovered in file is there anyway around error? sa0102 internal stylecop error can't supressed or ignored via settings file. you can suppress file stylecop finding filename , changing section in csproj: <compile include="<filename>.cs"> <excludefromstylecop>true</excludefromstylecop> </compile> you can same effect right clicking on offending file , selecting "exclude style cop" if have stylecop plugin installed. needs 4.7.50 alpha visual studio 2015. the more modern way of doing make use of an...

jquery - how to get the class name outside the element in javascript -

< script type = "text/javascript" > $(function() { debugger; $(".price").click(function() { var result = $(this).find('.figure').text(); var result_t = $('.title').text(); $('#text').html('<form action="" method="">' + 'car model name : ' + result_t + '<br>' + '<br>' + 'price : ' + result + '<br>' + '<br>' + ' : first name' + '<input type="text" value="" />' + '<br>' + '<br>' + ' : last name' + '<input type="text" value="" />' + '<br>' + '<br>' + ' : mobile number' + '<input type="text" value="" />' + '<br>' + '<br>' + '...

mongodb - Meteor game laggy when 7+ users on -

i'm making multiplayer jeopardy! clone in meteor , having problems lag when 7 or players playing. example, if user clicks button on game board, should show money value of button instantly, since clicking calls method changes game state. if there's lot of users on takes 4-5 seconds money value show up. i'm guessing might have methods. game designed rooms collection stores information current game, state, current clue users see, etc. users' templates rendered based on 1 room object they're in. in client helpers, there's bunch of statements like if(rooms.findone({_id: meteor.user().currentroom}).gamestate == 1) { .... } is using queries in helpers bad , possibly causing lag? my methods have lots of calls rooms.update , timeout functions change game state. example: rooms.update({_id: meteor.user().currentroom}, { $set: {currentstate: 2, ..... }}); meteor.settimeout(function() { rooms.update({_id: meteor.user().currentroom}, { $set: {c...

sql - two foreign keys to the same numeric data type and reference it to two tables -

it´s possible create 2 foreign keys same type of numerical data in table , reference 2 tables , have exemples in down create table admin , primary key /* table admin*/ create table admin (id_admin number(10) not null, email_admin varchar(30) not null, password_admin varchar(10) not null); /* primary key */ alter table admin add constraint admin_pk primary key (id_admin); create table user , primary key /* table user*/ create table user (id_user number(10) not null, email_user varchar(30) not null, password_user varchar(10) not null); /* primary key */ alter table user add constraint user_pk primary key (id_user); create table login , primary key , foreign key /* table login*/ create table login(id_login number(10) not null, id_admin_user_login number(10) not null, email_login varchar(20) not null, password_login varchar(10) not nu...

matplotlib - x-axis rotation on a 6-subplots -

i bit stuck matplotilb subplot tools. here's i'm trying do: want 6 subplots displaying time-series of data. data (t1,t2,h1,h2...,time), lists. my code follows: fields={0:'air temperature (k)',1:'specific humidity',2:'sea surface temperature (k)',3:'surface air pressure (hpa)',4:'wind (m.s-1)'} fieldsfoam={0:t1,1:h1,2:sst1,3:p1,4:w1,5:astd1} fieldsostia={0:t2,1:h2,2:sst2,3:p2,4:w2,5:astd2} plt.close() f, ((ax1, ax2), (ax3, ax4),(ax5, ax6)) = plt.subplots(3, 2, sharex='col') ax={1:ax1,2:ax2,3:ax3,4:ax4,5:ax5,6:ax6} plt.ticklabel_format(useoffset=false) plt.ticklabel_format(style='sci', axis='y', scilimits=(-3,3)) in range (1,7): ax[i].plot(unit.num2date(time,'hours since 1970-01-01 00:00:00', unit.calendar_standard),fieldsfoam[i-1]) ax[i].plot(unit.num2date(time,'hours since 1970-01-01 00:00:00', unit.calendar_standard),fieldsostia[i-1],color='r') plt.setp(ax...

ios - How can I normalized decibel value and make it between 0 and 1 -

i trying power of audio looping on audio samples , getting average power per channel. i want value between 0 , 1 reflect intensity of audio being played. right getting db (decibel value) float value -160 (near silent) 0 (very loud). here code written in swift: func configureaudio() { audiocontroller.play() avaudiosession.sharedinstance().setcategory(avaudiosessioncategoryplayback, error: nil) audiocontroller.numberofloops = 0 audiocontroller.meteringenabled = true var audtimer = cadisplaylink(target: self, selector: "monitoraudio") audtimer.addtorunloop(nsrunloop.currentrunloop(), formode: nsrunloopcommonmodes) } func monitoraudio() { audiocontroller.updatemeters() var db = float(0) in 0..<audiocontroller.numberofchannels { db += audiocontroller.averagepowerforchannel(i) } db /= float(audiocontroller.numberofchannels) //code copied website not normalization var power = (int(log10(db+161)/log10(1.5) * 10...

vba - If Statement in loop - Else, Else If -

i'm wondering if below simple code: for each cell in range(cells(2, 5), cells(lastrow1, 5)) if(cell.offset(, -3)=cell.offset(1,-3)) cell.value = cell.offset(,-1),else if(cell.offset(, -3)=cell.offset(-1,-3),cell.value = 0,else cell.valye = cell.offset(,-1)) next i'm trying replicate if statement giving me 3 different outcomes depending on wether if statement true or not. try this; if (cell.offset(, -3) = cell.offset(1, -3)) cell.value = cell.offset(, -1) elseif (cell.offset(, -3) = cell.offset(-1, -3)) cell.value = 0 else cell.valye = cell.offset(, -1) end if

scala - How to use sbt-assembly? -

i'm quite new scala , sbt , create fat jar files includes dependency libraries. looks original sbt not , have user sbt-assembly. can't quite figure out how should install , use it. can elaborate on me? drop project/plugins.sbt addsbtplugin("com.eed3si9n" % "sbt-assembly" % "0.13.0") that should let run sbt assembly now. can solve merge conflicts in build.sbt or build.scala.

javascript - Change color of an element based on it's content -

i use wordpress create web page , used plugin called weekly class schedule. creates timetable, technically it's made table. limitation of plugin can have 1 color of table cell when there , entry. now, using javascript, how can change color of background, when know example content of td element constant text? an example of 1 td element's class name wcs3-cell wcs3-hour-row-10-00 wcs3-day-col-1 wcs3-abs-col-0 dynamically created can't rely on exact names. i assume wcs3-cell basic class name below code doesn't work: function f_color() { if (document.getelementbyclassname('wcs3-cell').value = 'boks') { document.getelementbyclassname('wcs3-cell').style.background-color = "yellow"; } } f_color(); could please advise how fix this? also, should use yellow !important new css value make sure new code used? you have several issues in code: you should use == when comparing values. getelementbyclassnam...

grails - Is that possible to read data from Database into Config.groovy? -

i need to read data database read config.groovy. is possible data database config.groovy? no not possible. in sequence of events when grails application starting config.groovy processed before datasource made available application. without knowing trying accomplish can't make suggestion on how else approach issue. updated (based on comment) in comment explain trying use feature switch plugin (which designed run time , not persistent). looking @ source code plugin should able make own service load settings database , toggles/updates feature switch settings. here simple sketch/example: package example import org.springframework.beans.factory.initializingbean class myexampleservice implements initializingbean { def grailsapplication void afterpropertiesset() { // here whatever needed load settings grailsapplication.config.features['somefeature'].enabled = true grailsapplication.config.features['otherfeature'].enabled = false ...

Python adds undesired tabs to string -

i'm using script captures html elements html files , sends them mysql db. use title = line.replace("<!--h1-->",'').replace("<h1>",'').replace("</h1>",'') for capturing h1 . now, if run print title everything fine. however, if run print 'post_title = %(title)s'%locals() then python consistently seems add 2 tabs start of title . does know what's causing , how can prevent this? call strip() on title string: title = line.replace("<!--h1-->",'').replace("<h1>",'').replace("</h1>",'').strip() print 'post_title = %(title)s' % locals() it's not necessary use locals() in way; have required variable, so: print 'post_title = %s' % title or print 'post_title = {}'.format(title) would preferable.

ios - Is there a better way to use handler in UIAlertController (Swift)? -

i'm trying use alertcontroller allow user return main menu, if calculated value exceeded. know using simple segue lead memory problems. there way use poptorootviewcontroller method in situation instead of using segue? compiler yells @ me (no doubt reasons), gives me no useful suggestions. know problem stems handler abort fit action. can point me in right direction? override func viewdidload() { super.viewdidload() if deltak > 2.25 { var helpalert = uialertcontroller(title: "stop!", message: "due high toricity, fit should aborted.", preferredstyle: .alert) helpalert.addaction(uialertaction(title: "abort fit", style: uialertactionstyle.default, handler: { action in self.navigationcontroller.poptorootviewcontrolleranimated(true)) }) helpalert.addaction(uialertaction(title: "continue", style: uialertactionstyle.default, handler: nil)) self.presentviewcontroller(helpalert, animated: true, completion: ...

optimization - Solving the multiple-choice multidimensional knapsack -

Image
i trying solve (relatively easy) instances of multiple-choice multidimensional knapsack problem (where there groups of items 1 item per group can obtained , weights of items multi-dimensional knapsack capacity). have 2 questions regarding formulation , solution: if 2 groups have different number of items, possible fill in groups smaller number of items items having 0 profit , weight=capacity express problem in matrix form? affect solution? specifically, assume have optimization programs, first group (item-set) might have 3 candidate items , second group has 2 items (different three), i.e. these have following form: maximize (over x_ij) {v_11 x_11 + v_12 x_12 + v_13 x_13 + v_21 x_21 + v_22 x_22} subject {w^i_11 x_11 + w^i_12 x_12 + w^i_13 x_13 + w^i_21 x_21 + w^i_22 x_22 <= w^i, i=1,2 x_11 + x_12 + x_13 = 1, x_21 + x_22 = 1, x_ij \in {0,1} , j. is ok in scenario add artificial item x_23 value v_23 = 0 , w^1_23 = w^1, w^2_23 = w^2 have full p...