Posts

Showing posts from August, 2010

python - Regarding passing variables to an argument -

i working in python 2.7.8. i'm learning parameters , methods. i'm trying accomplish have user enter 2 different variables pass them argument within different methods, sum() , difference(). my following code this: def computesum(x, t): x = int(raw_input('please enter integer: ')) t = int(raw_input('please enter second integer: ')) x+t return sum def computedif(y, j): y = int(raw_input('please enter integer: ')) j = int(raw_input('please enter second integer: ')) y+j return dif def main(): raw_input('would find sum of 2 numbers or difference of 2 numbers?: ') answer = 'sum' while true: computesum() else: computedif() for reason compiler (pyscriptor) isn't running , cannot see output nor error messages, blank. can possibly me syntax/logic errors? there few problems code your indentation way off computesum , computedif expect 2 numbers parameters, ask them termin...

mysqli - sql - displaying count of user id per count of answer -

i have table containing answer data answered unique user. have query. select ta.user_id, count(ta.answer_id) count_answer_id survey_answers ta group ta.user_id having count(ta.answer_id) < 124 order count_answer_id desc; userid count of answers 3702 123 2866 120 5483 120 565 120 1292 120 621 119 2250 119 2719 119 4192 119 5539 119 354 119 1441 119 2501 115 1636 115 866 109 53 108 3091 107 329 106 285 105 997 104 1352 103 5281 103 430 102 2125 102 but results this. user count answer count 1 123 4 120 7 119 2 115 . . . . select count(*) user_count, count_answer_id ( select ta.user_id, count(ta.answer_id) count_answer_id survey_answers ta group ta.user_id having count(ta.answer_id) < 124 ) tmp group count_answer_id order count_answer_id desc

swift - SKSpriteNodes in SKView -

i trying skspritenodes in skview change alpha. here's code: if let nodes = self.gameskview.scene!.children as? [skspritenode] { node in nodes { if node.name != "bg" { node.alpha = 0 } } } with codes, nodes nil when print in gameskview not nil. println("\(self.gameskview.scene!.children)") can try me? in advance. self.gameskview.scene!.children as? [skspritenode] is non-null if all children skspritenode - as? not filter select elements of particular type, it's type-safe "cast". i's difficult provide advice how want without knowing want accomplish , more of code.

java - Setting queryTimeout Value of Datasource created via JNDI -

