Posts

Showing posts from April, 2014

Pass django model elemts to javascript file -

is possible pass model elements directly java script file? making custom plugin , plugin in plugins folder. have completed need pass list of model objects it. have few ideas on how hack elements in via template file id prefer if there function call directly within java script file load elements. insight appreciated. in case should use ajax , request models server. alternative serve javascript file django , populate template

jsf - How to get the current page number of dataTable using Jquery -

i have tried solutions provided in rich:datatable paging - marking visited pages of rich:datascroller didn't work rich faces 4.3.4. i have tried page attribute of data scroller. here's code implementing page attribute of datascroller. <h:form id="mainform"> <rich:datascroller for="itemdatatable" maxpages="30" execute="itemdatatable" page="#{itemscontroller.pageindex}"/> <rich:datatable rowkeyvar="rkvar" rows="15" id="itemdatatable" value="#{itemscontroller.itemdm}" var="r"> <f:facet name="footer"> <h:outputtext id="pagenumberoutputtext" value="#{itemscontroller.pageindex}"/> </f:facet> <h:column id="setvalue"> <h:inputtext id="finalitem" valuechangelistener="#{itemscontroller.recalculate()}...

wordpress - Woocommerce Make thumbnails fixed height -

i having strange problem thumbnail size on woocommerce site. thumbnail size product pages set 175 x 169 , catalog product 362 x 257 pixels. can see on link on homepage each image has different height. there anyway force fixed height ? , know why woocommerce size not being enforced? http://restaurantapplianceparts.com/dev/ ahmar did choose "crop" on image settings?

Reading binary files c -

