Posts

Showing posts from July, 2014

html - Positioning divs with css using absolute positioning -

Image
i know noob question, can't figure out! i'm laying out page our intranet , need position divs side side. each container different item, containers have same structure, header, descriptive text, , image. adding items given me. page i'm creating employees sell items. here css , image of i'm trying achieve. please let me know if doesn't make sense, smart guys have proven in past, i'm sure idea. .wrapper { width: 1260px; height: 900px; margin: 0px auto; position: relative; } .container { width: 400px; height: 400px; margin: 10px; position: absolute; } .itemtext { width: 350px; height: 190px; padding: 0px; position: absolute; top: 25px; left: 25px; } .itemhead { padding: 0px; margin: 0px; } .itemdesc { padding: 10px; margin: 0px; } .itemthumb { width: 350px; height: 150px; position: absolute; bottom: 25px; left: 25px; } my html <!doctype html> <html lang=&qu

matlab - Find median value of the largest clump of similar values in an array in the most computationally efficient manner -

sorry long title, sums up. i looking find median value of largest clump of similar values in array in computationally efficient manner. for example: h = [99,100,101,102,103,180,181,182,5,250,17] i looking 101. the array not sorted, typed in above order easier understanding. array of constant length , can assume there @ least 1 clump of similar values. what have been doing far computing standard deviation 1 of values removed , finding value corresponds largest reduction in std , repeating number of elements in array, terribly inefficient. for j = 1:7 g = double(h); = 1:7 g(i) = nan; t(i) = nanstd(g); end best = find(t==min(t)); h(best) = nan; end x = find(h==max(h)); any thoughts? this possibility bins data , looks bin elements. if distribution consists of separated clusters should work reasonably well. h = [99,100,101,102,103,180,181,182,5,250,17]; nbins = length(h); % <-- set # of bins here [v bins]=

Can't get overlapping divs to fade transition with jquery and jqueryui -

i have 5 divs of similar content. want 1 displayed @ time. there 5 icons below content. when user hovers on icon, appropriate div displays. working perfectly. however, have have fade transition when user changes 1 icon next. started following script: jquery(document).ready(function($){ $('.iconcontainer .icon').on( { mouseenter: function() { $('.outercontainer .slidecontainer').addclass('hiddenslide'); var show_slide = $(this).attr('data-slide'); $('.' + show_slide).removeclass('hiddenslide'); } }); }); the css class 'hiddenslide' set display:none; , icons areas have data-slide attribute equal correct slide number. after unsuccessfully trying transition fade transition, tried using 'show', 'hide', 'fadein', 'fadeout' , without delays. i've read dozens of threads , got lot of weird results, never smooth fading transition. i'm sure error appare

java - TextView Disappears after Screen Rotation -

