Posts

Showing posts from February, 2011

java - Isometric Tile Picking Giving Negative Values -

java - Isometric Tile Picking Giving Negative Values - i need find coordinates isometric tiles when it's clicked. i've got figured out. y values returning correctly, apparently x formula wrong , i'm receiving negative values. exhibit a: the grayness tile supposed 0, 0 reason i'm getting -5... here's code. here create map (probably not relevant question here show how i'm doing things). objectid enum storing tile types. objectid tile_map[][] = new objectid[][] { {objectid.ground_concrete, objectid.ground_grass, objectid.ground_grass, objectid.ground_grass}, {objectid.ground_grass, objectid.ground_grass, objectid.ground_grass, objectid.ground_grass}, {objectid.ground_grass, objectid.ground_grass, objectid.ground_grass, objectid.ground_grass}, {objectid.ground_grass, objectid.ground_grass, objectid.ground_grass, objectid.ground_grass}, {objectid.ground_grass, objectid....

apache - How to avoid duplicate content mapping urls with htaccess -

apache - How to avoid duplicate content mapping urls with htaccess - i'm kind of new writing htaccess rules. want create urls in website simple possible. let's want "map" /home/ directory root domain. so, http://www.domain.com display content /home/ directory without changing url. moreover, don't want users / google access to: http://www.domain.com/home/, so, if goes url, want redirect them root domain: http://www.domain.com. i'm seeing google indexing both directories same duplicate content. http://www.domain.com http://www.domain.com/home/ is there can stop this? don't want utilize robots.txt because i've heard it's bad practice. rewriteengine on rewritebase / # redirect /home/ dir 'www.domain.com' #rewritecond %{request_uri} ^/home/$ [nc] #rewriterule ^(.*)$ / [r=301,l] # show /home/ dir 'www.domain.com' rewritecond %{http_host} ^www\.domain\.com [nc] rewritecond %{request_uri} ^/$ rewriterule ^(.*)$ /home/$1 ...

c++ - gmtime is giving me some times localtime? -

c++ - gmtime is giving me some times localtime? - i'm printing events in multi-thread environment console static mutex shared threads. the problem randomly every hundred or one thousand events time local time , not utc. i have seen error in linux machines (build g++) not in windows (build vc++). have no clue start, idea? void publish(std::string source, std::string topic, std::string msg) noexcept { console.lock(); std::time_t = std::chrono::high_resolution_clock::to_time_t(*localtime); char buf[50]; strftime(buf, sizeof (buf), "%y-%m-%dt%h:%m:%s+00:00", gmtime(&now)); cout << buf << " " << source << " " << topic << " " << msg << endl; cout.flush(); console.unlock(); } struct tm * gmtime (const time_t * timer); converts time_t tm utc time. phone call uses value pointed timer fill tm construction values represent corresponding time, ex...

webstorm - Intellij: Move tab left and right -

webstorm - Intellij: Move tab left and right - is there way move/reposition tab using keyboard? know can switch tab using alt + left/right, , able move them maybe using alt + shift + left/right. is possible? my research suggests there's no way (currently). there "move right" , "move down" splits tab groups vertically , horizontally, respectively. there's no key binding seems related this, either. perhaps suggest feature: https:// youtrack.jetbrains.net /issues/idea/ (they have bad cert don't want link directly) there's plugin can install: http://www.smardec.com/products/idea.html unfortunately, doesn't work in intellij 13 (gives runtime errors) intellij-idea webstorm intellij-13

algorithm - Union grouping in bipartite graphs? -

algorithm - Union grouping in bipartite graphs? - i'm trying figure out (and fast) solution next problem: i have 2 models i'm working with, let's phone call them players , teams. player can on multiple teams , team can have multiple players). i'm working on creating ui element on form allows user select multiple teams (checkboxes). user selecting (or deselecting) teams, i'd display teams grouped players. so examples: if selected teams have no players intersect, each team have own section. if user selects 2 teams , have same players, there 1 section containing names of 2 teams , players. if team_a has players [1, 2, 4, 5] , team_b has players [1, 3, 5, 6]. there next sections: section_x = [team_a, team_b, 1, 5], section_y = [team_a, 2, 3], section _z = [team_b, 3, 5] i hope that's clear. essentially, want find teams players have in mutual , grouping that. thinking maybe there way navigating bipartite graph? not sure how though , might overth...

php - Function returns lots of notices -

php - Function returns lots of notices - first off, skill level @ best, hobbit - new compared if not of you. i attempting craft function homecoming single <br /> if no parameter/value given, else homecoming many <br /> tags value $num equal to. i'm trying create function to: a) larn how create functions b) hate typing <br /> c) it's thought function came interested me. so, ideally, in code, if type getbrt() , homecoming 1 single <br /> tag, if type getbrt(1) , homecoming 1 single <br /> tag, if type getbrt(5) , homecoming 5 <br /> tags. its not working hoped when type getbrt() . have slug value in? trying not possible within constraints of php? here function i've built it: function getbrt2($num){ //if num equals 'nothing', 1 break - easier call/type in code repeatedly if ($num = ''){ echo '<br /'; }else{ //if num equals 'something', breaks ...

python - How can I match values from first row of array with values from first column to create a json? -

python - How can I match values from first row of array with values from first column to create a json? - i have list of lists in python has info this: metric, person1, person2, person3, person4, ... sex|male, 0.50, 0.75, 0.35, 0.80, ... sex|female, 0,50, 0.25, 0.65, 0.20, .... age| 18-24, 0.25, 0.20, 0.15, 0.17, ... i create json next structure: info = [{person1:[{sex|male:0.50}, {sex|female:0.50}, {age|18-24:0.25}]}, {person2:[{sex|male:0.75},{sex|female:0.25}, {age|18-24:0.20}]}, ...] how can match these values using python? if, say, have list of lists, i.e. data = [ ['metric', 'person1', 'person2', 'person3', 'person4'], ['sex|male', 0.5, 0.75, 0.35, 0.8], ['sex|female', 0, 50, 0.25, 0.65, 0.2], ['age| 18-24', 0.25, 0.2, 0.15, 0.17], ] the next produce required output: >>> l = zip(*data) # swap rows , columns - it's easier wor...

Can I release an app with base SDK iOS 7.0 and with Today Extension? -

Can I release an app with base SDK iOS 7.0 and with Today Extension? - i want add together today extension app base of operations sdk ios 7.0. extension should work on ios 8 devices , shouldn't appear on ios 7 devices. know app extension can work on ios 8. exists different target in project. can release app if containing app have base of operations sdk 7 , app extension have base of operations sdk 8. have tested , works fine. today extension appears in notification center on ios 8 devices , doesn't appear on ios 7 devices, no errors. works fine in sandbox, can cause issues submitting app store. work? the reply no. base of operations sdk should 8.0 or 8.1 in order deploy containing app extension. can set deployment target 7.0 app runs on ios 7 too. base of operations sdk sdk utilize build app. deployment target minimum supported ios version want. your containing app should have entitlements (app groups) not supported in sdk 7.0. apple has posted guide on ...

xcode - CFString doesn't conform to protocol Hashable? -

xcode - CFString doesn't conform to protocol Hashable? - i updated xcode 6.1 able work ios 8.1, latest project in facing error. i error saying "cfstring! not conform protocol hashable", next line: let attributes = [kctforegroundcolorattributename:uicolor.blackcolor().cgcolor, kctfontattributename: font] i did not error when running xcode 6.0.1. , also, xcode 6.1 extremely slow. mean, slow doesn't finish loading anything. indexing takes several minutes, , building takes long haven't managed sit down through... crashes. my main problem hashable protocol though. what's that? this appears type inference bug dictionaries contain cf objects. the compiler (apparently) using first key/value pair infer dictionary of type [cfstringref:cgcolorref] , , fails compile because cfstringref doesn't conform hashable . you can work around problem explicitly declaring dictionary type: let attributes : [string:anyobject] = [ kctforegroundco...

ios - My image in ImageView glitches for a second -

ios - My image in ImageView glitches for a second - i'm using xcode 5.1.1 when click button viewcontroller 1 viewcontroller 2, , when vc 1 appears imageview glitches 1 sec before going normal. tried programming segue performseguewithidentifier didn't solve issue. tried using modal's cross dissolve transition, cover vertical , partial cross don't help glitch either. flip horizontal doesn't have glitch wouldn't app. i'm using unwind segue go vc 2 vc 1 vc 1 glitching 1 second. tried regular modal creates worse problems. do? well should admit "the uiimageview" quite generic assumption figure out issue is. pure diagnosis purpose i'd next checks: check size of uiimage you're assigning uiimageview. if uiimage big higher resolution might cause rendering problem in animations. to have proper check of what's going on might want run instruments adding "time profiler" tab. performing either pop or dismiss of vc2 should...

filesystems - unix file system - boot block -

filesystems - unix file system - boot block - in unix file system, 1 boot block needed boot / initialize operating system, why every file systems have boot block ? , it's perchance empty. is there purpose design ? unix filesystems

jquery value of input field within class -

jquery value of input field within class - i have several div's class .agrrow. in each .agrrow there input field name agrprice. i want value of field each instance of .agrrow. i've tried like: $(".agrrow").each(function(){ // cost field lp=parsefloat( $("input[type='text'][name='agrprice']").val() ); }); but ever gives me value of agrprice in first instance of .agrrow class. i'm sure need incorporate "this" i'm not sure how. what right syntax? you should find input element in current teration context. can use: $(".agrrow").each(function(){ // cost field lp=parsefloat($(this).find('[name=agrprice]').val()); }); to them in array: $(".agrrow [name=agrprice]").map(function(){ homecoming parsefloat($(this).find('[name=agrprice]').val()); }).get() jquery

php - Which database to use and how to speed up -

php - Which database to use and how to speed up - i've project store , process expenses of user. there 2 operations on database: insert , select. database may contain millions of entries per day (depending on no. of users or if user company etc.). common queries: show expenses date x date y . (mostly) applying filters on query (1). show expenses on particular item till date. (queries throughout table) show expenses till date. (rarely) 1: i'm confused in database utilize this: sql or nosql or sql , nosql combinely (how in case?). need comparing based on speed while querying big amount of data. 2: since per day may contain millions of records, millions of rows resulted query need transferred server client. (in case there 1 more overhead. database server remote web server. result need transferred database server web server , client.) how create faster? 4: if take mysql, better: a: dumping whole info in 1 big sql table. b: creating table each day (with date ...

How do I access Google Drive Application Data from a remote server? -

How do I access Google Drive Application Data from a remote server? - for application want user able store files on google drive , service have access these same files created application. i created client id web application , able upload/list/download files javascript (client side) drive.appfolder scope. good, half of want do. now want access same files node.js (server side). lost how this. create new client id server? (if so, how user authenticate?) pass authtoken user got client-side , seek utilize on server? don't think work authtoke time-sensitive (and not intended used multiple ips). any direction or illustration server-side code helpful. again, want access these same files user created application, not other files in user's google drive. clarification: think question boils downwards to: "is possible access same application info on google drive both client-side , server-side?" do create new client id server? up you. don't need to,...

integer - how to assing coefficients both positive and real using dsolve -

integer - how to assing coefficients both positive and real using dsolve - so want solve these equation fullsimplify[dsolve[{il''[t] + il[t]/(c*l) == vc[t]/(c*l*r), c*vc''[t] + vc'[t]/r + vc[t]/l == vin/l}, {il[t], vc[t]},t] {{c, l, r} \[element] reals && c >= 0 && l >= 0 && r >= 0}] symbolically , want assing r,l , c positive real integer solution comes imaginer part there other way using dsolve assuming variable greater 0 implies variable real. integer not help in problem. if r, l , c greater 0 , less infinity multiplying both sides eliminate denominators speed , simplify calculation in mathematica. if had simple initial conditions simpler , perhaps faster. this gets rid of imaginary parts in vc , imaginary parts in il simplify[exptotrig[dsolve[{ il''[t]*c*l*r + il[t]*r == vc[t], vc''[t]*c*l*r + vc'[t]*l + vc[t]*r == vin*r}, {il[t], vc[t]}, t]], l > 0 && c > 0 ...

sql server - How to copy branch with hierarchyid? -

sql server - How to copy branch with hierarchyid? - i have simple table fields: catalog_id hierarchyid not null unique, item_id int not null identity(1,1), item_name nvarchar(50) not null, i need create stored procedure re-create branch parent. for example, this: i've done procedure moving 1 branch 1 parent another, here is: alter procedure [dbo].[move_child] @childid int, @newparentid int declare @nold hierarchyid, @nnew hierarchyid select @nold = catalog_id catalogstree item_id = @childid set transaction isolation level serializable begin transaction select @nnew = catalog_id catalogstree item_id = @newparentid select @nnew = @nnew.getdescendant(max(catalog_id), null) catalogstree catalog_id.getancestor(1)=@nnew ; update catalogstree set catalog_id = catalog_id.getreparentedvalue(@nold, @nnew) catalog_id.isdescendantof(@nold) = 1 ; commit transaction but need create re-create same hierarchy , item_name. i've made temporary tabl...

excel - Get decimal value of an ipv6 address -

excel - Get decimal value of an ipv6 address - could help me formula calculate decimal value of ipv6 address? i need set formula in vba create custom excel formula. know formula ipv4 , have read similar can not seem figure out. need able map ipv6 address range in ip2location csv. i have excel ip functions should able start with. =subnetipv4(ipv4,bits,offset) =isipv4(ipv4) ip address bits offset result result 10.11.12.13 26 0 10.11.12.0 true notes: macros must enabled ipv4 string representing ipv4 address in dotted decimal format bits integer (0 32) representing number of mask bits offset integer representing host address offset subnet using offset 0 retun subnet ip address using ipv4 of 255.255.255.255 , offset 0 retun mask of bits size =subnetipv6(ipv6,bits,offset) =isipv6(ipv6) ip address bits offset result result fe80::1dce:e8b3:1a14:2c3b 10 :: fe80:0:0:0:0:0:0:0 tr...

java - I am getting an "incompatible types" error right here and I cannot figure out why -

java - I am getting an "incompatible types" error right here and I cannot figure out why - please help find code "incompatible type"....i've looked , looked , looked , can't find anywhere. import java.util.scanner; public class years { private int centuries, decades; public years(int years) { centuries = years / 100; years -= 25 * years; decades = years / 10; years -= 10 * years; } public int getcenturies() { homecoming centuries; } public int getdecades() { homecoming decades; } public static void main(string[] args) { int years; if(args.length >= 1) { years = integer.parseint(args[0]); } else { scanner keyboard = new scanner(system.in); system.out.print("enter amount in years: "); years = keyboard.nextint(); keyboard.close(); ...

function - jQuery Var issue -

function - jQuery Var issue - can please assist this. want switch "winwidth" div id section: "#about". the code is function splitcolumns() { var winwidth = jquery(window).width() + 15, columnnumb = 1; if (winwidth > 1200) { columnnumb = 3; } else if (winwidth > 992) { columnnumb = 2; } else if (winwidth > 767) { columnnumb = 2; } else if (winwidth < 767) { columnnumb = 1; } homecoming columnnumb; } function setcolumns() { var winwidth = jquery(window).width(), columnnumb = splitcolumns(), postwidth = math.floor(winwidth / columnnumb); container.find('.portfolio-item').each(function() { jquery(this).css({ width : postwidth + 'px' }); }); } the code came believe correct: var container = $ (‘#about’).width() + 15, columnnumb = 1; if (cont...

Jekyll and Sass sourcemaps -

Jekyll and Sass sourcemaps - i'm using gulp-ruby-sass compile css , generate source maps site built on jekyll. source maps beingness generated. when inspect style, sass partial identified source of style. when click on filename, i'm taken empty window. need entire scss directory copied _site directory when site generated. jekyll ignores files prefixed underscore, sass partials automatically excluded. i've tried adding, scss , scss/_sass_partial.scss , , scss/**/*.scss include property of jekyll's _config.yml . property supposed forcefulness inclusion of files otherwise automatically excluded such .htaccess . not work sass partials. jekyll includes partials if underscore removed. know way of dealing this? this work : include: - _sass_partial.scss but can add together gulp task : gulp.task('copy_sass', function(){ gulp.src('./sass/*.scss') .pipe(gulp.dest('./_site/sass')) }); sass jekyll

java - (Android) Cookie problems in HttpClient, URL and HttpURLConnection -

java - (Android) Cookie problems in HttpClient, URL and HttpURLConnection - i going add together captcha validation in registration form in android apps. found server gives signal me there no session. finally, found cookie of application stored nothing. i cannot register business relationship though validation correct. sure there no problem in php server because have tested in browser. i have made 3 types of connection test cookie issue. 1) httpclient httpresponse response = httpclient.execute(httppost); 2) url bitmap bitmap = bitmapfactory.decodestream((inputstream)new url("http://www.example.com/abc.png").getcontent()); 3) httpurlconnection private void send_post(httpurlconnection connection,string variable_set) throws exception { connection.setdooutput(true); connection.setdoinput(true); connection.setinstancefollowredirects(false); connection.setrequestmethod("post"); connection.setrequestproperty("content...

arrays - Freeze variable value in javascript -

arrays - Freeze variable value in javascript - i'm having issue saving variable value @ time in javascript. @ basic level, in code below, variable 'b' maintain value assigned var = []; var b = ''; var c = 'value'; a.push(c); b = a; console.log(b); // b = ["value"] a.push(c); console.log(b); // b = ["value", "value"], want ["value"] i've seen various solutions similar problems using closures such in question: intentionally "freezing" javascript variable using self-executing function. have tried solution unsuccessfully in jsbin: http://jsbin.com/zusara/1/edit?js,console. any help appreciated. , best! assigning array variable not create copy. both a , b variables point same array , alter made via either variable show in other. if want re-create of array in javascript, have explicitly create re-create of array. var = []; var c = 'value'; a.push(c); // create shallow...

xaml - ItemsControl Wrapping -

xaml - ItemsControl Wrapping - i have list of dynamic info needs display in next manner: 1 4 7 10 2 5 8 11 3 6 9 12 13 16 19 22 14 17 20 23 15 18 21 24 ... however code iterates top portion , runs off screen. next code within grid. doing wrong? <toolkit:wrappanel orientation="vertical" grid.row="2" > <itemscontrol itemssource="{binding imagingtypes, mode=twoway}" margin="5"> <itemscontrol.itemspanel> <itemspaneltemplate> <toolkit:wrappanel orientation="vertical"/> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatemplate> <stackpanel orientation="horizontal" margin=...

python - Textbox not expanding with containing frame - TKinter -

python - Textbox not expanding with containing frame - TKinter - i'm building application provides viewports internal info file. files complex, i've created 3 sub-windows handle different aspects of file. upper left provides outline of different sections, upper right provides series of text widgets containing errors found in info file, , lower provides view of datafile itself. facilitate of this, wrote little class serves frame each of these sections , can populated labels, textboxes, etc. (code below.) the problem i'm running text widgets in upper right , lower sections not expand containing frame. based on various searches of effbot.org, stackoverflow, , others, think have settings correct, wrong. if enlarge main window, each section adapts should, text widgets don't expand left right fill new subwindow dimensions. any tips appreciated. here's class provides functionality subwindows: import tkinter tk class scrollingchildframe(...

sql server - SQL Search for multple words and sort results by relevance -

sql server - SQL Search for multple words and sort results by relevance - hope simple of database gurus. i’ll seek short , concise possible. i’m not sql need query (using sql server 2008) following: let’s there products table columns (simplified): id, title, description, brandid, typeid, cost tasks: return rows matching brandid return rows matching typeid return rows price on or equal value need implement sql paging e.g. between send parameters for: start row, end row , page size. results sorted price ( asc or desc ) , title (also asc or desc ) so far nil much complicated , have solution. for example: select t.* ( select count(1) over() totalrecords, row_number() over(order product.price asc) rownumber, product.* product products.brandid = @brandid , products.typeid = @typeid , products.price >= @price ) t t.rownumber between @startrownumber , @endrownumber now fun starts: need add together 1 mo...

jquery search works for one column instead of the whole html table -

jquery search works for one column instead of the whole html table - just want add together search possibility loaded table using jquery , code below works first column only. create work cells. please check code , help me find mistake: here html code: <span id="search"></span> here js code: $("#search").on("keyup", function () { var value = $(this).text(); $("table tr").each(function (index) { if (index != 0) { $row = $(this); $row.each(function () { var cell = $row.find("td").text(); if (cell.indexof(value) != 0) { $(this).hide(); } else { $(this).show(); } }); } }); }); i don't think need $row.each you're in each, seek each on columns instead: $("#search").on("keyup", function () { var value ...

javascript - regex capturing all content instead of just untill first defined string -

javascript - regex capturing all content instead of just untill first defined string - i converting content of tutorials , extracting html tags. made regex: /<html\>(?!html)([\s\s]*)<\/html\>/ trying create capture content of first html group, captures untill lastly html, despite (maybe bad placed) negative lookahead. what did miss here? (live example) this text <html> <div> content </div> </html> more text <html> <div> content </div> </html> make regex lazy: <html\>([\s\s]*?)<\/html\> that should take until first html tag. javascript html regex

arrays - vectorize data from struct in matlab -

arrays - vectorize data from struct in matlab - i have created struct by: a(1).x = {[1.1 5 8], [3 5 6]}; a(2).x = {[3.1 0 4], [9 8 7]}; and wish obtain array value [1.1 3.1]. i have tried: a.x{1}(1,1) field reference multiple construction elements followed more reference blocks error. any ideas please? the syntax error tells cannot farther sub-reference within multiple struct elements. so, obvious one-liner—much slower for loop—that saves memory be: arrayfun(@(y) y.x{1}(1), a) just compare performance, loop-based version function = my_extractor(s) = zeros(size(s)); n = numel(s); k = 1:n a(k) = s(k).x{1}(1); end; end arrays matlab

dialog - How to get render parameter -

dialog - How to get render parameter - i want render parameter. i wrote next aui:script opening new dialog. in script set parameter. <input type="text" name="<portlet:namespace/>weburl" size="75: id="weburl" label="" inlinefield="true" /> <aui:button name="btnpreview" id="btnpreview" value="preview"/> <aui:script> aui().use('aui-base','aui-io-plugin-deprecated','liferay-util-window','liferay-portlet-url', 'aui-dialog-iframe-deprecated', function(a) { a.one('#<portlet:namespace />btnpreview').on('click', function(event){ alert(document.getelementbyid('weburl').value) var strurl=document.getelementbyid('weburl').value; var renderurl =liferay.portleturl.createrenderurl(); renderurl.setparameter("nameurl",strurl); ...

java - How to append data to File using SuperCSV using CsvListWriter -

java - How to append data to File using SuperCSV using CsvListWriter - i have method write info file. public void writecsffiledata(list<string> filedata){ seek { csvlistwriter csvwriter = new csvlistwriter(new filewriter("/path/file.csv"), csvpreference.standard_preference); csvwriter.write(filedata); csvwriter.close(); } grab (exception e) { simplelogger.getinstance().writeerror(e); } the above method called several times write file. but, each time file not appended instead overwritten. thanks in advance. java file csv supercsv

java - IntelliJ too many files open error -

java - IntelliJ too many files open error - in intellij thought 13.1.5 on ubuntu 14.04 lts see occasional error in big projects says "too many files open". interestingly, refuses go away , freezes ide completely. i've tried next things prepare it. 1) modify /etc/sysctl.conf have line shown in article here. made error less frequent: fs.inotify.max_user_watches = 524288 fs.file-max = 380180 2) raise ulimit -n setting on intellij process 64k. don't notice difference in performance this, article mentioned above claims help. 3) add together idea64.vmoptions file (helps speed of indexing, not problem) -xms128m -xmx8192m -xx:maxpermsize=1024m has else seen error , have other suggestions of can prepare it? i've considering asking intellij support, i've found need go , forth them few times before helpful answer. advice community on appreciated. i spoke intellij support. suggested part 2 mentioned not taking effect. tried these s...

android - Pay Google Developer Registration fee. -

android - Pay Google Developer Registration fee. - is there way pay google developer registration fee without google wallet? trying pay through google wallet @ time of adding debit card said authentication failed . unfortunately, believe google wallet means of payment. card 1 of valid ones listed here? otherwise, may issue card/information you've inputted. check out google wallet help center. android google-play

java ee 6 - Websphere 8.5 CDI triggers Observer multiple Times -

java ee 6 - Websphere 8.5 CDI triggers Observer multiple Times - i using websphere 8.5 , have problem simple cdi event. the emitting ejb stateless , emits event once. tested breakpoint in pojos constructor there no other places event gets fired. i checked imports, used right imports. spot error or running in bug? cdi implementation seems pretty outdated. i tested without transactionattribute , outside debug mode too. not alter anything. thanks in advance! m import javax.ejb.transactionattribute; import javax.ejb.transactionattributetype; import javax.enterprise.event.event; import javax.enterprise.event.observes; import javax.enterprise.event.transactionphase; @stateless public class createservice { // injecting emitter @inject private event<createevent> createemitter; public void create(string id) { // fire create event createevent event = new createevent(id); createemitter.fire(event); } @transactionattribute(transactiona...

build.gradle - Execute gradle task on sub projects -

build.gradle - Execute gradle task on sub projects - i have multimodule gradle project trying configure. root proja projb other projc projd proje ... want want able have task in root build.gradle execute buildjar task in each of projects in other directory. i know can configure(subprojects.findall {it.name != 'tropicalfish'}) { task hello << { task -> println "$task.project.name"} } but proja , projb, want run task on c,d,e... please allow me know best way accomplish this. not exclusively sure of these you're after, should cover bases. 1. calling tasks directly you should able call gradle :other/projc:hello :other/projd:hello i tested with: # root/build.gradle allprojects { task hello << { task -> println "$task.project.name" } } and # root/settings.gradle include 'proja' include 'projb' include 'other/projc' inc...

oracle - SQL query to find SUM -

oracle - SQL query to find SUM - i'm new sql , i've been struggling write query. want find sum of salaries employees in give department, let's 'm', , given hire date, let's '2002', ideas? i'm thinking have bring together tables somehow having trouble, i've set schema this. jobs table , columns jobs ------------ job_id salary hire_date employees table , columns employees ------------ employee_id name job_id department_id department table , columns departments ------------ department_id department_name this similar way hr schema in oracle think schema should ok need help query now. you need statement this: select e.name, d.department_name, sum(j.salary) employees e, departments d, jobs j d.department_name = 'm' , to_char(j.hire_date, 'yyyy') = '2002' , d.department_id = e.department_id , e.job_id = j.jo...

Mysql multiple tables left join last table -

Mysql multiple tables left join last table - i have checked several threads on here , cannot find reply question.... trying mysql query multiple tables , left bring together lastly table. not left bring together , gives me no results when include it. help appreciated :) (i using joomla) query = "select distinct u.id uid, concat(u.first_name,' ',u.last_name) name1, u.grad grad, u.opt_out opt_out #__bl_teams t, #__bl_regions r, #__users u left bring together #__bl_paid pd on pd.u_id = u.id u.team_id = t.id , u.team_id != '' , u.s_id = $sid , ((t.id = $tid)or($tid=0)) , (t.id in ($teamsfull)) , ( (t.id in(".$tc_teams."))or(".$tc_id." = 0)) , ((r.id = ".$mid.")or(".$mid." = 0)) , ((r.s_id = ".$sid.")or(".$mid." = 0)) , ( (find_in_set(t.id,r.teams) )or(".$mid." = 0) ) , u.id not in($paidrows) , u.id not in ($rsrows) grouping u.id"; $db->setquery($query, $pagenav-...

python - Threading wxPython GUI? -

python - Threading wxPython GUI? - i've tried many combination of threading know. (wxpython "frame1" created using wxformbuilder) this seems should work crashes: import wx import wx.richtext import time import threading class myframe1 ( wx.frame ): def __init__( self, parent ): wx.frame.__init__ ( self, parent, id = wx.id_any, title = wx.emptystring, pos = wx.defaultposition, size = wx.size( 500,300 ), style = wx.default_frame_style|wx.tab_traversal ) self.setsizehintssz( wx.defaultsize, wx.defaultsize ) bsizer3 = wx.boxsizer( wx.vertical ) self.m_statictext1 = wx.statictext( self, wx.id_any, u"this thingy", wx.defaultposition, wx.defaultsize, 0 ) self.m_statictext1.wrap( -1 ) bsizer3.add( self.m_statictext1, 0, wx.all|wx.align_center_horizontal, 5 ) self.m_richtext1 = wx.richtext.richtextctrl( self, wx.id_any, wx.emptystring, wx.defaultposition, wx.defaultsize, 0|wx.vscroll|wx.hscrol...

php - list all of the employees working on a particular project -

php - list all of the employees working on a particular project - i working mysql db called company tables: employee-> |id_emp|fname|lname|id_dept| department-> |id_dept|dname| project-> |id_proj|pname|id_dept|status|budget|actbudget| emp_prof-> |id_emp|id_proj| i not sure how run queries work emp_proj bring together table. to list of employees working on particular project, utilize query: class="lang-sql prettyprint-override"> select id_emp emp_proj id_emp not null; however, i'd output fname , lname employee table. think need utilize bring together employee , emp_prof on id_emp . can help type of query syntax? thanks... try: select employee.fname, employee.lname emp_proj, employee emp_proj.id_emp = employee.id_emp php mysql select

java - Maximum string length for given number of bytes -

java - Maximum string length for given number of bytes - i need validate maximum length of string value going stored varchar2(4000 bytes) column in database. maximum length should take? assumed 2000, because java string encoded in utf-16, missing something? there case 2000-charactr string can take more 4000 bytes? no, 2000 character string in java can't take more 4000 bytes of character data. may hear said utf-16 variable length encoding because can take 2 or 4 bytes represent unicode code point. while true, irrelevant because java's "character" not unicode code point, utf-16 code unit, 2 bytes. therefore, 2000-character string in java 4000 bytes of utf-16 data. tangential warning: based on utilize of varchar2, seems me using oracle database. oracle has 2 main character set settings, database character set , national character set. first used varchar2 columns (among others), , other used nvarchar2 columns (again, among others). utf-16 is not supported ...

equivalent of C typedef in c# .net -

equivalent of C typedef in c# .net - i have code of c: class="lang-c prettyprint-override"> typedef void (* fps_positioncallback) ( unsigned int devno, unsigned int length, unsigned int index, const double * const positions[3], const bln32 * const markers[3] ); and need write same thing in c#. idea? you need define delegate , mark unmanagedfunctionpointer e.g. [unmanagedfunctionpointer(callingconvention.stdcall)] public delegate void fps_positioncallback( int32 devno, int32 length, int32 index, [marshalas(unmanagedtype.lparray, sizeparamindex = 3)]double[] positions, [marshalas(unmanagedtype.lparray, sizeparamindex = 3)]double[] markers); i assuming bln32 double, may need cdecl instead of stdcall , int16 instead of int32 . you can pass c-function e.g. might declared th...

ios - For loop based on array length in Swift -

ios - For loop based on array length in Swift - i have been trying take length of array , utilize length set amount of times loop should execute. code: if notes.count != names.count { notes.removeallobjects() var namearraylength = names.count index in namearraylength { notes.insertobject("", atindex: (index-1)) } } at moment error: int not have fellow member named 'generator' seems simple issue, haven't yet figured out solution. ideas? you need specify range. if want include namearraylength : for index in 1...namearraylength { } if want stop 1 before namearraylength : for index in 1..<namearraylength { } ios for-loop swift

r - Collapse columns before aggregating by count -

r - Collapse columns before aggregating by count - i have imagine simple question, cannot figure out after deal of board searching/reading tutorials. i have df name entries in columns 5 through 12 of 1 type. name strings (see below example). utilize aggregate or ddply (or another, if easier...) function collapse columns , homecoming count of each unique entry. id | name 1 | name 2 | name 3 row 1: 278 | john | tim | mike row 2: 279 | tim | steve | john row 3: 280 | tim | doug | dave so ideally i'd get: tim | 3 john | 2 mike | 1 etc. | 1 i know how works 1 column: counts=aggregate(numeric(nrow(df)), df[c(4)], length) but when utilize similar line multiple columns, returns unique combinations of 7 columns, instead of nx2 vector aggregated unique entries , total sums. counts2=aggregate(numeric(nrow(df)),df[c(5:12)],fun = function(x) length(unique(x))) thank much help. i'm not speed on new packages hadley has come with, here's ho...

java - Object being static -

java - Object being static - i seen bit of code, though think got concept of static in java bit confused. can 1 explain me, how object beingness static works? my code: package com.oracle.certification.sampletest; public class person { static class mail service { static string desc="male"; } static gender mail=new gender(); } package com.oracle.certification.sampletest; public class gender { string desc="gender"; } package com.oracle.certification.sampletest; public class human { public static void main(string str[]) { system.out.println(person.mail.desc); } } when class human run, o/p 'gender' not 'male', though des= gender nonstatic , des=male static static inner class. don't need import classes in hman? sorry have little knowledge inner classes, first of all. can 1 explain me, how object beingness static works? essentially, static in context means entity in qu...

java - Preserving order in property file while it's being updated -

java - Preserving order in property file while it's being updated - i trying modify existing property file using properties class methods. file getting updated not maintain property order. example, if have info this: baseurl=stackoverflow.com user_id=hello pass=test123 after updating file it's not maintaining key=value pairs. updated file contents alter below: pass=test123 baseurl=stackexchange.com user_id=hell0222 i want info preserve order before updating. please suggest me if of know how preserve order in property file. java

VBA Code for copying and pasting data from one sheet to another based on column headers -

VBA Code for copying and pasting data from one sheet to another based on column headers - on sheet 1,in workbook1 cells a1:e1 have column headings, no data. on sheet 1 of workbook2, info range a1: ac5000. want pick out columns in worksbook match headers on workbook1, re-create , paste them under column headers in workbook1. can help me please dim c range dim rng range dim integer dim r range wscopyfrom1.range("a1").currentregion each r in wscopyto1a.range("a1:g1") set c = .rows(1).find(r.value, , , xlwhole, , 0) if not c nil .columns(c.column).copy r.pastespecial xlpastevalues end if next application.cutcopymode = false end this works vba header match copy-paste

extract high res images with regex -

extract high res images with regex - i'm trying extract high res images links using regex. (?<=hires":").*(?=") but result messedup how can better? the html this 'colorimages': { 'initial': [{"hires":"http://ecx.images-amazon.com/images/i/81xd1dl5eql._sl1500_.jpg","thumb":"http://ecx.images-amazon.com/images/i/51clqurqrbl._ss40_.jpg","large":"http://ecx.images-amazon.com/images/i/51clqurqrbl.jpg","main":{"http://ecx.images-amazon.com/images/i/81xd1dl5eql._sy355_.jpg":[237,355],"http://ecx.images-amazon.com/images/i/81xd1dl5eql._sy450_.jpg":[300,450],"http://ecx.images-amazon.com/images/i/81xd1dl5eql._sy550_.jpg":[367,550],"http://ecx.images-amazon.com/images/i/81xd1dl5eql._sy606_.jpg":[404,606],"http://ecx.images-amazon.com/images/i/81xd1dl5eql._sy679_.jpg":[453,679]},"variant":"main"},{"...

c# - .Net How To Display The Column Value Belonging To That Row Only In A Text Box After Selecting The Value In Combo Box In Parse.com -

c# - .Net How To Display The Column Value Belonging To That Row Only In A Text Box After Selecting The Value In Combo Box In Parse.com - i using parse.com manage grab 1 column of info parse database displayed onto combobox 1 person posted code on parse blog. trying when user select value in combobox should display column belongs selected value. the keys in parse.com database binlocation(values in key display @ combobox) , binheight(values in key display 1 time binlocation selected) the next code of selectedindexchanged: parsequery<parseobject> query = parseobject.getquery("irisbin"); ienumerable<parseobject> res = await query.findasync(); list<int> list = new list<int>(); foreach (var in res) { var s = i.get<int>("binheight"); list.add(s); cbselectarea.items.add(s).tostring(); tbmaxvolume.text = s.tostring(); ...

How to get data from a Swift NSURLSession? -

How to get data from a Swift NSURLSession? - for example, have next code: let task = nsurlsession.sharedsession().datataskwithurl(url, completionhandler: {data, response, error -> void in var dann = nsstring(data: data, encoding: nsutf8stringencoding)! self.str = dann }) task.resume() i want transfer info variable in class (the str variable in class). string "self.str = dann" not convey anything. how can this? i'm not sure nsstring type want. json may format of info returned, depending on url's functionality. tried code provided , got same issues, if treat json (i used httpbin.org dummy url source) , worked. allow task = nsurlsession.sharedsession().datataskwithurl(nsurl(string: "http://httpbin.org/get")!, completionhandler: { (data, response, error) -> void in do{ str = seek nsjsonserialization.jsonobjectwithdata(data!, options: nsjsonreadingoptions.allowfragments) as! [string:anyobje...

multithreading - Rust syncronization strategy for MUD server -

multithreading - Rust syncronization strategy for MUD server - so if had mud sever handled each tcp connection in separate process, for stream in acceptor.incoming() { match stream { err(e) => { /* connection failed */ } ok(stream) => spawn(proc() { handle_client(stream) }) } } what strategy sharing mutable world info server? can imagine n connections responding commands user. each command needing visit , perchance modify world. pub struct server<'a> { world: world<'a> } pub struct world<'a> { pub chat_rooms: hashmap<&'a str, chatroom<'a>> } impl<'a> world<'a> { pub fn new() -> world<'a> { allow mut rooms = hashmap::new(); rooms.insert("general", chatroom::new("general")); rooms.insert("help", chatroom::new("help")); world{chat_rooms: rooms} } ...

android - can I use buttons instead of text in showing suggestion in autocomplete -

android - can I use buttons instead of text in showing suggestion in autocomplete - i know autocomplete uses text element show suggestions want create suggestions appeared buttons instead of dropdown menu how can implement onclick method impact auto suggestion ? android button autocomplete textview multiautocompletetextview

Qt: Hand over a parameter to a PHP script and execute the script -

Qt: Hand over a parameter to a PHP script and execute the script - i run php script qt. script normal .php file tries access adress. how can hand on parameter script , execute script corresponding parameter? does next implemention work? qprocess::execute("user/desktop/", qstringlist() << "script.php"); how can check, if script executed? would great pleasure, if can help me. kind regards php qt push-notification

php - In date_sun_info() what is Transit -

php - In date_sun_info() what is Transit - i understand meaning of sun transit time takes sun move sunrise position sunset position date_sun_info() transit seems homecoming midpoint in day sun between sunrise , sunset position. $sun_info = date_sun_info(strtotime("2006-12-12"), 31.7667, 35.2333); foreach ($sun_info $key => $val) { echo "$key: " . date("h:i:s", $val) . "\n"; } the above illustration output: sunrise: 05:52:11 sunset: 15:41:21 transit: 10:46:46 civil_twilight_begin: 05:24:08 civil_twilight_end: 16:09:24 nautical_twilight_begin: 04:52:25 nautical_twilight_end: 16:41:06 astronomical_twilight_begin: 04:21:32 astronomical_twilight_end: 17:12:00 transit time sun passes on observer's meridian. midday sundial @ longitude happen at. clock midday , solar midday quite different , suspect time given utc, although guess not explained in manual , expect this give result nearer 12:00, although...

c# - Entity Framework 6 Compiled LINQ Query -

c# - Entity Framework 6 Compiled LINQ Query - i'm trying improve performance of web application caching query. public static func<myentity, list<hashduplicates>, iqueryable<formresponse>> compiledduplicatedresponses = compiledquery.compile<myentity, list<hashduplicates>, iqueryable<formresponse>>( (db, hashes) => r in db.formresponse h in db.indexhashes d in hashes r.id == h.formresponseid && h.indexhashstring == d.hash select r); the error receive @ compile time: the type 'myentity' cannot used type parameter 'targ0' in generic type or method 'system.data.entity.core.objects.compiledquery.compile(system.linq.expressions.expression>)'. there no implicit reference conversion 'myentity' 'system.data.entity.core.objects.objectcontext'. i'm using ef6 ok seems in ef5 , greater queri...