i have following definition datasource object via jndi created @ weblogic 12c application server. <jee:jndi-lookup id="test.db" jndi-name="db_jndi"/> <bean name="testimpl" class="com.test.db.testimpl"> <property name="datasource" ref="test.db" /> </bean> i know how can set querytimeout value of datasource , how can pass value while initializing it using weblogic 12c, spring 3.5 i have created init() method changed bean definition follow. working fine. <jee:jndi-lookup id="test.db" jndi-name="db_jndi"/> <bean name="testimpl" class="com.test.db.testimpl" init-method="init"> <property name="datasource" ref="test.db" /> <property name="querytimeout" value="${prop.querytimeout}" /> </bean> testimpl.java public void init() { getjdbctempla...

javascript - Validating the date field's using angularJS -

i using angularjs validation purpose in project , know validate normal fields. now, have date field parameter passing in name attribute. in cases user can click 'add date' button adding more dates. so, in case have written code passing parameter name attribute. because of couldn't name field validate. even if user add more date fields enter want validate date fields. here code using, <div class="col-md-12 col-sm-12 col-xs-12 table-responsive"> <table class="table table-striped table-hover"> <tr ng-repeat="dates in hall.halldates"> <td> <div class="col-md-6 col-sm-6 p-0 p-t-10"> select date<span style="color: red">*</span> </div> <div class="col-md-6 col-sm-6 p-0 p-t-10"> <input type="text" ng-model="dates.halldate" name="halldate{{ $index }}" c...

javascript - how to set config inside of controller -

i wrote provider in application below; module.provider('calculatetime', function() { this.$get = function() { var seconds = this.seconds; var minutes = this.minutes; var hours = this.hours; var day = this.day; return { toseconds: function(){ return math.round(seconds); }, tominutes: function(){ return math.round(minutes); }, tohours: function(){ return math.round(hours); }, todays: function(){ return math.round(day); }, exactdate: function(){ return math.floor(hours%24)+":"+ math.floor(minutes%60)+":"+ math.floor(seconds%60); } } }; this.settime = function(milis) { this.milis = milis; this.seconds = this.milis/1000; this.minutes =...

python - Cant use a string because of \n? -

when running code error because of \n @ end of string. how can fix this? import urllib prefix = 'http://archive.outernet.is/' open(!file_list.txt, 'r') f: stock = f.read().splitlines() l in stock: l = l.strip() content = ("%s%s") % (prefix, l) print(content) urllib.request.urlretrieve(content, l) file list contains 1.zip 2.zip 3.zip and error code goes like errno 2, no such file or directory 'website.ca/1.zip\n' strip whitespace each line: for l in stock: l = l.strip() content = ("%s%s") % (prefix, l) # etc. ...

java - Mapping Multiple tables to Single Entity -

i have database contains multiple tables generated on per month basis. e.g transaction_01_2014 transaction_02_2014 transaction_03_2014 . . . transaction_12_2014 all tables have same structure. difference month , year appended @ end. is possible map these tables single @entity class "transaction" in hibernate? if yes, need change configurations? if not possible way, how should operate on these tables in subtle , simple manner, java application? cheers! yes. can map multiple tables single @entity class using @mappedsuperclass annotation . creating super annotation & inheriting it's feature sub-classes different tables in @table annotation. but, in case problem of normalization arises . or you can use @secondarytable annotation allows specify 1 or more secondary tables indicating data entity class stored across multiple tables. for more information : @mappedsuperclass - java doc example @secondarytable - java doc example tutorial - map ...

database - How to fix "No suitable driver found for jdbc:mysql://localhost:3306/emp"? -

this first jsp web app. have html page posts info received jsp page. machine stats: 64bit machine windows 7 64bit netbeans 8.1 64bit java - jdk1.7.0_55, jdk1.8.0_05 32bit java - none 64bit jre - jre8 32bit jre - jre1.8.0_25 environment variables: classpath - .;c:\progra~2\ibm\sqllib\java\db2java.zip;c:\progra~2\ibm\sqllib\java\db2jcc.jar;c:\progra~2\ibm\sqllib\java\db2jcc_license_cu.jar;c:\progra~2\ibm\sqllib\bin;%java_home7%\jre\lib;e:\all softwares\programming languages , tools\mysql-connector-java-5.0.8.zip java_home - c:\program files\java\jdk1.7.0_55\ java_home8 - c:\program files\java\jdk1.8.0_05\ jre_home - c:\program files\java\jre7\ jre_home8 - c:\program files\java\jre8\ path - c:\programdata\oracle\java\javapath;c:\program files (x86)\nvidia corporation\physx\common;c:\program files (x86)\windows resource kits\tools\;c:\program files\dell\dw wlan card;c:\program files (x86)\amd app\bin\x86_64;c:\program files (x86)\amd app\bin\x86;c:\progr...

xcode - CKSMSComposeRemoteViewController timed out waiting for fence barrier from com.apple.mobilesms.compose -

ok, sendsms worked fine before on ios7 , below. however, on ios8 sendsms function fails error in title of question. getting warning here (after trying resolve changing nsarray nsstring using other stack overflow questions): incompatible pointer types assigning 'nsarray *' 'nsstring *' controller.recipients = recipients; returning result of messagecomposeresultcancelled. if (abmultivaluegetcount(phonenumbers) > 0) { phone = (__bridge_transfer nsstring*) abmultivaluecopyvalueatindex(phonenumbers, 0); [self sendsms:@"play me on pokerbuddies. download app at: https://itunes.apple.com/us/app /poker-buddies/id404168013?mt=8" recipientlist:[nsstring stringwithformat:phone, nil]]; } else { phone = @"[none]"; } - (void)sendsms:(nsstring *)bodyofmessage recipientlist:(nsstring *)recipients{ mfmessagecomposeviewcontroller *controller = [[mfmessagecomposeviewcontroller alloc] init]; if([mfmessagecomposeviewcontrolle...

css3 - Flip element with css continuously without action -

i want flip element continuously on y axis 0 360 degree css without action (button, hover). some script allow 1 single time adding class, like: animate.css and other flip on button press ( http://desandro.github.io/3dtransforms/docs/card-flip.html ) or on hover ( http://davidwalsh.name/demo/css-flip.php ) .img:hover { transform: rotatey(360deg); transition: transform 10s; } that tried far, work once , on hover... can me code? use css animation infinite . img { -webkit-animation: anim 10s infinite linear; animation: anim 10s infinite linear; } @-webkit-keyframes anim { {-webkit-transform: rotatey(0deg);} {-webkit-transform: rotatey(360deg);} } @keyframes anim { {transform: rotatey(0deg);} {transform: rotatey(360deg);} }

qt - QML FileDialog nameFilters case sensitive on Linux? -

the following code correctly display *.ext , *.ext files on windows , mac. it not display *.ext (and of course *.ext, *.ext, *.ext...) files on linux. what's mistake? import qtquick 2.3 import qtquick.dialogs 1.1 filedialog { title: "please choose file" namefilters: [ "scene files (*.ext)" ] selectmultiple: true } the linux file system case sensitive, , why won't return *.ext files. the following should work: namefilters: [ "scene files (*.ext *.ext)" ]

Excel VBA - Append text to cell while keeping the cell's already changed text colors -

i'm running comparisions between data in 2 cells (ex. cell a1 & cell b1). add results 'compared' cell. if added (new) in b1, add value 'compared' cell , color value green if exists in both, add value 'compared' cell , color value black if exists in a1 (removed in b1), add value 'compared' cell , color value red. this works, each time add new cell, cell not maintain colors of changed text. i use following add next item cell, , color item. comparedcell.value = comparedcell & "|" & mystringtoappend comparedcell.characters(len(comparedcell) + 2, len(mystringtoappend)).font.color = rgb(0, 255, 0) is there way add append colored text without resetting i've colored in cell? currently testing length of comparedcell after have appended, include appended text. try using instrrev() find last pipe character "|" entered , work there. something this: comparedcell.value = comparedcell & ...

html - Link on image breaks table in Firefox -

i have sliced image inside photoshop generated table. 1 of slices has link on it. displays fine in safari , chrome table breaks in firefox: have slit few pixels wide below image. is there way can fix this? this code td makes whole thing whack: <td colspan='3' background='wfimages/15.jpg'> <a href='http://www.google.com'> <img src='images/worldfamous_01_05.png' width='490' height='490' border='0' alt=''> </a> </td> hah, well, stupid me did not notice image different size table cell. while safari made ok, firefox changed size of cell. sorry!

c - SIGCHLD causing segmentation fault, not going into handler -

i'm trying make simple shell , adding in functionality run processes in background &. in main method have: int main() { if (signal(sigchld, handle) == sig_err) perror("cannot catch sigchld"); pid_t child = fork(); if (child == 0) execvp(command, arguments); else { if (background == 1) { printf("1"); backgroundlist(command, child); printf("2"); } else waitpid(child, null, 0); } } and handler have: void handle(int s) { printf("a"); if (signal(sigchld, handle) == sig_err) perror("cannot catch sigchld"); pid_t pid; printf("b"); while((pid = waitpid(0, null, wnohang)) > 0) { printf("c"); rmbackgroundlist(pid); printf("d"); } } i can can have run process in foreground fine. running "ls" has contents print screen, "a" , "b" printed since goes sigchld handler, doesn't go "...

xcode - ios 8.1 simulator -- Cross origin requests are only supported for HTTP -

i testing web pages locally display on ios devices using xcode's ios simulator. upgraded xcode 6.1 , when testing ios 8.1 in simulator error: xmlhttprequest cannot load file:.... cross origin requests supported http this not happen when testing ios 7.1 nor did happen xcode 6 , ios 8. other uploading content server there way resolve this?

vb.net - Output alternate field in case bound field is null on a Kendo MVC Grid ClientTemplate -

i have cell in kendo mvc grid i'd take 1 of 2 data fields depending on value of one: @(html.kendo().grid(of rtfvm)().name("realtimefinancials") _ .columns(sub(c) c.bound(function(x) x.line.lineitem).htmlattributes(new {.style = "text-align:left"}) c.bound(function(x) x.line.months(0).total).format("0:#,##0}").clienttemplate("#if(data.line.months[0].message == null) {data.line.months[0].total} else {data.line.months[0].message} #") end sub) _ etc the cell rendering blank every time regardless of result of null comparison. must missing obvious! the #...# template markup executes js not output anything. instead, try #:...# or #=...# both output value html, or template: #if(data.line.months[0].message == null) {##:data.line.months[0].total##} else {##:data.line.months[0].message##}# (it looks weird on 1 line, if insert line breaks make more sense:) #if(data.line.months...

How much memory does a Java Array use? -

i'm trying find out how memory array uses inside of jvm. i've set program purpose, giving me odd results. protected static long openmem(){ system.gc(); system.runfinalization(); return runtime.getruntime().freememory(); } public static double listsize(int limit){ long start= openmem(); object[] o= new object[limit]; for(int i= 0; i<limit; i++ ){ o[i]= null; } long end= openmem(); o= null; return (start-end); } public static void list(int i){ for(int y= 0; y<50; y++ ){ double d= quantify.listsize(i); system.out.println(i+" = "+d+" bytes"); } } public static void main(string ... args){ list(1); list(2); list(3); list(100); } when run this, 2 different byte-sizes each size of array, like: 1 = 24.0 bytes 1 = 208.0 bytes 1 = 24.0 bytes 1 = 208.0 bytes 1 = 208.0 bytes 1 = 208.0 bytes 1 = 208.0 bytes 1 = 24.0 bytes so array of 1...

javascript - How to add numbers automatically by entering -

i have form has many fields. in these fields there payment fields starting payment1 payment12. whenever values input these fields should perform addition of values automatically. @ times user might enter few fields or may of them. the problem until input values fields not sum below code: <?php require_once('../../admin panel/db.php'); $remoteemployeeid = $_get['remoteemployeeid']; ?> <!doctype html> <html lang="en-us"> <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script> $(document).ready(function() { $("#datepicker1, #datepick...

java - Give Id to every looped button and set on click listener based on button's id -

i have program retrieve data database, , show on screen buttons. how can give id every button created , make button.onclicklistener every button correct id? here codes : private void selectallgroup() { // todo auto-generated method stub mygroup = (textview) findviewbyid(r.id.tvlistgroup); database allgroup = new database(mygroupactivity.this); allgroup.open(); listgroup = allgroup.counthowmanygroups(username); layout = (linearlayout) findviewbyid(r.id.llmygroup); string groupname[] = allgroup.fetchgroupname(username); (int = 0; < listgroup; i++) { newbt = new button(this); newbt.settext(groupname[i]); layout.addview(newbt); } allgroup.close(); } and here database code (if needed) : public int counthowmanygroups(string username) { // todo auto-generated method stub string query = "select " + group_name + " " + ms_group + " inner join " + ms_group_detail + " b on a." + group_id + "=...

c - Testing equality between two __m128i variables -

if want bitwise equality test between 2 __m128i variables, required use sse instruction or can use == ? if not, sse instruction should use? although using _mm_movemask_epi8 1 solution, if have processor sse4.1 think better solution use instruction sets 0 or carry flag in flags register. this saves test or cmp instruction . to this: if(_mm_test_all_ones(_mm_cmpeq_epi8(v1,v2))) { //v0 == v1 } edit: paul r pointed out _mm_test_all_ones generates 2 instructions: pcmpeqd , ptest . _mm_cmpeq_epi8 that's 3 instructions total. here's better solution uses 2 instructions in total: __m128i neq = _mm_xor_si128(v1,v2); if(_mm_test_all_zeros(neq,neq)) { //v0 == v1 } this generates pxor %xmm1, %xmm0 ptest %xmm0, %xmm0

javascript - Namespace confusion with variable definition and module / revealing module patterns -

i hang of this, still have 1 question i have 2 modules contained in own js files. 1 based on module pattern , other revealing module pattern. confusion have surrounds assignment of variable these functions. code below should help revealing module example. if run example see var1 variable in global namespace dostuff public function var var1 = (function() { function dostuff() { }; return { dostuff : dostuff } })(); module pattern example. if run example below in debugger can see this.var2 line getting executed, not see var2 variable in global namespace (function() { function dostuff() { }; this.var2 = dostuff; })(); just wonder whether can explain misunderstanding. thanks

multithreading - Java - Building communicator what includes video/sound/picture/msg -

i've little problem conception how implement project , cause don't know how send client/server in 1 moment video/sound/msg , how filtrate stream ? if have idea how solve problem thankful. anyway. you have create tx transmits udp stream rx. have implement udp packet loss recovery yourself, because udp connection less, unreliable protocol. suggest udp because flexibility on creating flow/error control mechanisms yourself. while can same tcp, adds latency, , user see pauses in video play. better go udp, bit freezing better pause.

pom.xml - Eclipse luna don't show some tabs in form-based POM -

i have installed eclipse luna , plugin "m2eclipse" (last update). can't see tabs in form-based pom explorer. in maven options haven't found nothing. suggestion? i can see tabs: overview dependencies dependency hierarchies effective pom pom.xml where more other tabs? in fact there these 5 tabs now. can find more information in answer or directly on mailing list . the main explanation other tabs not useful.

java - Why throw CannotResolveClassException on XStream? -

i using follow code: @xstreamalias("listofmbdo") public class xmllistofmbdo { @xstreamimplicit(itemfieldname = "mbdo") public list<modifybetriebsortdataobject> items = new linkedlist<modifybetriebsortdataobject>(); } public class modifybetriebsortdataobject { @xstreamalias("pk") public integer pk; @xstreamalias("name") public string name; public modifybetriebsortdataobject(final integer pk, final string name) { this.pk = pk; this.name = name; } } public void loadthis() { final string test = "<listofmbdo><mbdo><pk>123456</pk><name>test</name></mbdo></listofmbdo>"; final xstream _xstream = new xstream(new domdriver()); _xstream.processannotations(xmllistofmbdo.class); _xstream.processannotations(modifybetriebsortdataobject.class); final xmllistofmbdo testlist = (xmllistofmbdo) _xstream.fromxml(test); } t...

kml - Render kmz file data on google map with geoxml3 -

i use kmz branch of geoxml3 simple render geo date kmz file. works not well. placemarks rendering fine, cant see overlays. code: $doc->addscript($this->baseurl.'/components/com_google_map/assets/zipfile.complete.js', 'text/javascript'); $doc->addscript($this->baseurl.'/components/com_google_map/assets/geoxml3.js', 'text/javascript'); $doc->addscript($this->baseurl.'/components/com_google_map/assets/projectedoverlay.js'); <script type="text/javascript"> google.load("earth", "1"); var mymap; var minzoomlevel = 3; var geoxml; function initialize() { var mapoptions = { center: new google.maps.latlng(55.01, 82.85), zoom: 8, maptypeid: google.maps.maptypeid.roadmap }; mymap = new google.maps.map(document.getelementbyid("map_canvas"), ...

vb.net - Visual Basic Shell Administrator? -

if i'm using visual basic run executable using shell() command, how run executable administrator? method works, @ least in practice, 1 executable won't run , think that's issue. here's example of command i'm trying run. shell("%temp%\ninite.exe") edit: sorry, vb.net, not vba. put bad tag on there. to stay strictly in vba no .net dependencies, should able use shellexecute win32 function. private declare function shellexecute lib "shell32.dll" alias "shellexecutea" ( _ byval hwnd long, _ byval lpoperation string, byval lpfile string, _ byval lpparameters string, _ byval lpdirectory string, _ byval nshowcmd long) long you can pass "runas" lpoperation instead of more usual "open" (commonly called verb). note may cause dialog box come prompting user credentials. a better way might use createprocess or createprocessasuser function powerful way l...

animation - C# XNA - How to draw animated texture with 2 Rectangle variables? -

i have problem need resolve. making space invaders game in c# xna. i've been following tutorial invaders: https://www.youtube.com/watch?list=llhsf03qfdmdhbw02_8c6smg&v=wiw4s75izbi&feature=player_detailpage#t=397 have own code animating invader spritesheet. , here's i'm drawing: void draw(spritebatch spritebatch){ (int r = 0; r < m_invaderrows; r++) { (int c = 0; c < m_invadercollumns; c++) { spritebatch.draw(m_botinvadertex, m_botinvaderpos, m_botinvaderhitbox, color.white, 0f, vector2.zero, 1.0f, spriteeffects.none, 0); // ??? spritebatch.draw(m_botinvadertex, m_botinvadersrect[r, c], color.white); } } } so first draw() call draws 1 animated sprite. second draws 50 non-animated sprites. m_botinvadersrect[r, c] rectangle used multi-dimensional array. i'm looking way combine both draw calls , have 50 animated sprites drawn on screen. how can animate invaders using code bellow? my code: using system...

ruby on rails - Where query with uniqueness -

i want query answers correct = true , grab 1 answer if have same question id. trying uniq or distinct. @answers = answer.where(id: params[:answer_ids]) @correct_answers = @answers.where(correct: true, question_id: distinct).count how grab 1 answer of answers same question_id? try this: @answers = answer.joins(:question).where(id: params[:answer_ids]) @correct_answers = @answers.where(correct: true).distinct(:question_id)

Android service for alarms -

i pretty new android , started learning concepts. trying create alarm clock im using service class initiate alarm. when set alarm time , have app running in background alarm triggered. @ same time, when set time , close app(long press home button , swipe close apps), don't alarm triggered specific time had set earlier. tried possible ways search same question in forum , did few answers did not solve problem. tried searching on github well.. tried them no luck. not posting code because it's simple 1 had made example understand service. wanted know how stock alarm clock in android works , how triggering alarm if set time , close app. what's difference between start sticky method , start not sticky method? simple no complex terms definition appreciated. tell me how proceed this? small tutorial appreciated. every buddy here in advance.

php - Facebook api keeps returning " authorization code has been used ." even though I get logged in .. what's the cause? -

so have error trying fix in code below , api returns code below error: exception occured getting facebook session message: authorization code has been used... cause ? function setredirectloginsession(){ $helper = new facebook\facebookredirectloginhelper($this->redirecturi); try { if(!($this->facebooksession instanceof facebook\facebooksession)){ $this->facebooksession = $helper->getsessionfromredirect(); } else { //if coming facebook app have signed request if(isset($_request['signed_request']) ){ $this->facebooksession = facebook\facebooksession::newsessionfromsignedrequest($_request['signed_request']); }else{ $is_valid = $this->facebooksession->validate($this->client_id,$this->client_secret); if(!$is_valid) $this->newfbsession(); ...

ember.js - ember-cli mocks doesn't return single record -

i'm building simple ember-cli app. , tried implement new mocks feature. server/mocks/users.js module.exports = function (app) { var express = require('express'); var usersrouter = express.router(); usersrouter.get('/', function (req, res) { res.send({"users": [ { "id": 1, "login": 'berdof' }, { "id": 2, "login": 'berdof2' } ]}); }); app.use('/api/users', usersrouter); }; next when i'm trying fetch data, instance in browser, open http://0.0.0.0:4200/api/user/ and correct data. when want fetch single record throws me error cannot /api/users/1 do know why's that? i've been fighting bug 2 hours. help! have day! update here's modified answer according @kaungst post: module.exports = function (app) { var express = require('express'); var router = express.router(); var data...

javascript - Highcharts not displaying tooltip title properly -

i'm using highcharts (technically highstock .js file though) display chart on site. works except tooltip. api specifies {series.name} should work specifying series name in tooltip, chart displays "{series.name}" instead of name itself. here's simplified jsfiddle illustrates issue. switch comments on headerformat: lines in tooltip section , you'll see {point.key} works expected, {series.name} not. what's wrong code produce problem? it known bug reported our developers here . workaround: use tooltip formatter , print informations need.

c++11 - Weird std::vector::reverse_iterator and string behavior -

so have linear vector using store 2d value through class: want print values in reverse ... value (0,0) occupies bottom left , (max_x,max_y) occupies top right ... typical cartesian grid. here code: std::string ss=""; int i=0; (std::vector<real>::reverse_iterator it= vector.rbegin(); it!=vector.rend();++it) { if (linechanger==max_x) { std::cout<<ss<<std::endl; ss=""; linechanger=0; } ss=std::to_string(*it) +"|"+ ss; linechanger++; } note: if not use string , print directly , fine , order reversed. member functions work in main code use std::fill fill vector value need (class function call). change few values e.g. @ (0,0) , (max_x,max_y) manually. (member functions ) filled 2.38 6x6 =36 sized vector changed. change first value accessed ( last in vector, first in reverse iterator) 3. , run program. output: 2.380000|2.380000|2.380000|2.380000|2.3800...

java - JFrames painting over eachother -

i'm working jframes in java make gui. i'm having problem 2 jframes painting on eachother though. public vidberggui() throws classnotfoundexception, instantiationexception, illegalaccessexception, unsupportedlookandfeelexception { super("automatic output verifier"); uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); setbounds(100, 100, 600, 400); setdefaultcloseoperation(jframe.exit_on_close); container con = this.getcontentpane(); con.add(titlepane); titlepane.setlayout(new boxlayout(titlepane, boxlayout.page_axis)); componentpane.setlayout(new boxlayout(componentpane, boxlayout.line_axis)); programsloaded = new jtable(data, columnnames) { @override public boolean iscelleditable(int row, int col) { if (col == 3) return false; return true; } }; programsloaded.getcolumnmodel().getcolumn(2).setcelleditor(new filechoosereditor()); tableholder = new js...

android - Phonegap/Cordova jQuery Mobile - Header Disappearing on scroll -

i'm using cordova/phonegap jquery mobile , topcoat.io. on android , ios, when scroll bottom , reach bottom, top navbar gets pushed , disappears. positioning fixed, i'm unsure why happening. on web doesn't this. any appreciated. thanks, zee loading navbars through jquery if (content.hasclass("header-top")) { $("div.topcoat-navigation-bar").remove(); var colour = content.attr("data-colour"); // console.log(colour); var navbar = $('<div data-position="fixed" class="topcoat-navigation-bar ' + colour + '"><div class="topcoat-navigation-bar__item left quarter"><a id="left-slide-menu-button"><span class="topcoat-icon topcoat-icon--menu-stack"></span></a><a id="nav-logo" href="#table-of-contents-view"><img src="assets/images/logo-123x31.png" />...

Parallel shapes in BizTalk Server -

i using parallel shapes in biztalk orchestration. there 4 parallel branches in shape , in each branch using scope shape (transaction type = none) subsequent catch block , execution logic placed in scope shape. this parallel shape contained in scope (transaction type = none ) in orchestration corresponding catch block. now supposed behaviour if execution in 1 of branch fails? per me if execution of 1 branch fails, execution of other branch should have been taken place. but in orchestration if 1 branch execution fails other branch execution not started even. seems other branch starts executes after previous branch code executed successfully. please tell me can possible source of behaviour? according msdn, parallel shape have branches run independently see msdn: http://msdn.microsoft.com/en-us/library/ee253584(v=bts.10).aspx however, business process perspective, not technical one. if 1 of branches fails, possible other branches not executed. far know, don't hav...

jsp - Javascript confirm box not able to submit form on selecting yes -

in jsp , clicking on button called sumbitform() function below document.data.formsubmit.value="yes"; document.data.action.value='sumbit'; document.data.submit(); here giving proper result , setting value occured on controller in same jsp, calling onload function ,in checking if command class variable set = occured confirmation box can show , after clicking yes button of confirmation box request should process.. used document.data.submit() not working , not giving exception. i think if(confirm("are sure want submit form ") == true ){ // submit form }

Oracle DDL triggers properties? -

which statement true triggers on data definition language (ddl) statements? a. can used track changes table or index. b. can defined users in database or specific user. c. fired when owner of object issues ddl statement. d. can used track changes table, table space, view, or synonym. which correct answer,a surely wrong confused b,c,d. did lot of research not found relevant. answer wrong - ddl triggers can apply more tables or indexes. answer b not clear: trigger can created user provided required priviliges has been granted user. not limited user, e.g. sys answer c wrong - doesn't matter issues ddl statement. answer d seems correct. create , drop , alter statements ddl statements, may fire ddl trigger.

Swift Command failed due to signal: Segmentation fault: 11 -

here code: func cache<t: cacheable>(type: int, items: array<t>, options: cacheoptions?) { log(log_http, "caching ... \(items)") item: cacheable in items { let key: string? = item.primarykeyvalue() } } it's pretty simple, cacheable protocol: public protocol cacheable: class { func primarykeyvalue() -> string? } and compile fails signal issue. if remove :class cacheable, compile go through, when need: nscache().setobject(item, forkey: "key") it complains cacheable not conform anyobject protocol, stuck here. help? thanks.

android - ListView on click listener -

i have designed listfragment . on itemlongclick() , activity starts. onactivityresult() ,i set adapter again , new text view being created dynamically. onclick of each views in item, toast shoud appear. if implement onclick() on each views in adapter itemlongclick() not working. i have attached code below: inside listfragment : @override public void onviewcreated(view view, bundle savedinstancestate) { super.onviewcreated(view, savedinstancestate); getlistview().setonitemlongclicklistener(new adapterview.onitemlongclicklistener() { @override public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { clickposition = position; intent intent = new intent(parent.getcontext(),addeventactivity.class ); startactivityforresult(intent, create_event); return true; } }); } inside adapter getvie...

Searching for Strings with indexOf in Javascript -

i'm still having problems understanding indexof functionality correctly, or there else can't see. i'm using loop search text strings/segments in url: for(var = 0; < links.length; i++) { element = links[i]; if(element.href.indexof(segment) !== -1) { return true; } if url example: http://www.anywebsite.com/this_is_my_text?some&parameters , segment = "this_is_my_text" it works fine. however, if url looks this: http://www.anywebsite.com/this_is_my_text and segment = "this_is_my_text" the segment/string not found , function (around loop) returns false , not true. what doing wrong? can't see it. thanks lot in advance! i tested here: http://jsfiddle.net/en50c13z/ : var u1 = 'http://www.anywebsite.com/this_is_my_text?some&parameters , segment = "this_is_my_text"'; var u2 = 'http://www.anywebsite.com/this_is_my_textand segment = "this_is_my_text"'; if(u2.in...

osx - Problems installing the R package amap in a Mac 10.9.5 -

i trying install package amap in r parallel distance matrix calculations. i run: install.packages("amap", dependencies = true) and error: make: gfortran-4.8: no such file or directory make: *** [pop.o] error 1 error: compilation failed package ‘amap’ * removing ‘/users/javier/library/r/3.1/library/amap’ however, gfortran-4.8 installed in computer: gfortran -v using built-in specs. collect_gcc=gfortran collect_lto_wrapper=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin13/4.8.2/lto-wrapper target: x86_64-apple-darwin13 configured with: ../gcc-4.8.2/configure --prefix=/usr/local/gfortran --with-gmp=/users/fx/devel/gcc/deps-static/x86_64 --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin13 thread model: posix gcc version 4.8.2 (gcc) i read somewhere here way around typing following in .bash_source alias fixrs="launchctl setenv path /usr/texbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/x11/bin" and execute fixrs ...

android - Synchronous or Asynchronous messaging over MQTT is called first -

i have been reading this tutorial learn basics of paho android service api , , in text read client.connect(context, callback has 2 methods onsuccess() , onfailure() as mentioned, synchronous client being used in example (mqttclient opposed mqttasyncclient). means requests, connect, block , return or throw exception. there no polling or read method messages server, messages server can arrive @ time. library provides callback mechanism handle behavior, methods in mqttcallback object registered client, invoked appropriate. mqttcallback interface must implemented class...to enable callback feature, callback object registered client, logically done prior connecting server and after reading last 2 lines mentioned, got confused.because far understood, essence of having client registered calback has connectionlost,deliverycomplete,messagearrived is handle server states "asynchronously" , read server. now, question is, regarding last 2 lines quoted, how should r...

Can JIRA Server be downgraded from 6.3.10 to 6.3.9? -

the product page zephyr jira used compatible jira 6.3.10, since , our other add-ons compatible, upgraded 6.3.10 tuesday. on wednesday getting zephyr startup error opened ops ticket @ problem. today add-on manager tells me version incompatible , product page today says zephyr compatible through 6.3.9. i opened case zephyr, if not have update soon, can downgrade jira 6.3.10 6.3.9 can qa team working again? i did consider rolling , upgrading 6.3.9, i'd lose 2 days worth of data , we've had code checked in; audit nightmare. i wouldn't downgrade jira. unpack zephyr , modify versions supported , repack. suprised 6.3.9 6.3.10 broke zephyr, i'd dig deeper actual error. test in staging of course

match - JavaScript Using Regex to split string by capital letters except when together -

i have function: var header = key.match(/[a-z][a-z]*/g); this take string transactionid , make transaction d. how make split except caps follow each other, in other words make into transaction id or dob dob instead of d o b? i see comments , have tried few things, problem function fed string of values make table header, , used several pages different headers. function constructheader(table, aligment, firstrow) { var thead = document.createelement('thead'); table.appendchild(thead); var tr = document.createelement('tr'); (var key in firstrow) { var header = key.match(/[a-z][a-z]*/g); var newheader = ''; (var = 0; <= header.length; i++) { newheader += header[i] + ' '; } // , on this takes transactionid , creates transaction d. how change becomes transaction id? you can try : key.match(/[a-z]+|[a-z]+[a-z]*/g); it work "myfakeid" edit: star missing ...

javascript - Underscore JS, Grouping by an array Attribute. -

Image
i'm trying use javascript group array 1 of it's attributes. essentially have list of e-mail templates, , i'm trying group them category in can make collapsible accordion later. i think might have syntax of underscore js wrong, or i'm addressing array incorrectly. calling groupby using following command: console.log(_.groupby(result, 'im_category')); but array looks 'im_category' property hidden under attributes function. i'm not sure how there. i've attached console.log of array looks , happens when run command. (i 3 different objects when should 2 if it's working correctly. ) your im_category property of attributes object in businessentity - _.groupby looking properties of businessentity . need create function iteratee : var grouped = _.groupby(result, function (item) { return item.attributes.im_category; }); http://jsfiddle.net/jwnzh8w0/

php - how to make a patteren like 12345-1234567-8 using javascript or jquery? -

i need midify code mean after 5 character hyphen "-" auto inserted , after 7 character hyphen "-" inserted. in code after 5 character hyphen inserted. <html> <head> <script> $('.creditcardtext').keyup(function() { var foo = $(this).val().split("-").join(""); // remove hyphens if (foo.length > 0) { foo = foo.match(new regexp('.{1,5}', 'g')).join("-"); } $(this).val(foo); }); </script> </heead> <body> <input type="text" class="creditcardtext" /> </body> </html> http://jsfiddle.net/juspc/126/ you can match whole string of numbers, , split them chunks this: var num = "1234512345671"; alert("parsed: " + num.replace(/(\d{5})(\d{7})(\d)/, "$1-$2-$3"));

notepad++ - UniversalIndentGUI plugin does not work without admin rights -

without running notepad++ admin, universalindentgui delete work or similar deleting chunk. administrator, performs fine. i thought settings created re-installed notepad++ nothing seems have changed. perhaps didn't clean uninstall? i'm running windows 8, , has problem notepad++ being in default c:\program files (x86) folder. is there alternate or way troubleshoot? here's error, reinstalled use %appdata% plugins, reason don't think is. may need instead. installed not use %appdata% before re-installs. indenter returned exit code: 1 indent console output was: (stdout): (stderr):could not open options file c:\program files (x86)\notepad++\plugins\uigui\temp.astylerc callstring was: "c:/program files (x86)/notepad++/plugins/uigui/indenters/astyle.exe" indentinput.cpp --options="c:/program files (x86)/notepad++/plugins/uigui/temp/.astylerc" i have fixed (or similar) problem way: run notepad++ administrator righ...

ios - Writing NSMutableAttributedString to rtf file could not open? -

Image
my tried code given below:- #define fontfamily(fname,fsize) [uifont fontwithname:fname size:fsize] #define themered [uicolor colorwithred:189.0f/255.0f green:0.0f/255.0f blue:12.0f/255.0f alpha:1] #define helveticabold @"helveticaneue-bold" #define helveticareg @"helveticaneue" #define m 16.0f #define l 20.0f code writing attributedstring nsstring *docdir = [nshomedirectory() stringbyappendingpathcomponent:@"tmp/myuser"]; nsfilemanager *fm = [nsfilemanager defaultmanager]; if (![fm fileexistsatpath:docdir]) { [fm createdirectoryatpath:docdir withintermediatedirectories:no attributes:nil error:nil]; } nsstring *filepath = [docdir stringbyappendingpathcomponent:@"wrp.rtf"]; nsstring *noteasattachment = [freehandttl.text stringbyappendingstring:[nsstring stringwithformat:@"\n%@",freehandtxt.text]]; nsmutableattributedstring *attributedstr = [[nsmutableattributedstring alloc] initwithstring:no...