i new savedinstancestate. there great resources out there, , have figured out. however, textview updates want to, disappears. want remain there when rotate device instead of having click button bring back. idea on going wrong? thanks! textview cashview want see int cash. @override public void onsaveinstancestate(bundle savedinstancestate) { super.onsaveinstancestate(savedinstancestate); // save ui state changes savedinstancestate. // bundle passed oncreate if process // killed , restarted. savedinstancestate.putint("cash", cash); savedinstancestate.putint("antebet", antebet); savedinstancestate.putint("playbet", playbet); savedinstancestate.putint("pairplusbet", pairplusbet); savedinstancestate.putstring("cashview", cashview.tostring()); // etc. } @override public void onrestoreinstancestate(bundle savedinstancestate) { super.onrestoreinstancestate(saved

Confusion About C++ Global Namespace -

from understanding, appending :: front of namespace refers global namespace, regardless of using statements or parent namespaces. if case, , haven't mis-understood anything, why such code compile (at least in visual studio): namespace foo { namespace bar { class x; } } using namespace foo; int main(void) { ::bar::x x; } using namespace foo; brings contents of namespace foo context of current namespace. since namespace bar among contents of namespace foo , current namespace on line using statement global namespace, namespace bar brought context of global namespace.

c# - How to define list structure so XmlSerializer understands it -

Image
i'm working on deserializing xml web service. here how object looks: [serializable] public class docketdata { [xmlelement(elementname = "policylist")] public list<policyitem> policylist { get; set; } } here policyitem: [serializable] public class policyitem { [xmlelement(elementname = "companyname")] public string companyname { get; set; } [xmlelement(elementname = "attntoname")] public string attntoname { get; set; } [xmlelement(elementname = "address")] public string address { get; set; } [xmlelement(elementname = "city")] public string city { get; set; } here xml: <docketdata> <policylist> <policyitem> <companyname>crum &mpany</companyname> <attntoname>to report00</attntoname> <address>305 ave.</address> when deserialize usi

Powerpivot model with 2 facttables (?) -

Image
i'm relatively new powerpivot, , have question while working (using excel 2013). the issue how should model data in powerpivot when have 2 csv files facttables , 1 dimension table. i have (test)powerpivotmodel sourced 3 .csv files loaded powerpivot. a facttable named expenses (holds expenses of person) another facttable named expensesdetails holds details of expense-record a dimension table named category associated expensedetail table expenses , expensesdetails have pretty same information --> 1 expense record 1 record in table expenses , 1 or more records in expensesdetail table --> exampel 1 record in both tables amount can related 1 category --> if 1 amount relates 2 (or more) categories, in database there 1 record in expense table , 2 (or more) records in expensedetail table the category table associated expensedetail table. when load these 3 tables powerpivot, these relations: - 1 between expensedetail , category - 1 between expensedetail ,

file - ipad share by email subject line - set subject line -

is there way set email subject line document @ http://www.mydomain.com/download.aspx?instanceid=1087&type=doc now when hit share , try send ipad, subject line is: " http://www.mydomain.com/download.aspx?instanceid=1087&type=doc " when should customized document: "application form", "waiver form", etc. do set in acrobat (it pdf) or there code can use? thanks check below code email setting email subject: uiactivityviewcontroller* avc = [[uiactivityviewcontroller alloc] initwithactivityitems:@[@"your string share"] applicationactivities:nil]; [avc setvalue:@"your email subject" forkey:@"subject"]; avc.completionhandler = ^(nsstring *activitytype, bool completed) { // ... }; here line [avc setvalue:@"your email subject" forkey:@"subject"]; makes subject "your email subject" if user picks email option in uiactivityviewcontr

email - milter-reject: END-OF-MESSAGE -

few days ago install dkim signing using on centos 6 server. yesterday websites scripts unexpectedly stopped sending out mail. at /var/log/maillog look: aug 10 00:26:45 lcnoju8613 postfix/cleanup[3326]: a907541324: milter-reject: end-of-message localhost[127.0.0.1]: 4.7.1 service unavailable - try again later; from= to= what it? how can fix it? for me issue turned out permissions 1 ... added postfix dkim-milter group , fixed it... need figure out what's going wrong sending of e-mails...

ios - When creating in-app purchases, how do I clear purchase data for new tests? -

i able complete purchase in sandbox environment, how reset data can test fresh? thanks! if talking auto-renewable subscriptions renewing iterations (maximum 5 renews sandbox), refresh after 8 hours (it's not documented anywhere, afaik; watch wwdc 2012 video 308). but if talking non-consumable products - they won't refresh . need create new test account.

java - Object wont move based on angle given? -

so i've been trying make object move based on 2 speeds creates using atan(). every test results in same movement of going straight up. so decided take out , replace inputted angles oddly work the 4 angles 90 180 270 0. i'm not sure why goes directions here's code: public void update() { updatedir(); move(); } public void updatedir(){ dir = math.atan(spdy/spdx); dir =20; //i know here used test if change dir = dir * math.pi / 180.0; system.out.println("dir: " + dir); } public void move() { x += (spd*math.cos(dir)); y -= (spd * math.sin(dir)); } any reason why goes in 4 directions? what @nishant shreshth says true. super important use floating points (like float or double ) instead of int dir , x , y variable. otherwise decimal part dir value might truncated, pretty of problem when use radians , trigonometric functions. also note want use math.atan2(spdy, spdx) instead of default atan method use.

audio - Detecting Small Sound Effects In C++ -

i'm trying detect small (1-3 seconds in length) sound effects, im using fmod capture sounds (which play on program) using loopback technique. ive been researching passed few days, how can compare captured sound effect, database of 50 have stored, know comparing each binary byte wont work cause slight inteference change it. sounds exact audio files being captured each time.. characteristcs should dead on everytime. i cant use fingerprinting libarys out there require record @ least 10-90 seconds of audio. as sounds small, , in small number, guess 1 of gurus out there know simple solution, wanted try , use fft , compare of frequency's etc, cant kiss fft libary working there absoloutly no docs. also ive created function split channels. here int seperatechannels(fmod::sound *sound) { byte *ptr1, *ptr2; unsigned int lenbytes, len1, len2; sound->getlength(&lenbytes, fmod_timeunit_pcmbytes); sound->lock(0, lenbytes, (void**)&ptr1, (void**)&a

utf 8 - Icons not showing on firefox -

Image
using videojs , player's icons aren't loading in firefox (22.0). works in chrome , ie8, supposedly. any suggestions? i having problem on firefox (but not chrome) , @ first saw several references making sure server recognizes svg mime type mentioned in these articles https://github.com/videojs/video.js/issues/509 http://kaioa.com/node/45 i tried these , didn't work, uploaded simple html file videojs example on , worked on server had videojs package on (i referring outside url in these javascript lines <link href="//domain.com/video-js/video-js.css" rel="stylesheet"> <script src="//domain.com/video-js/video.js"></script> <script> videojs.options.flash.swf = "http://domain.com/video-js/video-js.swf" </script> so, realized mistake , installed videojs in same domain website , problem disappeared. found few notes stating firefox bit more strict in regard.

css - Make a long line of characters wrap in HTML -

Image
this question has answer here: wrap text inside fixed div css or javascript? 2 answers users can enter text in particular form of mine , want display text in table format. users enter long lines without spaces. text forces table wide. i can limit td element have max-width , text keeps flowing on other cells. can set overflow: hidden , text gets cut off: but need able read all. there way wrap long line of text in table if text doesn't have spaces? try adding css file on element requires it: word-wrap:break-word; here in action: working example

mq - Delivery reporting for RabbitMQ STOMP producer? -

i trying find out if possible stomp producer receive "delivered consumer" delivery reports messages sent queues? i know producer can receive receipts broker indicating persistence:true in send frame shown on rabbitmq website: "receipts send frames persistent:true not sent until confirm received broker." - https://www.rabbitmq.com/stomp.html at consumer end possible indicate broker message delivered consumer on receipt of ack adding "ack: 'client'" send frame. however, i've not found method end end delivery receipts or perhaps i've misunderstood references? grateful pointers. :) according member of rabbitmq, end end acknowledgement not available. i'll need create own line of communication such acknowledgements.

supervisor - Erlang supervision and applications -

i have number of supervised components can stand alone separate applications. cascade them such call or event in worker in 1 component starts next component down in inverted tree-like structure. 1) can package each of these components separate applications? 2) if so,how write calling code start child application? 3) or need else altogether and,if so, what? note: i'm still working on mastery of supervision trees. chain of events following application:start(mod) still not burned head. many thanks, lrp supervision trees , applications complex erlang/otp concepts. both documented in otp design principles user's guide , in particular in: chapter 5: supervisor behaviour chapter 7: applications . supervision trees not dependency trees , should not designed such. instead, supervision tree should defined based on desired crash behavior, desired start order. reminder, every process running long enough must in supervision tree. an application reusable c

select - Getting unknown column error when using 'as' in mysql statement -

i have mysql statement: select a.id, a.`from member_id`, a.`to member_id`, if(a.`from member_id`=1, a.`to member_id`, a.`from member_id`) other_id, a.text, max(a.`date sent`) `date sent` message join members m on other_id=m.id (a.`from member_id`=1 or a.`to member_id`=1) , a.active=1 group other_id order other_id desc, `date sent` desc but getting error: #1054 - unknown column 'other_id' in 'on clause' i creating column using as key. know whats wrong here? thanks. the as creates column alias (in case other_id ), , can't join on column alias. can use alias in order by else, unless alias comes subquery. your best option here repeat if function in join: select a.id, a.from member_id, a.to member_id, if(a.from member_id=1, a.to member_id, a.from member_id) other_id, a.text, max(a.date sent) date sent message join members m on if(a.from member_id=1, a.to member_id, a.from member_id) = m.id (a.from member_id=1 or a.to member_id=

Basic toggle for a Chrome Exstension -

i cannot believe still have basic programming problems... know basics, still have hard time implementing logic think of. anyways i building basic chrome extension has 1 javascript file , work! issue once click icon forever on, until remove it. want add basic toggle functionality, having difficulty getting working prototype. here couple of ideas: var toggle == 1; // or true, i.e. clicked if (functionname() == 1) { function functionname() { whatever when clicked; blah blah blah; } else if (functionname() == 0) { turn off; } else {}; } switch(toggle) { case 1: whatever when clicked; blah blah blah; break; case 2: turn off; break; default: error; break; } if both if statement , switch statement had different order, case 1 , 2 swapped, not think difference. not think switch statement best way because there no more 2 options, on or off. what while loop change conditions o

c# - How to call String.Split that takes string as separator? -

i have following string value: annualfee[[contactneeyear want split using separator : "[[" the msdn topic string.split says such function exists, used following code : omatch.groups[0].value.split('[['); but throws error saying: can not implicitly convert string[] string so how split string value separator : "[[" try below code, has worked me: string abc = "annualfee[[contactneeyear"; string[] separator = { "[[" }; string[] splitedvalues = abc.split(separator , stringsplitoptions.none); i hope you.. :):)

ubuntu - Interprocess communication using pipe in Linux -

i have written code writing number pipe in linux. under,but showing errors,can me on this. basically problem statement program below:- 1 program open pipe, write number pipe. - other program open same pipe, read number , print them. - close both pipes int main() { int number; file *fout; fout = popen(" ","w"); pclose(fout); return 0; } now question command should give in popen command option (as shown blank above) can proceed further , write number pipe. first, create named pipe using mknod command. mknod pipe p . read , write using functions if files. node can created using code also, using mknod function. error code eexist . more information here. http://linux.die.net/man/2/mknod

java - How to make a JButton move along with drawn lines -

Image
i have jbutton (represented envelope) , arraylist of lines envelope go along. can me? ideas or tutorial appreciated. i assume goal animate envelope along line provide animation of data being transferred. for every line need first find line equation . line equation in form y = * x + b . if have in list mention that's fine. if on other hand have 2 points instead (start , end positions), use above equation find a , b each line. after have equations lines can use animation (probably swingworker or swingtimer ) increase x coordinate of envelope @ regular intervals , use line equation calculate new y coordinate. i hope helps update: added code snippet moving box using swingtimer demonstration package keymovement; import java.awt.color; import java.awt.dimension; import java.awt.graphics; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.swingutilities; import

laravel - How to order grouped results using Eloquent? -

i've been trying figure out time , can't seem make work. have table looks similar this. table: issues id yearly_issue year stock created_at updated_at magazine_id 1 10 2000 1 [timestamp] [timestamp] 3 2 12 1994 6 [timestamp] [timestamp] 10 3 36 2007 10 [timestamp] [timestamp] 102 4 6 2002 7 [timestamp] [timestamp] 7 5 6 2002 2 [timestamp] [timestamp] 5 6 12 2003 9 [timestamp] [timestamp] 10 7 11 2003 12 [timestamp] [timestamp] 10 my problem need sort (easy!) but, want 1 of each magazine (column magazine_id). my eloquent query of is: $issues = issue::where('stock', ($all ? '>=' : '>'), 0) ->orderby('year', 'desc') ->orderby('yearly_issue', 'desc') ->

php - List Items appear correctly in one row but not in some others -

i having weird , strange problem , not sure causing it. can understand once have seen it. here link: http://daccordinc.com/daccor/?wpsc_product_category=guayabera&paged=3 (select grid view clicking on small icon under heading) can see first row in grid correctly displays 5 items in list. second grid displays 5th element , other 4 elements in third row. grid breaks down on pages. what makes problem stranger products , css classes pulled database table using , same products. if first row displays correctly others should have same css. make matters worse problem appears in pages of grid view , others display fine. wordpress site. sorry don't know causing problem , have tried inspect element etc. can't post code. please take @ link. regards ahmar. the problem because of float property , fact of elements have different height. since elements have set width , using display:inline-block; need remove float , align them vertically. try adding css .wpsc_d

form using AJAX JQUERY PHP not working -

i unable load external file while using ajax jquery. want use jquery ajax pop form validate, enter data in mysql. starting simple ajax function. kindly let me know going wrong <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" media="all" href="test_style.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#ajax-contact-form").submit(function(){ var str = $(this).serialize(); $.ajax({ type: "post", url:"contact.php", data: str, success:function(result) { $("#div1").html(result); } }); }); }); </scri

ember.js - Nested json object in ember -

the following link works till positions when add object(company) not displaying anything. refer fiddle app.jsonobject = { id: 1812, name: 'brokerage account', positions: [ { symbol: 'aapl', quantity: '300', company:[ { no: '1', name: 'test' } ] }, { symbol: 'goog', quantity: '500', company:[ { no: '2', name: 'test123' } ] } ] }; the reason why not working because down json structure have plain javascript objects. ember aware of changes , bindings work need use framework's methods ember.object.create (like app.account), objectat(0) , pushobject() etc. create data structure. way bindings , else work expe

the esper events do not perform aggregation logic correctly -

i have tuple: public class mytuple { private int status; private int userid; private int location; private int count1; private int count2; // corresponding getter settrs included. } i create 2 esper statements epl: select mytuple.userid userid, sum(count1) count1, sum(count2) count2 eventstream mytuple.status = -1 group userid, location; , epl statement: select mytuple.userid userid, sum(count1) count1, sum(count2) count2 eventstream mytuple.status = 1 group userid, location; the event streams registered inside configuration. the issue facing , on 2 events being sent out.. 1 status= -1 , status = +1, incremental count of +2 on first epl statement. however, if 1 event being sent, streams work perfectly. there thing missing here?? assuming fact have seperate listener esper view created. best run esper user mailing list, described in http://esper.codehaus.org/about/esper/mailinglist.html create small test case , send along, make sur

groovyshell - How to check whether the input is a number or string by using isNan() in groovy -

hello beginner groovy cofused how check whether given input number or not tried following def a= ' 12.571245error' if(a.isnan()==0) { println("not number") } else { println("number") } kindly me how use isnan in groovy.i googled lot didnt find result . in advance you can try cast number , catch exception if not number def a= ' 12.571245error' try { double println "a number" }catch (e) { println "a not number" } or if(a instanceof number) println "number" else println "nan" although keep in mind, in second way of checking it, fail if a valid number in string "123". 123 number "123" not.

How to call COM Interop of an C# Class,methods using javascript -

i created com interop of c# class access interop usng javascript. class contains addition() method method can not access in javascript. code below interface imathinterface namespace ccwtest { [guid("756892a0-1242-4bf7-984d-c13e68000e8e")] [comvisible(true)] [interfacetype(cominterfacetype.interfaceisidispatch)] public interface imathinterface { [dispid(1)] int addition(int i, int j); } } class classmath [guid("ca9ad3a7-bd31-4be2-a780-8864d493ba5f")] [comvisible(true)] [classinterface(classinterfacetype.none)] [progid("ccwtest.classmath")] public class classmath : imathinterface { [comvisible(true)] public int addition(int x, int y) { return x + y; } } then created snk file ccwmathtest.snk register gacutil. create tlb file using regasm command.all these thing done successfully. then create web application access class method javascript. code <%@ page language="c#&

java - Integer.parseInt Returns an error: The method parseInt(String) in the type Integer is not applicable for the arguments (R.string) -

i have build array of structures i've built: the class (item) built following way: (it shown below) now problem im trying parse string number im getting place (a list in case) int. but error: the method parseint(string) in type integer not applicable arguments (r.string) this piece of code: (it says error in ("integer.parseint"): markers.add(new item(integer.parseint(items.get(0).get(i)), items.get(1).get(i), items.get(2).get(i), items.get(3).get(i), integer.parseint(items.get(4).get(i)), integer.parseint(items.get(5).get(i)))); its long not complicated. thanks lot! edit: the items list list of lists: list<list<string>> items; and structure of class is: private int id; private string title; private string desc; private string pub; private int p; private int n; the code: public list<list<string>> download() { string data = null; //string res = ""; try { client

Problems creating Sankey diagrams using d3.js (3) -

this in relation previous questions "problems creating sankey diagrams using d3.js (1 , 2) here i'm trying replicate example provided malcolm maclean in book "d3 tips , tricks" implementation of "sankey-formatted-json" works, mine doesn't:>) my test dataset (testdrive_ext'json) is { "nodes":[ {"node":0,"name":"node0"}, {"node":1,"name":"node1"}, {"node":2,"name":"node2"}, {"node":3,"name":"node3"}, {"node":4,"name":"node4"}, {"node":5,"name":"node5"}, {"node":6,"name":"node6"}, {"node":7,"name":"node7"}, {"node":8,"name":"node8"}, {"node":9,"name":"node9"}, {"node":10,"name":"node10"}, {"node"

rubygems - Auto correct spelling while searching a Rails Model? -

is there way (a gem) correct spelling mistakes , give similar results when using rails or find functions in model? you're going need more advanced searching utility database provides out of box. recommend looking apache's solr project, , sunspot gem . know can configured provide suggestions if search has typo.

How to get the correct redirect URL in java or Android? -

for example, url: http://f.youku.com/player/getflvpath/sid/137619797659700_01/st/mp4/fileid/0300200100503c2912cacf06f7b7be321d4b39-09c7-d266-1dc7-72fbd749e129?k=d69a130f56086ce92828d4e4&hd=0&ts=26 when copy url in firefox , go, change http://117.27.153.211/youku/6971f2c094c4578e17dbe318a/0300200100503c2912cacf06f7b7be321d4b39-09c7-d266-1dc7-72fbd749e129.mp4 in project, second link in string further use. how redirected url?? this give redirected url final url url = new url("http://www.google.com"); httpurlconnection urlconnection = (httpurlconnection) url .openconnection(); system.out.println(urlconnection.geturl().gethost()); the last line prints redirected url of given url

javascript - Images don't get displayed before a pop-up box -

i started learning javascript doing simple card game , i'm stucked @ problem. want show 4 cards image before user can select trump popup box. but, everytime run code cards images displayed after popup box , not before. please have @ relevant code: function preloadimages() { var imgs = []; (var = 0; < max_length_deck; i++) { imgs[i] = new image(); imgs[i].src = 'img/' + deck[i] + '.png'; } } function generatedeck() { (i = 0; < colour.length; i++) { (x = 0; x < number.length; x++) { deck.push(colour[i] + '' + number[x]); } } } function shufflecards() { cards.length = 0; (i = 0; < max_length_deck; i++) { var random = math.floor(math.random() * deck.length); cards.push(deck[random]); deck.splice(random, 1); } } function dealcards() { generatedeck(); preloadimages(); shufflecards(); (var = 0; < 4; i++) { window.docume

python - Pandas data frame from dictionary -

i have python dictionary of user-item ratings looks this: sample={'user1': {'item1': 2.5, 'item2': 3.5, 'item3': 3.0, 'item4': 3.5, 'item5': 2.5, 'item6': 3.0}, 'user2': {'item1': 2.5, 'item2': 3.0, 'item3': 3.5, 'item4': 4.0}, 'user3': {'item2':4.5,'item5':1.0,'item6':4.0}} i looking convert pandas data frame structured like col1 col2 col3 0 user1 item1 2.5 1 user1 item2 3.5 2 user1 item3 3.0 3 user1 item4 3.5 4 user1 item5 2.5 5 user1 item6 3.0 6 user2 item1 2.5 7 user2 item2 3.0 8 user2 item3 3.5 9 user2 item4 4.0 10 user3 item2 4.5 11 user3 item5 1.0 12 user3 item6 4.0 any ideas appreciated :) try following code: import pandas sample={'user1': {'item1': 2.5, 'item2': 3.5, 'item3': 3.0, 'item4': 3.5, 'item5': 2.5, &

opengl - glfw + glew : unresolved external symbol with older functions -

i have issues glfw3 , glew. here code : #pragma comment(lib, "glew32.lib") #pragma comment(lib, "glfw3dll.lib") #include <iostream> #include "glew\glew.h" #include "glfw\glfw3.h" void error_callback(int error, const char* description) { std::cerr << description << std::endl; } void input_callback(glfwwindow* wnd, int key, int scancode, int action, int mods) { if(key == glfw_key_escape && action == glfw_press) glfwsetwindowshouldclose(wnd, gl_true); } int main(int argc, char** argv) { //init glfw if(!glfwinit()) return exit_failure; //error callback glfwseterrorcallback(error_callback); //create window opengl 4.3 core profil context glfwwindowhint(glfw_context_version_major, 4); glfwwindowhint(glfw_context_version_minor, 3); glfwwindowhint(glfw_opengl_forward_compat, gl_false); glfwwindowhint(glfw_opengl_profile, glfw_opengl_core_profile); glfwwindow* window = glfwcreatewindow(1024, 768, "

java - JFrame listening for KeyEvent while Iconified -

how can keep jframe listening keyevent while state iconified? for example after pressing f1 start program (an auto clicker) , iconify frame (remember because of click focus on frame lost!) :) if you're trying create key-logger program java, don't. it's not tool creating since design isolated os, in other words it's "os-agnostic". need use different tool allegedly nefarious plans such c or c++ since these languages allow closer "metal".

java - found raw type: JComboBox -

i have simple source file guiapp1.java trying compile cmd javac. gives me warning : c:\users\thakkar\java>javac guiapp1.java note: guiapp1.java uses unchecked or unsafe operations. note: recompile -xlint:unchecked details. so used cmd javac -xlint guiapp1.java compile source file. it gave me 6 warnings e.g. guiapp1.java:48: warning: [rawtypes] found raw type: jcombobox jcombobox fruits = new jcombobox(fruitoptions); ^ missing type arguments generic class jcombobox<e> e type-variable: e extends object declared in class jcombobox how can solve this? starting java 7 many swing components use generics, older code produce warning raw types. for combobox example can eliminate warning if provide type of objects holds e.g. should use jcombobox<string> fruits = new jcombobox<>(fruitoptions); if fruitoptions string[] . if use other type change accordingly.

c# - Add items to popup programmatically -

i need create , add items popup code-behind. it's easy in xaml: <popup staysopen="false"> <dockpanel> //items here </dockpanel> </popup> i think "child" need add items don't see "add", "items", "source" or "content" inside. know how this? popup mypopup= new popup(); mypopup.child // ... need add items there popup frameworkelement , can have 1 child (child) => cannot add multiple controls inside, can set child uielement want. instance dockpanel, , use addchild on panel add further controls. mypopup.child = new dockpanel();

Maven Jaxb Generate Fails When Compiling A Module That Depends On Multiple Modules -

Image
i have eclipse maven project consisting of multiple modules, of contain xml schemas want generate classes (using jaxb). project layout follows: schemas\core (pom) schemas\core\types (jar) schemas\vehicle (pom) schemas\vehicle\automobile (jar) schemas\vehicle\civic (jar) the projects contain schemas are: schemas\core\types (xsd\types.xsd) schemas\vehicle\automobile (xsd\automobile.xsd) schemas\vehicle\civic (xsd\civic.xsd) some of modules contain schemas import schemas other modules: automobile.xsd imports types.xsd civic.xsd imports types.xsd, automobile.xsd since schemas located in different projects use classpath catalog resolver along catalog files resolve location of schemas. the automobile project depends on schemas in types project. here entry in catalog file ( catalog.xml ): <rewritesystem systemidstartstring="http://schemas/core/types/" rewriteprefix="classpath:xsd/" /> note use of classpath:xsd/ tell catalog resolver find sche

Android Action Bar won't show items -

Image
i cannot icons show in action bar. i using recent sdk eclipse. i trying tutorial http://developer.android.com/training/basics/actionbar/adding-buttons.html my mainactivity.java package com.example.myfirstapp; import android.os.bundle; import android.app.activity; import android.support.v7.app.actionbaractivity; import android.view.menu; import android.view.menuinflater; public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu items use in action bar menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.main, menu); return super.oncreateoptionsmenu(menu); } } my main.xml under menu is <menu xmlns:android="http://schemas.android.com/apk/res/android" > &