Posts

Showing posts from May, 2013

How to create a Python class -

Image
i'm working on project , didn't example of needed earlier thread closed. need doing creating class in python defines penny object, later on can go in , change nickel, dime, quarter, etc, have basic idea of how create want make sure i'm on right track or if i've vered off. in need create classes , figure out how add them weight, , height. in beginning asked enter number go class , enter how many of objects have , add number. this gives idea of i've started put penny class that's data need have class want make sure set correctly. how go importing new class quarter() you want coin class penny, nickel, dime, quarter inherit from. should have 1 init method class coin(): def __init__(self,weight,height): self.weight = weight self.height = height class penny(coin): def __init__(self): coin.__init__(self,2.5,1.52)

regex - regularexpression for this text sql statement or a program? -

heres sql text in file. select substr(to_char(ctl.tody_run_dt,'yyyymmdd'),1,8) tody_yyyymmdd, substr(to_char(cdr.nxt_proc_dt,'yyyymmdd'),1,8) nxt_proc_yyyymmdd, add_months(ctl.tody_run_dt - cdr.past_accru_dys, - ct.nbr_cycl_for_adj) beg_proc_dt, tbl_crd ) , prv.calendar_run_dt = ( select max(calendar_run_dt) run_tbl1 prv2 from wish extract tables, seems pretty complicated done through regexp? there way? or should write program? cant come algorithm. you might able linear search this. relaxed example , targets from keyword, excludes other keywords. the table data captured in group 1. has split appart upon each ...

multithreading - [C]Malloc problems -

i'm trying write program uses basic threading assignment. below relevant snippets think causing problem. the program runs fine 25 or less threads results in segfault when 26 or more used. led me think malloc statement incorrect. can nudge me in right direction? if need more code posted, i'd happy provide it. also, these problems come when run program on school's student machines. appears work fine local machine. might know why? thanks time! ... struct thread_args { struct bitmap *bm; double xmin; double xmax; double ymin; double ymax; int max; int start; int end; }; ... int num_threads; //given user input struct bitmap *bm = bitmap_create(500, 500); //all threads share same bitmap int i; pthread_t *thread_id = malloc(num_threads * sizeof(*thread_id)); struct thread_args *args = malloc(num_threads * sizeof(*args)); (i = 0; < num_threads; i++) { args[i].bm = bm; args[i].xmin = xcenter-scale; args[i].xmax = xcenter...

html - query failed when upload pdf file to mysql via php -

i trying upload button able upload pdf file database faced problems. database used mysql. pop out window user key in document <form method="post" action="upload.php" enctype="multipart/form-data"> <div> <label for="citation">citation</label> <textarea name="citation" id="citation" placeholder="enter text here..."></textarea> </div> <div> <label for="abstract">abstract</label> <textarea name="abstract" id="abstract" placeholder="enter text here..."></textarea> </div> <p>upload file here</p> <input type="hidden" name="max_file_size" value="2000000"> <input name="userfile" type="file" id="userfile">&nbsp; <br/> <i...

c# - check if progressbar is filled -

i'm making pvp simulator in c# , have ran problem progressbars. im trying is: when 1 of players attacks, random number gets added progressbar. once full radiobutton gets enabled , allows player special move. here code: random r = new random(); int minvalue = 1; int maxvalue = 20; int special = r.next(minvalue, maxvalue); attack.hitplayer2(); int result = (specialbar1.value + special); if (result < 100) { specialbar1.value = (specialbar1.value + special); } else if (result == 100) { specialbar1.enabled = true; } else if (result > 100) { specialbar1.value = 100; } for reason if result == 100 doesn't work. know how fix this? if result == 100 doesn't work because result either more or less 100. make checks first. actually, should have 1 check >= 100 instead of 2 separate checks. want same anyway. random r = new random(); int minvalue = 1; int maxvalue = 20; int special = r.next(minvalue, maxvalue); attack...

iis 7 - The permissions granted to user IIS APPPOOL\ASP.NET v4.0 are insufficient for performing this operation. (rsAccessDenied) -

i developing asp.net (.net 4) application being hosted in iis 7.0 of our test environment(my same pc). i had developed few simple reports in bids , have alredy deployed them on reporting server. now, have included report viewer in application user can view reports deployed on report server. if debug application in local system, can view reports within application. when deploy them in our test web server, whenever (including me) try access them gives rsaccessdenied error ... error message is, the permissions granted user iis apppool\asp.net v4.0 insufficient performing operation. (rsaccessdenied) this error tell user not have permission @ reporting service. try go reporting service administration site , set content manager access user , check if still permission error. check out link well

javascript - How to pass C# parameter over window.showModalDialog() to MVC Action Result? -

i have page in .net mvc project calls pop using javascript. need send property model on actionresult can work it. what page looks like <script type="text/javascript"> //function print() { // $(".btnprint").printpage(); showpopup = function () { window.showmodaldialog("/fileupload/getpopupdata/ --pass model property, do? --", "wndpopup", "width=300,height=500"); } my action result want use property public actionresult getpopupdata(int consignmentid) { var test = consignmentid; //call pop view , populate accordingly return new getdocumenttypeaction<actionresult> { onloaded = m => view("../../areas/exports/views/fileupload/fileupload", m), onerroroccured = (m) => redirects.toerrorpage() }.execute(gtsclient); } try querystring: "/fileupload/getpopupdata?consignmentid=" + '@model.consignmentid...

iphone - Integrate Box IOS sdk in my ios project -

i'm trying integrate box v2 ios sdk on ios project , integration fine, when try login , , after enter username , password , granted access , white screen , , boxapiauthenticationdidsucceed method not called , code the connexion method : -(void) connecttobox { [boxsdk sharedsdk].oauth2session.clientid = @"my-client-id"; [boxsdk sharedsdk].oauth2session.clientsecret = @"my-client-secret"; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(boxapiauthenticationdidsucceed:) name:boxoauth2sessiondidbecomeauthenticatednotification object:[boxsdk sharedsdk].oauth2session]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(boxapiauthenticationdidfail:) name:boxoauth2sessiondidreceiveauthenticat...

sql server 2008 - How to check if the value is not null and if not then the value should be displayed in Textbox in ASP.NET -

this code sqlconnection con = new sqlconnection(cs); con.open(); string query = "select name t_identities branchid = '" + branchidtext.text + "' , accountid = '" + accountidtext.text + "'"; sqlcommand cmd = new sqlcommand(query, con); string value = cmd.executescalar().tostring(); if (value != null) { nametext.text = value.tostring(); } else { nametext.text = "no records found"; } } if query returs null textbox should return no records found or else should display name generated query in text box. please help. probably getting error in line string value = cmd.executescalar().tostring(); as trying convert null value string. better use convert.tostring(cmd.executescalar()) handle case. your if/else block ok