so basicaly have binary file made such structure struct data{ char name[30]; char name2[30]; }; i want read data array of structs file problem dont know how many records there in file. explain how read whole file not given ammout of records inside? you can open file, check it's size: fseek(fp, 0l, seek_end); // go @ end sz = ftell(fp); // tell me current position fseek(fp, 0l, seek_set); // go @ beginning and number of records inside be: n = sz/sizeof(struct data); anyway, careful if write array of structures file, it's possible not readable others machines, due different memory alignment. can use __attribute__((packed)) option sure structure same (but it's gcc specific extension, not part of standard c). struct __attribute__((packed)) data { char name[30]; char name2[30]; };

iphone - "Fastest way to unzip many files on iOS" or "How else can I download many files quickly into my iOS app" -

in app want user able download offline map content. so (compressed) moved tiles zip file. (i used 0 compression) structure that: {z/x/y.jpg} +0 +-0 +--0.jpg +1 +-1 +--0.jpg +2 +-2 +--1.jpg so there going many many files zoom level 0-15. (about 120.000 tiles test-region). i using https://github.com/mattconnolly/ziparchive tried out https://github.com/soffes/ssziparchive before , both pretty slow. takes 5!! minutes on iphone 5s files unzip. is there way can speed things up? other possibilities rather downloading tiles in 1 big zip file there be? edit: how can download content of whole folder iphone without need of unzipping something? any appreciated! jpgs compress @ zip - definition compressed. should create own binary file format, , put whatever metadata need along images (which should encode low quality number, size down). when download files, can open then, read them memory, , extract out data or images needed. this fast , have virtually no overhead i...

asp.net mvc - Render partial view in specific div -

i'm attempting create dynamic gird, or 1 appears dynamic. goal able search, view, edit , delete records single view using partial views. i'd behavior asp.net webforms gridview. basically have table 3 columns. 1 id, other name. third hold simple commands such "save", "update", "cancel" on , forth. i have separate views "_create", "_edit" , "_delete". currently, i'm rending them using method: public actionresult renderpartialview(string view, int? id) { if (id == null) { return partialview(view); } else { projectdata item = new projectdata(); //populate data return partialview(view, item); } } @html.actionlink("edit", "renderpartialview", new { view = "_edit", id = @model.id.tostring() }) this render partia...

ServiceStack Authentication [Authenticate] Attribute Fails to Process the ss-id and ss-pid -

i created testservice calls authenticateservice , authenticates user. before calling testservice cleared of cookies make sure once response ss-id , ss-pid cookies, get. apphost configuration: (ss v4.0.8.0) //plugins plugins.add(new razorformat()); plugins.add(new sessionfeature()); plugins.add(new authfeature(() => new customusersession(), new iauthprovider[] { new customcredentialsauthprovider() })); container.register<icacheclient>(new memorycacheclient()); my customcredentialsauthprovider : public class customcredentialsauthprovider : credentialsauthprovider { public override bool tryauthenticate(iservicebase authservice, string username, string password) { // custom auth logic // return true if credentials valid, otherwise false // bool isvalid = membership.validateuser(username, password); return true; } public override void onauthenticated(iservicebase authservice, iauthsession session, iauth...

c - segmentation fault with reading from directory -

i trying read 2 directories , place contents 2 dynamic arrays when read getting seg fault. place see in loop add? #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <dirent.h> int main(int argc, char** argv) { // directory parameters dir *dira; dir *dirb; struct dirent *da; struct dirent *db; //check if dir exists if (!(dira = opendir(argv[1]))) fprintf(stderr,"failed open directory %s \n",argv[1]); //check if dir b exists if (!(dirb = opendir(argv[2]))) fprintf(stderr,"failed open directory %s \n",argv[2]); //open dir dira= opendir(argv[1]); dirb= opendir(argv[2]); int sizea; int sizeb; while (0!= (da = readdir(dira))) { sizea++; } while (0!= (db = readdir(dirb))) { sizeb++; } char**contentsa; char**contentsb; contentsa=(char**)(malloc(80*sizeof(char*))); contentsb=(char**)(malloc(80*sizeof(char*))); int i=0; while (0!= (da = ...

web services - Getting 404 errors in IIS 7.0 -

i set website in iis 7.0 same way have done many times elsewhere, keep getting 404 errors externally. internally, loads fine. have tried set logging, nothing goes through , may because less familiar how logging works or it. can see iis page when typing in host, past return 404. i have limited knowledge on subject , articles find have jargon. have ideas on or can look? i found error: iis 7.5 microsoft-webdav-miniredir/5.1.2600 404 but have webdav publishing role turned off.

c# how to write a dot modifier in RegExp? -

private string pattern = @"^.$"; the dot not identified modifier, literal string, how idetify modifier? you forgot add quantifier . : if want match 0 or more: @"^.*$" if want match 1 or more: @"^.+$" don't forget regular expressions greedy default. if want non-greedy, append ? .*

java - Maven dependency scope conflict with Eclipse scope -

when declare maven dependancy in eclipse runtime , additional jar's copied tomcat on deployment. on compile have deployment errors, because absence of libraries. eclipse compiles without errors. but, when want build same project maven ( mvn compile ), runtime dependencies not in classpath when compiling , have compilation errors. this causes have compile 1 of tools or maintain 2 pom.xml files. any solution on pom.xml dependencies both used in mvn command compilation , deployed runtime environment eclipse? why declare dependencies runtime if needed compilation? runtime scope indicates dependency not required compilation, execution. in runtime , test classpaths, not compile classpath.

excel - Using a string key to return a value from an array -

i have named array of 14 rows 2 columns. first has string key (ie: country ), , second attribute (ie: owner ). want retrieve owner supplying country . i know how use =index retrieve values named arrays, expects col/row numbers. how might achieve requirement? for sake of answer. feed index function match function provide requisite row number, along lines: =index(b:b,match(a2,a:a,0)) vlookup work index/match more powerful ( see ) if comfortable index might better add match arsenal rather bother v/h lookup.

selection - Excel function and expression for counting only certain items included on an invoice -

i count number of "invoices" had sale of item (lets "abc" don't want count invoice if didn't have "abc" on sale in example below, invoice 3 not counted because "abc" not included on invoice); if did have "abc" on invoice, want count variations of size , color (for example may want count number of color yellow or size 12's; or number of invoices had size 11 , 21 on invoice) could me function use in excel? , expression? i'm thinking countifs? i'm new excel, thanks! customer date invoice item size color -------------.-------.-------.-------.-------.--------- me 1012014 1 abc 23 brown 1012014 2 abc 11 black 1012014 2 bqr 14 red 1012014 2 rpg 12 red someoneelse 1022014 3 erp 12 yellow someoneelse 1022014 3 rky 21 blue them 1102014 ...

api - Is there a Ruby WebMock equivalent for the Lua language? -

i have lua module i'm writing making requests public api: -- users.lua local http = require("socket.http") local base_url = 'http://example.com' local api_key = "secret" local users = {} function users.info(user_id) local request_url = base_url .. '/users/' .. user_id .. "?api_key=" .. api_key print("requesting " .. request_url) local response = http.request(request_url) print("response " .. response) return response end return users this works, i'd use tdd finish writing entire api wrapper. i have spec (using busted framework) works, makes actual request api: -- spec/users_spec.lua package.path = "../?.lua;" .. package.path describe("users", function() it("should fetch users info", function() local users = require("users") local s = spy.on(users, "info") users.info("chip0db4") assert.spy(users.inf...

c# two nested if statements, one else -

please excuse question seems simple, reason cannot think of elegant solution @ moment. i have following situation: if (request.querystring["name"] != null) { if (request.querystring["name"].tostring() != "") { namespan.innerhtml = request.querystring["name"].tostring(); } } the problem is, if want hide namespan if querystring["name"] either null or emtpy. ugly solution be: if (request.querystring["name"] != null) { if (request.querystring["name"].tostring() != "") { namespan.innerhtml = request.querystring["name"].tostring(); } else { namespan.visible = false; } } else { namespan.visible = false; } i have situation both namespan.visible = false; sections merged one area have write once . as far aware, not possible following: if (request.querystring["name"] != null &&...

ios - Swing animation with depth -

in app, have pop banner jumps every time user gets notification server, pop looks sign attached strings top of screen (not code strings lol). i'm trying achieve swing animation, not side side! , forth, acutely bottom yz point should change, looks popup sign coming towards user, , back, , on.... i hope clear question, matter bugging me long time now.. thanks! ! edit so i've added image (really badly draws, sorry that), descrices effect im trying achieve : http://s1.postimg.org/hox4ly3sv/draw_sign.png and again, sorry bad drawing. this code did far: // container calayer *container = [calayer layer]; container.frame = cgrectmake(50, 50, 100, 100); [self.view.layer addsublayer:container]; //create plane calayer *purpleplane = [self addplanetolayer:container size:cgsizemake(100, 100) position:cgpointmake(250, 150) color:[uicolor purplecolor]]; ...

javascript - Jquery Count Elements By Class Returning Wrong Numbers -

Image
what doing when checkbox checked appending id,charges , test name in hidden fields when count before adding appending new hidden fields giving me wrong numbers, dont know why here jquery code: $("input.checkboxtests").live('change', function () { var charges = $('#sample-table-3').find('td.testcharges#' + this.id).html(); var testname = $('#sample-table-3').find('td.testname#' + this.id).html() if (this.checked) { $("#selectedteststable").find('tbody') .append($('<tr>') .attr('id', this.id) .attr('class', "bookedtest") .append($('<td>') .append($('#sample-table-3').find('td.testname#' + this.id).html() ))); var testidindex = $("input.ihiddentestid").length; var checkingindex = $("input.ihiddencheck").length $...

c# - Using group by in linq -

i have list contains factorid , amount , remain columns. i need calculate sum amount , remain columns separately grouped factorid in 1 line: var groupedlist = mylist .groupby(i => i.factorid) .select(g => new { factorid = g.key, sumamount = g.sum(i => i.amount), sumremains = g.sum(i => i.remains) });

preferences - Maintaining the default home screen after reinstall an android app -

i have app used corporate purposes, pre configurated default home screen. they by: installing app pressing exit pressing home in screen appears on "complete action using" screen, selecting app , checking "use default action" the problem have make remote update of app, installation works home screen reseted , "complete action using" screen, comes back. there's way, prevent loss of default home screen preference? no, cannot on stock roms

web services - Python Bottle framework becoming non-responsive -

i having problem using python's bottle framework( http://bottlepy.org/docs/dev/index.html ) host webpage. seems work fine period of time , following error , fails show webpage. script doesn't crash webpage becomes non responsive. any suggestions? traceback (most recent call last): file "/usr/lib/python2.7/socketserver.py", line 295, in _handle_request_noblock self.process_request(request, client_address) file "/usr/lib/python2.7/socketserver.py", line 321, in process_request self.finish_request(request, client_address) file "/usr/lib/python2.7/socketserver.py", line 334, in finish_request self.requesthandlerclass(request, client_address, self) file "/usr/lib/python2.7/socketserver.py", line 651, in __init__ self.finish() file "/usr/lib/python2.7/socketserver.py", line 710, in finish self.wfile.close() file "/usr/lib/python2.7/socket.py", line 279, in close self.flush() fil...

core data - How to set the NSManagedObjectContext for MR_findFirst? -

i use magicalrecord coredata store. have statement generating multiple crashes different users when statement executed: preferencedata *prefdatafound = [preferencedata mr_findfirst]; the error is: +entityforname: nil not legal nsmanagedobjectcontext parameter searching entity name 'preferencedata' coming sequence of calls (from crashlytics): 1 libobjc.a.dylib objc_exception_throw + 30 2 coredata +[nsentitydescription entityforname:inmanagedobjectcontext:] + 104 3 salonbook nsmanagedobject+magicalrecord.m line 91 +[nsmanagedobject(magicalrecord) mr_entitydescriptionincontext:] 4 salonbook nsmanagedobject+magicalrequests.m line 19 +[nsmanagedobject(magicalrequests) mr_createfetchrequestincontext:] 5 salonbook nsmanagedobject+magicalfinders.m line 79 +[nsmanagedobject(magicalfinders) mr_findfirstincontext:] 6 salonbook nsmanagedobject+magicalfinders.m line 86 +[nsmanagedobject(magicalfinders) mr_findfirst] 7 salonbook subviewgrid.m ...

sql server - SQL Division returning odd value -

so have 2 sum values, return. divide 1 of them other, goal spit out basic value. value returned on place. i assume screwed "cast" not sure here. it impossible me share entirety of sql generates this. focus on end results here start outer apply: this me calling outer apply values display, , attempt @ dividing them: ,verifyblock.numa [numerator] ,verifyblock.denominator ,(isnull(((verifyblock.numa) / nullif(verifyblock.denominator,0)),0)) [division] this outer apply generates above: outer apply (select case when cast(tmpdc2.[14]as decimal(10,2)) <= 0 , (case when t4mathblock.[value] >0 t4mathblock.[value] else '0.00' end)<= 0 '0.00' else (case when cast(tmpdc2.[14]as decimal(10,2)) < (case when t4mathblock.[value] >0 t4mathblock.[value] else '0.00' end) cast(tmpdc2.[14]as decimal(10,2)) else (case when t4mathblock.[value] >0 t4mathblock.[value] else '0.00' end) end) ...

java - how to create two actions on the same Controller for the same jsp page in spring-mvc -

the problem want create 2 actions in controller same jsp page(main.jsp) first action executed in moment of redirection main.jsp page, display details of product , , second associated button. how indicate spring wish method call ?? controller : @requestmapping(value = "pages/main", method = requestmethod.get) public string detailproduct(final model model, @requestparam string id) { productdto product = productservice.getproduct(long.parselong(id)); productmodel productbean = mapperdozerbean.map(product, productmodel.class); model.addattribute("detailproduct", productbean); return detailview; } @requestmapping(value = "pages/main", method = requestmethod.get) public string addtocaddy(final model model, @requestparam string id,string action) { productdto product = productservice.getproduct(long.parselong(id)); ... return caddyview; } jsp : main.jsp ... <div id="description"> ...

javascript - Appending multiple non-nested elements for each data member with D3.js -

i create multiple non-nested elements using d3 create structure this: <div id="parent"> <p> data[0] </p> <p> data[0] </p> <p> data[1] </p> <p> data[1] </p> <p> data[2] </p> <p> data[2] </p> </div> creating nested structures go like d3.select('#parent').selectall('p').data(data).enter(). append('p')...append('p') but maintain original selection after append, continue appending parent element. thank you! the idomatic way of doing is nesting: var divs = d3.select('#parent').selectall('p').data(data).enter().append('div'); divs.append('p') divs.append('p') which creates: <div id="parent"> <div> <p> data[0] </p> <p> data[0] </p> </div> <div> <p> ...

c# - call another api controller -

when call user controller (api/user), able pass user credentials, application crashes null exception error ( value cannot null ) in values controller: public class valuescontroller : apicontroller { private cdwentities db = new cdwentities(); public httpresponsemessage get([fromuri] query query) { var data = db.database.asqueryable(); if (query.name != null) { data = data.where(c => c.name == query.name); } if (query.price != null) { data = data.where(c => c.price == query.price); } if (!data.any()) { var message = string.format("error"); return request.createerrorresponse(httpstatuscode.notfound, message); } ***return request.createresponse(httpstatuscode.ok, data);*** } } i believe error because valuescontroller method cannot pass null values pass parameters(i.e. api/values/name=tom), hence when call user controller,...

Writing a shell in C for linux, exec for one certain process is infinitely looping -

this relevant snippet of code: if(!strcmp(args[0],"run")){ pid_t pid = fork(); if(pid == 0){ execvp(args[1], args); fprintf(stdout, "process not found in directory\n"); kill((int)getpid(), sigkill); } else{ if(pid < 0) exit(1); fprintf(stdout, "pid of process = %d\n", pid); int success = waitpid(pid, &childexitstatus, wuntraced | wcontinued); if(success == -1) exit(exit_failure); } } now when run process libre office math, open 1 instance of it. however, when try open xterm using code, continue exec on , over, creating many instances of xterm before interrupt , exit. don't see loops cause happen. insight why be? the execvp() call incorrect because passes a...

java - Flip Images in a viewpager -

i have viewpager fullscreen image slider horizontal swipe. trying put image behind every image on slider. meaning, user can click on 'flip' button reveal image. below code have 2 issues: the first time click flip button, flips image reveal same image. however, when click second time works :). the flip button works on first image. when swipe right or left flip button doesn't work anymore. help? note: using fullscreenactivity theme hides ui control until user clicks on image. fullscreenactivity.java package me.zamaaan.wallpaper; import android.support.v4.view.pageradapter; import android.support.v4.view.viewpager; import me.zamaaan.wallpaper.util.systemuihider; import android.annotation.targetapi; import android.app.activity; import android.content.intent; import android.os.build; import android.os.bundle; import android.os.handler; import android.os.message; import android.view.motionevent; import android.view.view; import android.widget.imageview; import a...

c - Generate large array of Hexadecimal numbers of size more that 8 MB -

i trying generate large array of hexadecimal numbers , numbers randomly generated. size of array ranges 8 mb 40 mb. should implement in c. know should use malloc creating large array, couldn't figure out how generate random hexadecimal numbers , put in array. constraint before every hexadecimal number there should "0x". if use str[i] = hex_digits[ ( rand() % 16 ) ]; i generate hexadecimal number doesn't have 0x in front of it. , don't know how use pointer. not in programming. can please guide me this..!! to make clear, giving array input in aes implementation in c. in code have, there 10 hexadecimal numbers input, have try large inputs 8 mb, 16 mb, 32 mb , 64 mb. i tried code , started implementing on simple array. code following: #include <stdio.h> void main() { char a[10]; int i,j,k; for(i=0;i<2;i++) { j=4*i; printf("%d\n",i); printf("%d\n",j); { a[j]=...

Running CeWL with Ruby -

i'm trying run ruby program called cewl . i've added of required gems. when try , open .rb using ruby.exe displays message missing url agrument (try --help) , when try run on start cmd ruby or start cmd ruby on rails following: cewl 5.0 robin wood (robin@digininja.org) (www.digininja.org) c:/railsinstaller/ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb: 36:in `require': cannot load such file -- ./cewl_lib (loaderror) c:/railsinstaller/ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custo m_require.rb:36:in `require' c:/users/owner/desktop/cewl/cewl.rb:90:in `<main>'

c - Sorting linked list average at end -

i have write function sorts list in specific way, have singly linked list of ints , have find average of numbers in list , put nodes above average @ end of list. can't create new list have work on given list. how can accomplish it?i have this? calculate average find node above average save data inside , delete malloc newnode , add data newnode , link end of list repeat? is method right? somehow unlink given node , add @ end of list deleting , re-creating aren't needed?

javascript - Google charts: Remove space between in boxes in bars of histogram -

Image
how remove white space in each bar ? var options = { title: ' annual disbursement chart', 'titletextstyle': { color: 'black', fontsize: 10, bold: true }, 'vaxis': {'title': 'number of values' }, 'haxis': {'title': 'annual disbursements',baselinecolor: 'black'}, legend: { position: 'none' }, width: 300, };

php - Yii Full month name in CGrivView -

i have smth array( 'name'=>'date', 'type'=>'date', 'value'=>'date("m j, y", $data->date)', ), and it's showing date in format year/month/day in numbers, want full name of month : 10 september 2014. searched internet, nothing me problem.. try array( 'name'=>'date', 'type'=>'date', 'value'=>'yii::app()->dateformatter->formatdatetime(cdatetimeparser::parse($data->date, "yyyy-mm-dd"),"medium",null)' ), edit: tested code: have tested code may you. <?php $date=date('yyyy-mm-dd'); $form=yii::app()->dateformatter->formatdatetime(cdatetimeparser::parse($date, "yyyy-mm-dd"),"medium",null); cvardumper::dump($form,100,true); die(); ?> it returns me 'feb 1, 2014'

r - Finding and counting audio drop-outs in an ecological recording -

i trying assess how many audio drop outs in given sound file of ecological soundscape. format: wave samplingrate (hertz): 192000 channels (mono/stereo): stereo pcm (integer format): true bit (8/16/24/32/64): 16 my project had 2 element hydrophone. elements different brands/models, , trying determine element preformed better in our specific experiment. 1 analysis conduct measuring how each element had drop-outs, or loss of signal. these drop-outs not signal amplitude related, in other words, drop-outs not caused maxing out amplitude. element or associated electronics failed. i've been trying in r, program familiar with. have limited experience matlab , regex, opening trying programs/languages. i'm biologist, please excuse ignorance. in r i've been playing around package 'seewave', , while i've been able produce pretty spectrograms (which, fair, context i've used package). attempted use envelope , automatic temporal measurements fu...

deployment - Installer for ISDeploymentWizard.exe -

Image
is aware of installer (msi or otherwise) drops ssis deployment wizard executable (isdeploymentwizard.exe) onto server (generally found in c:\program files (x86)\microsoft sql server\110\dts\binn). have web server (we use our tfs agent) want deploy our ssis 2012 packages - vanilla server (with iis, .net, etc) , hence don't want blown install of ssis and/or vs2012 (ssdt) deploy ssis packages. i realise can use t-sql (which requires instance level perm'd user openrowset bulk import used) and/or mom deploy ssis packages remote sql server 2012 instance preference use ssis deployment wizard i have thought isdeploymentwizard.exe have been part of sql server 2012 feature pack ( http://www.microsoft.com/en-us/download/confirmation.aspx?id=35580 ) unclear whether case , indeed msi belong to i needed same isdeploymentwizard.exe on our build server. didn't want full installation of sqlserver on build box. using iso (en_sql_server_2012_developer_edition_with_sp1_x64_...

mysql - Can I get GROUP_CONCAT with COUNT() on multiple columns from the same table? -

i have following table: create table entries( `id` int unsigned auto_increment, `level` int unsigned, `type` char(2), `attribute` int unsigned, primary key(id) ); from table, i'm doing same query 3 different columns: select level, count(*) entries group level; select type, count(*) entries group type; select attribute, count(*) entries group attribute; i know can use group_concat distinct entries each of these in single sql call: select group_concat(distinct level) levels, group_concat(distinct type) types, group_concat(attribute) attributes entries; but can manipulate query include counts? or there different way can distinct values , counts these columns in single call? edit: here's data add table insert entries (level, type, attribute) values (1, 'va', 5), (1, 'cd', null), (null, 'va', 3), (null, 'cd', null), (1, 'va', 1); and sample output levels level_counts types types_counts attributes att...

ruby - rails destroy scaffold leaves back table -

i created new scaffold using command: rails generate scaffold level but destroyed using command rails destroy scaffold level and again added using command rails generate scaffold level question:string answer:string prev_q:integer next_q:integer but when try rake db:migrate following error sqlite3::sqlexception: table "levels" exists: create table "levels" ("id" integer primary key autoincrement not null, "question" varchar(255), "answer" varchar(255), "prev_q" integer, "next_q" integer, "created_at" datetime not null, "updated_at" datetime not null) my migrate/create_level.rb is class createlevels < activerecord::migration def change create_table :levels |t| t.string :question t.string :answer t.integer :prev_q t.integer :next_q t.timestamps end end end but schema.rb is: create_table "levels", :force => true |t| t.datetime "crea...

oracle - SQL - Joining multiple tables? -

i'm trying join multiple tables create list of purchase orders total cost. have tried following select statement returns error of "'oa'.'aircraft_code' invalid identifier" select al.airline_code “airline code”, po.purchase_order_no “order number”, ac.aircraft_code “aircraft code”, oa.aircraft_quantity “quantity of aircraft ordered”, sum(oa.aircraft_quantity * ac.aircraft_price) “order total” aircraft ac, airline al, ordered_aircraft oa, purchase_order po join airline al on po.airline_code = al.airline_code join aircraft ac on oa.aircraft_code = ac.aircraft_code join purchase_order po on oa.purchase_order_no = po.purchase_order_no group po.purchase_order_no order al.airline_code asc; the database structure follows: aircraft name null? type ----------------------------------------- -------- ---------------------------- aircraft_code not null varch...

xmpp - ProcessMessage function is not workin in smackapi -

i trying use smack api provide chat functionality between 2 different projects. both side able send message. due problem not able receive message on both side. think process-message function not working properly. how make work properly. my xmppconnection.debug_enabled = true; working properly, can see message sent , received via google talk. can process received message..thank in advance... public void processmessage(chat chat, message message) { if (message.gettype() == message.type.chat){ system.out.println(chat.getparticipant() + " says:" + message.getbody()); string cmdmsg = message.getbody(); system.out.println(cmdmsg); }

python - Win32 Toolbar Handle -

this should simple question i'm new python , win32 , can't seem find answer this. i'm using python win32gui library , want know how retrieve handle toolbar in window. say have notepad.exe open , want access "file" "edit" etc. buttons in toolbar, how do , how handle toolbar begin with? notepad not have toolbar. notepad has menu. you can retrieve handle of menu associated window using getmenu .

c# - Changing the text of the button (at runtime) -

this question exact duplicate of: showing dynamic text in silverlight 1 answer i have button shows "click me!" on it. want see after clicking, shows "do not click on me!" permanently. i below error message in buttonname_click() function , not know how resolve (i have spent time on it). the name 'buttonname' not exist in current context i attaching search.xaml , search.xaml.cs in question. <sdk:page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:i="http://schemas.microsoft.com/expression...

Is there a file type for APL programs? -

is there way open text editor, type apl code, save file, , open in dyalog or microaplx execute code? or workspaces are? apl invented before widespread availability of file systems , text editors. therefore provided own facilities store , edit code (functions) , data, namely workspaces , component files. commercial apl systems of today still provide them, continuity existing installations , developer expertise. but facilities date half century ago , designed hardware , interfaces of time (mainframes , teletypes) modern hardware hand crank telephones smartphones. nowadays developers argue code best kept in (utf-8 encoded) text files, edited one's text editor of choice , , managed distributed version control system. subscribe view. some of classical apl vendors have kept offers "up date" in regard , provide facilities deal source code files, in manner not disjoint workspaces. dyalog apl has such library called salt - simple apl library toolkit . but trut...

arrays - Portable Mode Function in Visual Basic -

i'm trying make mode function accept arrays of type, , i'm not making progress. here's i've got now: private function mode(byref list object) object dim array() object = {} try array = ctype(list, object()) catch ex exception messagebox.show("failed cast array of objects in mode function!") return nothing end try dim uniqueobjects() integer = {array(0)} dim frequency() integer = {1} integer = 0 array.length - 1 j integer = 0 uniqueobjects.length - 1 'loop through frequency if array(i) = uniqueobjects(j) frequency(j) += 1 exit elseif j = uniqueobjects.length - 1 redim preserve uniqueobjects(uniqueobjects.length) 'add unique objects array uniqueobjects(uniqueobjects.length - 1) = array(i) redim preserve frequency(f...

c# - Why use separate load methods instead of the constructor? -

opentk has separate load() method calls when game has load. xna , monogame take step further , have constructor, initialize , loadcontent. seems me programmer using framework confused when i'm supposed load in , can't 100% sure class initialized when it's constructed. reason done? there reason xna has constructor, initialize, , loadcontent(). when create new game, such in static class program { static void main() { using (game1 game = new game1()) { game.run(); } } } game1's constructor called , takes care of pre-initialize tasks, such graphics = new graphicsdevicemanager(this); content.rootdirectory = "content"; components.add(new gamecomponent()); and setting class's properties. can use constructor would. after constructor called, game.run() method called. start game , call initialize method. in above program , once game.run() called, several things...

documentation - Is there an API to upload WADL files into my Apigee Console ToGo Account? -

something similar api gateway, through management api enables deployment of api bundles in it, uploading wadl file doesn't require going through ui every time there's change , uploading console becomes curl command away, automated deploying via scripting languages. also, there way create more 1 console per account? far, i've been able create 1 console togo 1 account per user under apigee edge. we working on supporting multiple consoles per account. should available in next month's release. as api update wadl, have undocumented api change next month's release. short answer should have api in next month's release.

javascript - mirrors in dart not working for all elements -

i using reflection (aka dart:mirrors) in dart. first: code seen here works in dartium (with dart native) partially when compiled dart2js , run in chrome. i have class called binaryreader reads class bytestream. here code (stripped repetitive part) so: void readobject(dynamic obj) { var inst = reflect(obj); inst.type.declarations.foreach((symbol name, declarationmirror decl) { if(decl variablemirror) { var variable = decl; if(variable.metadata.length == 0) { return; } instancemirror attrib = variable.metadata.first; if(attrib.hasreflectee == false) { return; } if(attrib.reflectee field) { var field = attrib.reflectee field; var value; switch(field.type) { case i8: value = getint8(); break; // ... case v3: value = new vector3(getfloat(), getfloat(), getfloat()); br...

visual c++ - How to convert local time to Argentina time? -

i want draw 4 analog clocks. first basis on iran time, second : argentina time, third: brazil time , fourth: france time. system's time (basis iran's time) , show on analog clock. don't know how 3 others time , show them. glfloat h,m,s; time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); can me? you didn't specify language, guessing using c++. if case can use gmtime function explained here utc time , add adjust hour adding utc offset argentinia (timeinfo->tm_hour = -3 or whatever correct syntax is)

image - print a specific div using javascript code -

i'm trying make printing code in javascript (asp.net) use code print specific div : <script> function callprinting(temp) { var prtcontent = document.getelementbyid(temp); var winprint = window.open('', '', 'letf=400px,top=100px,width=800px,height=500px,toolbar=0,scrollbars=1,status=0,'); winprint.document.write(prtcontent.innerhtml); winprint.document.close(); winprint.focus(); winprint.print(); winprint.close(); } </script> <div id="print"> <img src=" [some source] " alt="" /> </div> <asp:button id="button1" runat="server" text="print" onclientclick="callprinting('print')" /> i make template paper , need print ... put problem image didn't appear in printing ... 'alt' appear alternative any suggest ?