Posts

php - array count base on how many it appear -

i newbie in php. i have mysqli_fetch_array looks inside while loop" array(7) { ["id"]=> string(32) "00000000000000000000000000000001" ["name"]=> string(5) "admin" ["product"]=> string(32) "ps4" } array(7) { ["id"]=> string(32) "00000000000000000000000000000001" ["name"]=> string(5) "mike" ["product"]=> string(32) "iphone" } array(7) { ["id"]=> string(32) "00000000000000000000000000000001" ["name"]=> string(5) "mike" ["product"]=> string(32) "imac" } array(7) { ["id"]=> string(32) "00000000000000000000000000000001" ["name"]=> string(5) "mike" ["product"]=> string(32) "lcd monitor" } i want count how many times admin , mike appear in loop: far know how...

eclipse - Java Swing program slows down over time in Ubuntu -

so made solitaire game java swing. tested on windows , mac osx , worked fine. then, installed ubuntu on macbook pro, , when run ubuntu, works gradually slows down, slowing down computer itself. using java 8 openjdk, running eclipse (although running terminal results in same problem). here code: solitaire.java package solitaire; import java.awt.event.keyevent; import java.awt.event.keylistener; import java.awt.event.mouseevent; import java.awt.image.bufferedimage; import java.io.file; import java.util.arraylist; import java.util.hashmap; import java.util.list; import java.util.map; import javax.imageio.imageio; import javax.swing.jframe; import javax.swing.event.mouseinputlistener; import cards.card; import cards.deck; public class solitaire extends jframe implements keylistener, mouseinputlistener { private static final long serialversionuid = -6358510224557653758l; public static solitaire app; public static map<card.suit,map<integer,bufferedimage>...

python - How to inject an object into sqlalchemy session? -

i want use tracking system of sqlalchemy orm. want inject ready model object (which inherited base , can used in sqlalchemy) ready session obejct without connecting database. tried doing session.merge(obj, load=false) no success! complains object state. can't imagine how can seduce it. want inject object , make changes , use session.dirty track changes. when using merge load=true (default) works. refuse connect database via session reason. class alaki(base): __tablename__ = 'alaki' alaki_id = column(integer, primary_key=true) name = column(localizedstring) age = column(integer) children = relationship('alakichildren') model = alaki(alaki_id=5, name='test',age=32) self.db_session.merge(model) # works connects database self.db_session.merge(model, load=false) #fails! item in self.db_session.dirty: print('dirty:' ,item)

unity3d - Unity objects and animation -

i using cinema 4d create objects , animations. there anyway import them unity 3d object formats , animation? 3dsmax? unity3d official docs provide detail guide importing objects cinema 4d

javascript - Filling the data gaps with a gray area using Highcharts, -

Image
i've highcharts line chart. sometimes, there's gap between data , wonder whether it's possible fill these gaps gray area it's better visible there no data. thanks edit: example of want have: you can use xaxis.plotbands fill gaps. note need calculate have null -points in first place, before rendering chart. here simple example you: http://jsfiddle.net/hbzolxnw/

MySQL Lookup Table + Multiple Constraints in one Lookup Table -

i have table called users has around 50 columns , need add constraints around 30 of 50 columns. typically in past create 30 constraint tables , apply each users table foreign key constraint. i wanted see if use 1 table 30 constraints? this 1 table incrementing primary key , 30 columns - 1 each constraint. constraints around 5 entries , around 100 entries there null data in of constraint lists. is realistic way multiple constraints or need use 1 table per constraint? thanks if constraint mean lookup tables, no, not combine them single table. if 1 of fields has 2 possible values , 1 has 3, first 1 still have 3 choices available in lookup table, if 3rd choice linked null. if worried number of lookup tables, consider using mysql's enum data type instead.

php - Getting a syntax error on a comment? Or am I missing something obvious? -

i writing report form weird syntax error. here code: <h2>report <u><?php echo $title; ?></u> machine program error</h2> <p><span class="error">* required field.</span></p> <form action="send_form_email.php?email=yes"> job number: <input type="text" name="jobid" value="<?php print ($jobid) ?>"> <!--<span class="error">* <?phpecho $nameerr;?></span>--> <br><br> part number: <input type="text" name="partid" value="<?php print ($part_id) ?>"> <!--<span class="error">* <?phpecho $emailerr;?></span>--> <br><br> machine: <input type="text" name="mach" value="<?php print ($machcode) ?>"> <!--<span class="error">* <?phpecho $macherr;?></span...