c++ - writing to a wav file using libsndfile -

i'm having trouble writing short buffer wav file on hd. followed few tutorials, give different ways of doing it. anyway, way implemented reason doesn't work. when try print out result of outfile , 0 , , nothing written disk. also, tried different paths, , without file name. update: when change path file name (e.g. hello.wav , not ~/documents/hello.wav ), printing out outfile returns memory location such 0x2194000 . void gilbertanalysis::writewav(float * buffer, int buffersize){ sf_info sfinfo ; sfinfo.channels = 1; sfinfo.samplerate = 44100; sfinfo.format = sf_format_wav | sf_format_pcm_16; const char* path = "~/documents/hello.wav"; sndfile * outfile = sf_open(path, sfm_write, &sfinfo); sf_count_t count = sf_write_float(outfile, &buffer[0], buffersize) ; sf_write_sync(outfile); sf_close(outfile); } from libsndfile docs: on success, sf_open function returns non-null pointer should passed first para...

javascript - Why do the first few clicks do not work in Chrome? -

my webapp uses jquery along jqueryui components. events attached using following scheme: $(function(){ ... $('#id').click(function(){...}); // , $(document).on('click', '.dynamic-element', function(){}); ... }); if click button on page, happens first few clicks not trigger click action, although button "pushes in". the weirdest thing observe in chrome 32, not firefox 27 nor safari 6 (i use mac). i've got real frustrated this. console not give errors. what problem? there workaround? update i have tried (within $(document).ready of course): $('#share').click(function(){ console.log('share clicked'); // ... further code ... }); after 20 page refreshes, i've got non-registered click. :s here go. :) update 2: here comes fiddle: http://jsfiddle.net/22p2d/ open console, open page in 2 tabs, , have fair chance produces phenomenon. did not me.

java - DateFormat.Parse Exception while using GSON -

i'm using gson library converting json object java object. working types except date type of java.util package. whenever try use date value throwing following exception com.google.gson.jsonsyntaxexception: 2012-10-01t09:45:00.000+02:00 @ com.google.gson.internal.bind.datetypeadapter.deserializetodate(datetypeadapter.java:81) @ com.google.gson.internal.bind.datetypeadapter.read(datetypeadapter.java:66) @ com.google.gson.internal.bind.datetypeadapter.read(datetypeadapter.java:41) @ com.google.gson.internal.bind.reflectivetypeadapterfactory$1.read(reflectivetypeadapterfactory.java:93) @ com.google.gson.internal.bind.reflectivetypeadapterfactory$adapter.read(reflectivetypeadapterfactory.java:172) @ com.google.gson.internal.bind.reflectivetypeadapterfactory$1.read(reflectivetypeadapterfactory.java:93) @ com.google.gson.internal.bind.reflectivetypeadapterfactory$adapter.read(reflectivetypeadapterfactory.java:172) @ com.google.gson.gson.fromjson(gso...

vb.net - Dataset from SQL Query Won't Return Time of 00:00 -

i working on web application in vb.net 2008 sql 2008r2 database on end. sending query sql through vb obtain patient's hospital visit information: select top 1 * visit (nolock) visit_code = '123' , start_date <= '07/17/2012' order visit_code desc, start_date desc this returns correct record. however, there hold_start_date_time field defined datetime in database contains both date , time. works great unless time midnight - 00:00. when run above query directly in sql server management studio field displays correctly. in dataset in vb.net when @ datarow field has date no time @ all. time of other 00:00 populates dataset correctly. unfortunately, midnight valid time field. there way can appear in dataset? dim dsdata dataset dsdata = getdataset(strsql, "visit") if datasetrowcount(dsdata, "visit") > 0 dim drdata datarow drdata = dsdata.tables("visit").rows(0) end if public overloads function getdataset(byva...

java - Object methods in android extended array adapter -

i having following object in activity class: /** * item object */ class orderitem { /** * private params */ private string item_name; private double item_price; private integer quantity; public void orderitem(string name, double price, integer qt){ /** * init object properties */ this.item_name = name; this.item_price = price; this.quantity = qt; } /** * getters , setters */ public string getname(){ return this.item_name; } public void setname(string name){ this.item_name = name; } public double getprice(){ return this.item_price; } public void setprice(double price){ this.item_price = price; } public integer getquantity(){ return this.quantity; } public void setquantity(integer qt){ this.quantity = qt; } } and using object update listview item. i've set custom adapter list, ha...

c# - Print Preview of multiple pages not working -

i've seen numerous posts this. believe i'm following them, still having problem. i'm doing in c# , i'm running windows 8.1. i making multi-page print-out of contents of xml file. i'm not looping through of elements, i'm doing own formatting of them. there enough elements i'll end printing several pages, i'm getting stuck on getting page 2 content show on page 2. here's i'm doing. int pageprinting; private void butprint_click(object sender, eventargs e) { pageprinting = 1; printdocument1.printpage += this.printdocument1_printpage; printpreviewdialog1.printpreviewcontrol.document = printdocument1; printpreviewdialog1.show(); ((form)printpreviewdialog1).windowstate = formwindowstate.maximized; } private void printdocument1_printpage(system.object sender, printpageeventargs e) { point pnt = new point(0, 0); switch (pageprinting) { case 1: e.graphics.compositingquality = system.drawing....

c# - Cannot load file after installing CORS -

i have created basic asp.net web api application inside vs express 2013 using of defaults. added controller , returns xml want. as install cors package: install-package microsoft.aspnet.webapi.cors -pre i can't run application anymore: an exception of type 'system.io.fileloadexception' occurred in mscorlib.dll , wasn't handled before managed/native boundary additional information: not load file or assembly 'system.web.http, version=5.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) i followed of instructions on blog post: http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api says nothing issue. i tried updating web api with: install-package microsoft.aspnet.webapi -pre but still problem persists unfortunately in project using webapi.hal depends on web.api 5.0 , greater. the...

Identity change GUID to int -

how 1 change pk column of aspnetuser table guid int data type? should possible latest asp.net-identity version got released today. but can't find anywhere how done? by default asp.net identity (using entity framework) uses strings primary keys, not guids, store guids in string. you need define few more classes, i've created new project (i'm using vs2013 update 2 ctp), here identity models need change: public class applicationuser : identityuser<int, applicationuserlogin, applicationuserrole, applicationuserclaim> { public async task<claimsidentity> generateuseridentityasync(applicationusermanager manager) { // note authenticationtype must match 1 defined in cookieauthenticationoptions.authenticationtype var useridentity = await manager.createidentityasync(this, defaultauthenticationtypes.applicationcookie); // add custom user claims here return useridentity; } } public class applicationuserrole ...

cakephp - Include fixture from Tags plugin in app test -

i'm using excellent cakedc tags plugin on solutions model: class solution extends appmodel { public $actsas = array( 'tags.taggable', 'search.searchable', ); } i have solutionscontroller::search() method: app::uses('appcontroller', 'controller'); class solutionscontroller extends appcontroller { public $components = array( 'paginator', 'search.prg', ); public $presetvars = true; // using model configuration ('search' plugin) public function search() { $this->prg->commonprocess(); $this->paginator->settings['conditions'] = $this->solution->parsecriteria($this->prg->parsedparams()); $solutions = $this->paginator->paginate(); if (!empty($solutions)) { $this->session->setflash('solutions found'); } else { $this->session->setflash('no solutio...

android - Enabling the Edittext on selecting Item from Spinner -

hello friends trying enable edittext depending upon selection of records.the xml file below: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <spinner android:id="@+id/per_id" android:layout_width="fill_parent" android:layout_height="wrap_content" android:spinnermode="dropdown" android:gravity="center" android:layout_margintop="20dp"/> <spinner android:id="@+id/columntoupdate" android:layout_width="fill_parent" android:layout_height="wrap_content" android:spinnermode="dialog" android:gravity="center" android:layout_ma...

c# - Share image in windows phone -

i using v7.1 sdk developing windows phone 8 application ( system doesn't support windows 8 cant use window phone 8 sdk). want share image . in windows phone 8 sdk possible using sharemediatask in windows phone sdk v7.1 not possible . solution save image in library , open programmatically, doing : medialibrary library = new medialibrary(); writeablebitmap wbmp = new writeablebitmap(canvas1, null); memorystream ms = new memorystream(); system.windows.media.imaging.extensions.savejpeg(wbmp, ms, wbmp.pixelwidth, wbmp.pixelheight, 0, 100); ms.seek(0, seekorigin.begin); library.savepicture(string.format("images\\{0}.jpg", 0), ms); at point image has been saved , how open progarmmatically ?

graph - Insert function not working properly in Thesaurus program in C -

i have started creating program , used graph adt understood it. still have problem in inserting set of words. when try insert set of words, words have inserted before seem gone list though haven't terminated program. don't understand please help #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> struct node { char word [20]; struct node *below, *synonym, *nxt; }; struct vertex { struct node *next; //vertex node points list of nodes }; typedef struct vertex v; typedef struct node n; void display(n *node); int existingsyn(n *n, char s[20]); n *search(v *v, char w[20]); int checknode(v *v, char w[20]); v *insert(v *v, char word [20], char syn [20]); n *create(char w [20]); n *create(char w [20]) { n *new; new = (n*)malloc(sizeof(n)); new -> below = null; new -> synonym = null; new -> nxt = null; strcpy(new->word, w); return (new); } int main(void) { int choic...

c# - Translate coordinates to another plane -

my main plane rectangle(0,0,10000,10000) example. my screen plane (ie virtual position) rectangle(1000,1000,1920,1080). my texture2d rectangle(1500,1200,200,100) in main plane. i need translate texture2d coordinates screen plane. tried matrix.translate without success. must texture2d = rectangle(500,200,200,100) in screen plane. in order texture2d (1500, 1200) (500, 200) have use translation of (-1000, -1000) inverse numbers screen plane's coordinates. in code translation this matrix transform = matrix.createtranslation(-screenplane.x, -screenplane.y, 0); the theory want move texture if camera on (0, 0) instead of (1000, 1000). have move texture (-1000, -1000) in order so. check web 2d camera classes, usefull know how cameras work :) 1 example: http://www.david-amador.com/2009/10/xna-camera-2d-with-zoom-and-rotation/

java - how do i format restful webservice json output so each json object starts on a new line? -

for reason, 1 of @get methods automatically outputs json data in following format while both implementations identical. want other @get method format output shown below. get doctors code: @path("/doctors") @get @produces(mediatype.application_json) public list<doctor> getalldoctors() throws exception{ return dao.getalldoctors(); } get patients code: @path("/patients") @get @produces(mediatype.application_json) public list<patient> getallpatients() throws exception{ return dao.getallpatients(); } uniform output: [{"specialty":"surgeon","sex":"male","experience":4,"salary":23232.66,"id":3,"firstname":"kobe","lastname":"bryant"}, {"specialty":"surgeon","sex":"male","experience":4,"salary":23232.66,"id":33,"firstname":"d","lastname...

java - Webview running on wrong thread exception -

initially loading link in webview since sample app. work fine till api 4.1 .throws exception when loading same in ver 4.3 onwards. code: this.runonuithread(new runnable() { @override public void run() { if (loadthisurl != null) { simpbrowser.loadurl(loadthisurl); } } }); the logcat: 03-24 10:45:27.580: a/libc(27538): fatal signal 6 (sigabrt) @ 0x00006b92 (code=-6), thread 27568 (e.simplebrowser) i tried running on ui thread still same issue. load url , seem work. points on how or i'm going wrong helpful.

wordpress - Overwrite plugin files? -

i want overwrite file plugins/the-events-calendar/tickets/meta-box.php of plugin the events calendar . i followed tutorial overwrite plugin files not working me. how can overwrite file? i want add new metabox in evetns ticket section how can without edit plugin file other wise overwrite plugin files. i don't have paid ticket plugin refer to, took bit of time skim through available github code: https://github.com/moderntribe/the-events-calendar/ it looks overwrite option (i.e. moving file plugin folder tribe-events/ folder within current theme directory) applies views templates in: https://github.com/moderntribe/the-events-calendar/tree/master/views you can see example definition of gettemplatehierarchy() function here . but overwrite option doesn't apply /admin-views/tickets/meta-box.php file, since it's included here default php include() : include $this->path . 'admin-views/tickets/meta-box.php'; through method call here...

bar chart - Add extra info to tooltip for specific bar in nvd3 multiBarChart -

i use django django-nvd3 generate charts. i'am not in javascript @ all. i have example (java script created django-nvd3) http://jsfiddle.net/rkorzen/87wvr/2/ i want add info tooltip (if info exist bar). data composed of blocks: {"values": [{"y": 19, "x": "checkpoint 1", "info":"abdg"}, {"y": 17, "x": "checkpoint 2"}], "key": "very good", "yaxis": "1" }, in point want ad info "abdg" tooltip bar x="checkpoint 1" , y=19 don't have idea how :( i'am not sure if django-nvd3 have options this. decided ask js. maybe can help:) try using dict : 'chartdata': { 'x' : 'your_x_axis data', 'name1': 'somename', 'y1': 'y_axis_data' , 'extra1': { "tooltip...

bash - Git-hooks pre-push script does not receive input via STDIN -

the git-hooks pre-push documentation states first line of stdin populated local ref , sha, , remote ref , sha such: <local ref> sp <local sha1> sp <remote ref> sp <remote sha1> lf however, simple pre-push script: #!/bin/bash echo "params=[$@]" read line echo "stdin=[$line]" exit 1 returns following output when $git push run: params=[origin [url]:[branch].git] stdin=[] error: failed push refs '[remote]' the parameters script specified in documentation (name , path of remote). error expected because script exits status of 1. however, can't seem figure out why i'm not receiving local , remote refs on stdin specified documentation. is bug in git ? or, missing something? apologies if stating obvious, if there's nothing push, won't lines on stdin. sample .git/hooks/pre-push.sample has while loop: ifs=' ' while read local_ref local_sha remote_ref remote_sha ... done and ap...

c++ - Feature extraction: Divide the ROI into small windows(patches) or let it be as ROI? -

i interested in feature extraction of roi of image, used feature vectors input svm. features extracted include texture(color co-occurence/haralick features) , color(rgb-histogram, 4 bins , mean r, g, b)- total of 29 features/attributes. question: there difference if feature extraction(computation) done directly on roi image compared dividing roi small parts ( nxn window/patch ) first , computing features? advantages/disadvantages? of 2 give more meaningful features? let's if dividing roi small parts better option , fed svm in training stage, how svm-predict or testing like ? feature extraction of test images/test region of interest have divided small parts , fed svm-predict function(just training process)? or feature extraction on test roi directly do? by way, i'm trying classify disease type found in leaf(3 types, , 1 healthy). , far, got poor results in svm-predict(predicts 1 class, around 20%) , found out features each class not distinguished each other. here...

java - Split words from string into array but not if they are inbetween slashes -

i have code: string path; path = main.getinput(); // lets getinput() "hello \wo rld\" args = path.split("\\s+"); (int = 0; < args.length; i++) { system.out.println(args[i]); } is there way split string words split , put array, if not in between 2 backslashes, "wo rld" 1 word , not two? you try splitting on spaces followed number of backslashes. raw regex: \s+(?=(?:[^\\]*\\[^\\]*\\)*[^\\]*$) java escaped regex: \\s+(?=(?:[^\\\\]*\\\\[^\\\\]*\\\\)*[^\\\\]*$) ideone demo

node.js - Add to my chat nodejs express another my function -

i have basic chat working nodejs, express, , socket.io. i'm trying add own simple javascript function index.html. when send message other connected users, function loadrect() draw square on web page. want same square displayed on other users screens message. message has random coordinates x, y, , random color (massege, x, y, c). me please. (sorry english.) index.html <script src="/socket.io/socket.io.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script> var x; var y; var c; function loadrect() { var e = document.createelement("div"); e.classname = "rect"; document.body.appendchild(e); e.appendchild(document.createtextnode("square")); e = e.style; e.width = e.height='100px'; e.position = "absolute"; x = math.floor(math.random(...

c# - Visual Studio 2013 to GoDaddy Deploy -

i have visual studio 2013 asp.net web forms application works fine in local machine. have godaddy account domain name. need publish application godaddy. found when right click on project , select 'publish' i have several options deploy project. have no idea how continue this. suggestions appreciated. you need deploy using 'ftp' publish method. in order complete need user name , password godaddy hosting details page under ftp users. if don't have users listed, set ftp user , use username , password in visual studio publish profile. server should set " ftp://yoursite.com " "yoursite.com" domain name website.

big o - Asymptotic analysis: Python Big-O homework -

i have homework question asks me give tight big-o estimate of worst-case time-complexity of following python code: sum = 0 = n while > 1: k in range(n*n): sum = sum + k*i = // 2 the outer loop seem have o(log n) time-complexity because of line = // 2. inner loop appears have o(n^2) time-complexity because range n*n. 2 loops seem independent of each other overall time-complexity o(n^2)? you may think of complexity number of simple operations needed complete given task. outer loop says perform given operation log(n) times correctly point out in question. these operations not simple - consist of performing cycle. cycle performs o(n^2) simple operations as, again, point out correctly. try think total number of simple operations performed code fragment? note: in answer assume addition , integral division simple operations.

sql - Cannot create a table in mysql error(150) -

i want create 3 tables called curenttasks, originaltasks , previoustasks. make 1 table , copied other two. 1 table cannot create while other 2 created successfully. the 3 table are: drop table if exists `currenttasks`; /*!40101 set @saved_cs_client = @@character_set_client */; /*!40101 set character_set_client = utf8 */; create table `currenttasks` ( `taskid` mediumint(9) not null auto_increment, `taskname` varchar(255) not null, `isactive` boolean default true, `startdate` datetime not null, `enddate` datetime not null, `completedate` datetime default null, `complexityid` smallint(6) not null, `managerid` mediumint(9) not null, `projectid` mediumint(9) not null, `requirementname` varchar(255) not null, `xpos` smallint(6) default null, `ypos` smallint(6) default null, `description` text not null, `stagename` enum('definition','design','development','testing','evaluation') not null default 'definition...

html - Aligning inputs ontop & next to eachover -

i trying align 2 inputs on top of eachover next 2 inputs on top of each other. here keeps giving me: http://prntscr.com/33k6bq it seems have no problems 2 of them, 2 next them doesn't want work. here style them: css : .loginbutton { font-family: 'nunito'; color: #fff; font-size: 16px; background-image: url(../images/gradient.png); background-position: 0, center; display: inline-block; background-color: #81bb0f; height: 71px; width: 100px; margin-left: 10px; box-shadow:0 0 0 1px rgba(0,0,0,.25) inset,0 0 0 2px rgba(255,255,255,.25) inset; border: 1px solid #919191; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 2px; padding: 10px } html : <form method="post" id="phase-0-form"> <input type="text" id="habbo-name" placeholder="username" size="35" value="<?php echo $template->form->reg_username; ?>" n...

jquery mobile flipswitch active by default -

i'm using query mobile 1.4.0 , i'm trying make flip switch active default i'm not sure how approach it. i've tried adding selected="selected" <input> doesn't seem make difference. have ideas? <form> <div class="prof-wrap"> <div class="prof-left"> <div class="prof-txt-wrap"> <div class="text-off">off title</div> <div class="text-off2">off type</div> </div> </div> <!-- end prof-left --> <div class="prof-mid"> <div class="prof-switch"> <input type="checkbox" data-role="flipswitch" name="flip-checkbox-4" id="flip-checkbox-4" data-wrapper-class="custom-size-flipswitch" selected="selected"> </div> <!--...

java - How to verify that a method gets called with any argument? -

i verify() mockito whether or not method gets called. since not know argument in such way verifies any() argument. possible? @ moment getting "error, wanted x , found y". not care parameter passed, know if method gets called @ all. in advance. as of have tried: when(userbean.getprofile().getlanguage().getvalue()).thenreturn("fr"); verify((userbean), atleastonce()).getprofile().getlanguage().getvalue(); userbean has been mocked return_deep_stubs . getting null pointer exception though. may due fact userbean ejb? as in mockito documentation returns_deep_stubs : verification works last mock in chain. can use verification modes. for example: /* bad */ verify(userbean, atleastonce()).getprofile().getlanguage().getvalue(); /* */ verify(userbean.getprofile().getlanguage(), atleastonce()).getvalue(); (added separate answer point documentation link.)

c pointer with function and money -

write program dispense change. user enters amount paid , amount due. program determines how many dollars, quarters, dimes, nickels, , pennies should given change. ask user 2 inputs (amount due , amount paid) in main() , send these along pointers 5 parameters (dollars, quarters, dimes, nickels, pennies) function called change(), calculate number of each give out. print results main(). what wrong program now. compiles no problems answer wrong wrong. #include <stdio.h> #include <conio.h> //function prototype void change( int *d, int *q, int *di, int *n, int *p, int paid, int due ); int main() { //variables int paid; int due; int dollars; int quarters; int dimes; int nickels; int pennies; //reference variables int *d; int *q; int *di; int *n; int *p; printf( "enter amount due: \n" ); scanf( "%d", &due ); printf( "enter amount paid: \n" ); scanf( "%d...

sql - Move Values into next Column -

i have table (the structure fixed) contains 24 fields h0-h23 representing hours of day. in 1 of these columns there 'm'. once 'm' has been found (say in h13) want swap value in h13 value in h14 (the field next it) , swap value in h14 h13. in example (i have limited 6 fields clarity) null, null, t, t, m, s, f would change to null, null, t, t, s, m, f what efficient way this? thank you note: understand update queries, main problem need find position of 'm' without doing 24 case statements if possible as can't change data-structure, you're stuck lot of case statements... update yourtable set h00 = case m_hour when 00 h01 else h00 end, h01 = case m_hour when 00 h00 when 01 h02 else h01 end, h02 = case m_hour when 01 h01 when 02 h03 else h02 end, h03 = case m_hour when 02 h02 when 03 h04 else h03 end, ... h23 = case m_hour when 22 h22 when 23 ??? else h23 end ( select primary_key, case when h00...

java - JDialog not centered over parent JFrame -

Image
i trying jdialog popup in center of jframe on button click. have joptionpanel popup correctly on parent jframe, jdialog popping relative jframe not in center. the buttons jmenuitem in code, wrote them here jbutton make things easier , straight forward. here's code: call parent jframe: jbutton = new jbutton("about"); about.addactionlistener(new actionlistener() { //this 1 not in center of myjframe public void actionperformed(actionevent e) { new aboutdialog(myjframe.this); } }); jbutton exit = new jbutton("exit"); exit.addactionlistener(new actionlistener() { //this 1 in center of myjframe public void actionperformed(actionevent e) { if(joptionpane.showconfirmdialog(myjframe.this, "are sure want exit ?","",joptionpane.yes_no_option) == 0) system.exit(0); } }); ...

transactions - DB2 Suspend Logging -

running db2 9.7.5 luw on windows 2008. i'm transfering data hourly ms sql 2008 server on wan. read data ms sql, parse data , batch insert work table in db2, in db2 merge data work table master table. once merge done, clear work table prepare next load. i've noticed log files big. since db session open , closed during data exchange, temporary tables not suitable, hence use of work tables. data transfered java app made. i don't need have work table transactions logged. i've read article ibm , found logging doesn't happen in same work unit when table created. using create table...not logged initially , alter table...not logged initially work? understand once have created table logging begins after first commit? do need create table everytime not logged , clear alter table not logged? there better way? you don't need create table every time. issue alter table...not logged initially before inserting data table in same unit of work (transaction...

shell - bash variable part of path -

i apologize if question has been answered before. search terms come generic useful. in bash script, want parameter part of path. script says: p=$1 sudo cp ~/work/niagara-root.1/build/$p/linux/vmlinux.64 /tftpboot/ i invoking with: sh ~/.cpftp.sh taf-2948-im and getting following error: /home/meirs/.cpftp.sh: 5: /home/meirs/.cpftp.sh: /home/meirs: permission denied just clarify: script has execute permission. now when manually @ shell prompt, namely: p=taf-2948-im cp ~/work/niagara-root.1/build/$p/linux/vmlinux.64 /tftpboot/ it works without hitch. what missing? thank you, 1 , all meir shani

assembly - Linux AT&T command-line parameters -

this question has answer here: assembling 32-bit binaries on 64-bit system (gnu toolchain) 1 answer i'm trying learn assembly programming on linux, googled/created simple implementation of "cat", little program not work command-line arguments (it says "colud't open file"). when uncomment "fname" line, works, file i/o fine. think stack-part broken :/ here's code: .code32 .section .data msg_err_open: .asciz "colud't open file.\n" msg_err_open_len: .long . - msg_err_open fname: .asciz "test.txt" .section .bss .equ bufsize, 1024 .lcomm buf, bufsize .section .text .globl _start .align 4 _start: # popl %ebx # argc # popl %ebx # argv[0] # popl %ebx # argv[1] (file) # open movl $5, %eax # open( # movl 8(%esp), %ebx # filename, ??...