Posts

Showing posts from July, 2011

c# - Upload a File from HTML form using PostAsync -

i want upload file server using webapi. want call webapi in mvc homecontroller. when use webapi directly uploads files when want call webapi within controller using postasync, not send file api reason. this action in mvc controller: public async task<actionresult> upload(httppostedfilebase upload) { viewbag.title = "upload files"; if (upload != null && upload.contentlength > 0) { var client = new httpclient(); string fullurl = request.url.scheme + system.uri.schemedelimiter + request.url.host + ":" + request.url.port + "/api/values"; stringcontent httpcontent = new stringcontent(upload.filename); var response = await client.postasync(fullurl, httpcontent); var result = await response.content.readasasync<httpresponsemessage>(); } return view(); } this .cshtml file: <form name="form1" method="

ios - How to pass error param in SWIFT with saveInBackgroundWithTarget -

i have use currentemployer.saveinbackgroundwithtarget(self, selector: "reloaddata") to reload tableview. call works, described in docs, can pass error parameter function listed in selector check whether failed. how can pass error parameter reloaddata function? kind regards sebastian it looks saveinbackgroundwithtarget:selector: deprecated, since it's no longer in the pfobject documentation . try saveinbackgroundwithblock: instead: currentemployer.saveinbackgroundwithblock { succeeded, error in if succeeded { self.reloaddata() } else { // handle error. maybe this: self.showalertwitherror(error) } }

ios - iPhone app version number in X.01 -

can not upload app version x.01 in apple store. automatically changing x.1. have current version x.0 live in apple store. have minor update app changed version x.01 , uploaded in itunes connect. automatically changed x.1 after processing it. please help. zeros before numbers after point ignored. (ie : x.00001 = x.1) what want version x.0.1.

python - Longitude and Latitude formula complimenting it -

from math import radians, cos, sin, asin, sqrt def haversine(lon1, lat1, lon2, lat2): lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) dlon = lon2 - lon1 dlat = lat2 - lat1 = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 c = 2 * asin(sqrt(a)) km = 6367 * c return km home = input('please enter airport wish fly using given names eg bgbw') if row[3] or row[7] == home: print(row[6] , row[7]) *i got formula here unsure of how implement it, when print row 6 , row 7 prints longitude , latitude, maths not strong point have never seen formula before think struggling *

c++ - Templated function in untemplated class -

i want create templated function in class not templated. class theclass { template<typename t> int dosomething(t thing); } template<typename t> int theclass::dosomething(t thing) { .... } i don't know why getting error "member not found" when declare outside of class. in c++ classes default member variables , methods private unless given "public:" keyword. if you're trying declare/initialize theclass , use dosomething method outside of class need make accessible. making public simplest way make method accessible, there other ways. missing semicolon @ end of class definition mentioned in comments. else looks fine. here's working example. #include <iostream> class theclass { public: template<typename t> int dosomething(t thing); }; template<typename t> int theclass::dosomething(t thing) { std::cout << "dosomething(t thing)\n"; return 0; } in

Visual C++ Library for converting set of images to a video without using Opencv -

i working on project in visual c++. have 10 20 images (.jpeg) in directory , wanted convert video of format (.avi/.mp4) in images shown after specified interval. using visual c++ (microsoft visual studio 2010). please me. if provide source code, helpful. don't want use opencv. please suggest other available libraries along information it. (in short, alternative library opencv?) you can using directshow . take @ following sample: https://msdn.microsoft.com/en-us/library/dd377481(vs.85).aspx

java - Compiler Code(s) Errors? -

this question exact duplicate of: how fix following compile code errors? [closed] i have still having trouble compiling code(s), since following 4 errors showing up. thus, prevents me being able run code , have desired output. here 4 errors: error 1: solver.java:29: error: method breadthfirstsearch in class searchmethods cannot applied given types; sm.breadthfirstsearch(adjmatrix, 0); ^ required: boolean[][],int,boolean[] found: integer[][],int reason: actual , formal argument lists differ in length error 2: solver.java:34: error: method depthfirstsearch in class searchmethods cannot applied given types; sm.depthfirstsearch(adjmatrix, 0); ^ required: int[][],int[],int,int found: integer[][],int reason: actual , formal argument lists differ in length error 3: searchmethods.java:64: error: cannot find symbol queued qd = new queued(); ^ sy

xml - XSLT 2.0 if condition -

need on xslt 2.0 transformation. input xml : <employee> <post>manager</post> </employee> pseudo code : if(employee/post = 'manager') associate/high = 'band' else associate/low = 'band' output xml : <associate> <high>band</high> </associate> <associate> <low>band</low> </associate> construct element dynamically xsl:element . other that, pseudo code pretty accurate. xslt stylesheet <?xml version="1.0" encoding="utf-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="2.0"> <xsl:output method="xml" omit-xml-declaration="yes" encoding="utf-8" indent="yes" /> <xsl:template match="employee"> <associate> <xsl:element name="{if (post = 'manager') 'high' else 'low'}"

c# - Datatable select value where field type is unknown or at run time -

i have simple linq query linqdt.asenumerable() .where(w => (w.field<string>(options.selectedcolumn)).contains(options.value)) .copytodatatable(); this return me result if selectedcolumn type of string (a.field). problem option.selectedcolumn of multiple types. of byte, date, guid etc etc , don't know these types until run time. i wondering if there way can pass variable w.field , variable contains datatype based on selectedcolumn? if no, other possibilities? any highly appreciated since contains applies string values, use if statement check string values, , use non-generic column accessor , equals other columns: datatable result; if(linqdt.columns[options.selectedcolumn].datatype == typeof(string)) result = linqdt.asenumerable() .where(w => (w.field<string>(options.selectedcolumn)) .contains(options.value)) .copytodatatable(); else result = linqdt.

ember.js - ember-cli how to instantiate a view from within a controller -

Image
i building map single page app. able add or remove objects map retrieved geojson data. some of these objects presented <div> these objects therefore not generated form template need instantiated somewhere else. i've been thinking of controller in charge of parsing geojson data. what have done far? view //app/views/map-popup.js import ember 'ember'; export default ember.view.extend({ templatename: "mappopup", classnames: ["map-popup"] }); template // app/templates/map-popup.js <a class="popup-closer" {{action 'closepopup'}}></a> <div class="popup-header">{{header}}</div> <div class="popup-content">{{body}}</div> controller //app/controllers/map-popup.js /** * created alex on 13/04/2015. */ import ember 'ember'; export default ember.objectcontroller.extend({ needs: ['map'], feature: null, header: null, body: null, overlay:

javascript - Can I use selectAll to create new element when elements of same type already exist? -

i want use 2 different data sources add g elements svg . however, end binding second data source existing g elements rather creating new g elements. here's example <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> </head> <body> <div id="body"></div> <script type="text/javascript"> var canvas_w = 1280 - 80, canvas_h = 800 - 180; var svg = d3.select("#body").append("div") .append("svg:svg") .attr("width", canvas_w) .attr("height", canvas_h) var category_cells = svg.selectall("g") .data([0, 1, 2]) .enter().append("g") .attr("class", "category") .attr("

dictionary - trouble with nested try except in python 3.3 -

the problem i'm having if exception thrown first try, seems treat if try statements under except block returned exception. if player.classname[0] != 'undetermined': if (player.classname[1] != 'undetermined') , (player.classname[2] != 'undetermined'): in player.abilities: try: overlist[player.classname[0]][player.classname[1]][player.classname[2]]['abilities'][i.name].process_ability(i) except: try: overlist[player.classname[0]][player.classname[1]]['abilities'][i.name].process_ability(i) except: try: overlist[player.classname[0]]['abilities'][i.name].process_ability(i) except: print("ability: "+i.name+" not found in ability index "+player.classname[0]+"/"+player.classname[1]+"/"+player.classname[2])

mysql - How to Python Pandas Dataframe outputs from nested json? -

i'm python beginner. below 'steps_detail' data that; >>> steps_detail {u'activities-calories': [{u'value': u'1240', u'datetime': u'2015-04-13'}], u'activities-calories-intraday': {u'datasettype': u'minute', u'datasetinterval': 1, u'dataset': [ {u'mets': 10, u'time': u'00:00:00', u'value': 0.8396000266075134, u'level': 0}, {u'mets': 10, u'time': u'00:01:00', u'value': 0.8396000266075134, u'level': 0}, {u'mets': 10, u'time': u'00:02:00', u'value': 0.8396000266075134, u'level': 0}, {u'mets': 10, u'time': u'23:58:00', u'value': 0.8396000266075134, u'level': 0}, {u'mets': 10, u'time': u'23:59:00', u'value': 0.8396000266075134, u

javascript - Highcharts Solid Gauge only want to show 1 data label -

i'd use highcharts in project of mine having trouble javascript i'm new language. i've got current chart customized exception of data labels overlapping each other because there more 1 element in data array. // speed gauge $('#container-speed').highcharts(highcharts.merge(gaugeoptions, { yaxis: { min: 0, max: 200, title: { text: 'speed' } }, credits: { enabled: false }, series: [{ name: 'speed', data: [160, 50], datalabels: { format: '<div style="text-align:center"><span style="font-size:25px;color:' + ((highcharts.theme && highcharts.theme.contrasttextcolor) || 'black') + '">{y}</span><br/>' + '<span style="font-size:12px;color:silver">km/h</span></div>' }, tooltip: {

digital logic - How to find period of the clock pulse with frequency. -

for example: period 10ms , need find frequency this: f= 1/t = 1/10ms = 100hz because (10ms=.01 seconds, 1/.01=100) i understand when changes larger unit such ghz confused. example: if frequency of clock pulse 2ghz, period of clock pulse? my thoughts: f= 2ghz= 2 000 000 000hz t= 1/f = 1/2 000 000 000?? somehow doubt close answer. explain 1 me? million. the period correct calculated it. p = 1/f p = 1/2ghz = 1/(2×10^9) p = 0.0000000005s (second) p = 0.0000005ms (millisecond) p = 0.0005us (microsecond) p = 0.5ns (nanosecond) p = 500ps (picosecond) another way @ 2ghz 2×10^7 times faster 100hz period should 2×10^7 times shorter 2ghz/100hz = 2×10^7 10ms/(2×10^7) = 500ps

multithreading - Controlling number of Threads for ManagedExecutorServices / Java EE 7 -

in java se 1 can use constructs executorservice es1 = executors.newsinglethreadexecutor(); executorservice es2 = executors.newfixedthreadpool(10); to control number of threads available executor service. in java ee 7 it's possible inject executor services: @resource private managedexecutorservice mes; but how can control number of threads available managed executor service ? example, in application i'm writing, there executor service has executed in single thread. can't let platform choose preferred number of threads. actually, setting should set in server settings, through admin console (in glassfish example), or during creation of service: asadmin create-managed-executor-service --corepoolsize=10 --maximumpoolsize=20 concurrent/mes see create managedexecutorservice, managedscheduledexecutorservice, managedthreadfactory, contextservice in glassfish 4 .

html - How to call different images with CSS -

i creating industry section, 1 seen in https://squareup.com i started using nth-of-type call different images in css. http://cssdeck.com/labs/full/vinttbws however, doesn't work when not in same parent. how can work? is there way accomplish without having make div class each industry image? you're right, nth-of-type won't work because don't share same immediate parent. i highly recommend suggesting making new class each one. you give each parent different id , css selector ask child: #restaurant > { background-image:url(some/picture.jpg); } #retail > { background-image:url(some/other/picture.jpg); } i've made bit of example here(with colors instead of pictures): http://jsfiddle.net/mo9yazjm/ edit: made change cssdeck example: http://cssdeck.com/labs/t4xnpzgf

angularjs - How to force Firefox to bypass BFCache for Angular.JS partials? -

Image
i'm working on angular.js page , making changes html 'partial'. refreshing page causes firefox correctly re-request main html page server, subsequent 'partial' templates rendered client-side never re-requested , instead grabbed bfcache, changes files aren't detected. screenshot firebug: i can confirm via development server (django) partials never requested. i've tried every kind of refresh, including reload plus extension. these less ideal, 2 options appear address problem. one clear cache addon, can configured clear disk , memory cache , reload current tab. i'm not sure if clears cache or current tab's domain, it's entire cache. the other disable browser cache in firebug: i'm not sure if disables cache current page, current domain, or everywhere. it'd still nice have 'reload page , referenced page' option.

c++ - SDL2 Image to screen issue -

i've been on hunt trying figure out how execute properly. i've been having trouble finding documentation on sdl (if has necessary goto love check out). so, after finding out sdl_flip , sdl_setvideomode extinct while amidst in lazy foo's tutorials , finding out it's windows now. can't seem image screen still. i'm new sdl (obviously). so, compiles fine. i'm compiling in source directory image.bmp located, reason image pointer returns null , blank screen when program executes. one more thing. error sdl_geterror : "passed null surface". because ever reason image returning null or can't opened? here source: #include "sdl2\sdl.h" #include <stdio.h> #include <stdlib.h> int main(int argc, char* args[]){ sdl_surface *image = null; sdl_window *window = null; sdl_surface *screen = null; sdl_init(sdl_init_video ); window = sdl_createwindow( "img.cc", sdl_windowpos_undefined, sdl_windowpos_undefined, 640, 4

angularjs - dynamic position custom popover based on the page height -

i have ui-bootstrap-custom-0.12.1.js popover default position set "top", if popover @ top default cannot view content in popover. there way dynamic position popover bottom?. <div class="pagination-centered"> <h2>title: {{item.title}}</h2> <div popover="patienthover" popover-title="item.title" popover-placement="top" popover-trigger="click"> <button class="btn">{{text}}</button> </div> </div> here plunker link [popover position top][1] http://plnkr.co/edit/oq9xia2dmw1tgnyznckd?p=preview the popover-placement tag takes string argument instead of javascript. however, can pass javascript tag (and implement logic of own determines placement) so: popover-placement="{{$scope.dynamicpopoverfunction(args)}}" this allow call function in scope , return placement desire.

javascript - Dynamic orderBy in AngularJS -

i have array of objects want order dynamically, based on value drop down menu. have far in list: ng-repeat="item in filtereditems = (items | filter:searchinput | orderby:canbeanything)" but problem sorting can attribute of object or calculated value using function. should able sort in descending way (optionally). i know can use string canbyanything variable behind orderby passing attribute of object like: “-creationdate” // descending ordering on creation date “customer.lastname” // ascending ordering on customers last name i know can orderby function like: orderby:mycalculatedvaluefunction // order in ascending way based on calculated value, example calculating total price of object if order or but don't know , want achieve is: how combine can use function(s) sorting in combination attributes/properties of objects. mean 1 or other, dynamically, based on user has selected. can attribute or calculated value, either descending or ascending. how sort ca

javascript - How can I process all the HTML tags in a document without blocking? -

i'm working on chrome extension gives users ability manipulate appearance of websites based on simple rules site content. problem have scan , classify every tag in document, potentially slow process. i'm looking way without blocking page rendering , slowing down user's experience much. right content script looks this: function init() { tagobserver = new mutationobserver(function(mutations, obs) { for(var i=0; i<mutations.length; ++i) { for(var j=0; j<mutations[i].addednodes.length; ++j) { var newtag = mutations[i].addednodes[j]; if (newtag.queryselectorall) { array.prototype.foreach.call( newtag.queryselectorall('*'), testtags); } } } }); array.prototype.foreach.call( document.queryselectorall('*'), testtags); tagobserver.observe(document.documentelement, { childlist: true, subtree: true }); } function testtags(tag) { sleep(5); tag.style

php - Date in MySQL Laravel ORM -

i store dates in timestamp type (and see in phpmyadmin simple 2015-04-14 00:00:00 ). stupid? better way set int type , save unix time? how can query select * `values` `time` < $mytimeinunix because model::all()->where('time','<',$mytimeinunix) not working. regards you're looking unix_timestamp : model::where(db::raw('unix_timestamp(time)'), '<', $mytimeinunix)->get();

c# - whitch Regex can i use to split XML string before and after mathml match -

Image
i ask regex can use in order splits text string <math xmlns='http://www.w3.org/1998/math/mathml'>....</math> the result be: the code is: var text = @"{(test&<math xmlns='http://www.w3.org/1998/math/mathml'><apply><plus></plus><cn>1</cn><cn>2</cn></apply></math>)|(<math xmlns='http://www.w3.org/1998/math/mathml'><apply><root></root><degree><ci>m</ci></degree><ci>m</ci></apply></math>&nnm)&<math xmlns='http://www.w3.org/1998/math/mathml'><apply><power></power><cn>1</cn><cn>2</cn></apply></math>#<math xmlns='http://www.w3.org/1998/math/mathml'><set><ci>l</ci></set></math>}"; string findtagstring = "(<math.*?>)|(.+?(?=<math/>))"; regex

excel - Duplicating VLOOKUP macro in multiple sheets -

i recorded macro vlookups sheet "p&l" (the first tab holds of data) , filters down in current sheet until data in column runs out. works; however, need code function remaining sheets. these updated monthly. there different number of inputs in column in each sheet. these id #s i'm using vlookup information p&l tab. when wrote macro foorloopindex, keep getting "compile error: invalid or unqualified" messages. i not have experiences macros -- i'm struggling find error. sub update_gp_profits() dim startindex, endindex, loopindex integer startindex = sheets("p&l").index + 1 endindex = sheets("sheet4").index - 1 loopindex = startindex endindex lastrow = .range("a" & .rows.count).end(xlup).row .range("b2:b" & lastrow).formula = "=+vlookup(rc[-1],'p&l'!r15c3:r29702c4,2,false)" range("c2").select .range("c2:c" & lastrow).formula = "=+vlo

python - Grouping and filtering data -

dataframe: protein peptide mean intensity a1 aab 4,54 a1 abb 5,56 a1 abb 4,67 a1 aab 5,67 a1 abc 5,67 a2 abb 4,64 a2 aab 4,54 a2 abb 5,56 a2 abc 4,67 a2 abc 5,67 but need find every protein top 2 (most frequent) peptides output a1 : protein peptide mean intensity a1 aab 4,54 + 5.67 / 2 abb 5.56 + 4.67 / 2 a2 abb 7,42 abc 5,17 so problem needs stay dataframe. first, can perform groupby/apply operation obtain protein/peptide pairs 2 largest peptide counts each protein: counts = (df.groupby(['protein'])['peptide'] .apply(lambda x: x.value_counts().nlargest(2))) counts = counts[counts >=

function declaration with STL in header c++ -

i pretty new concept of splitting program header , etc. normally, goes ok, in case have whole bunch of errors if try next: suppose have .cpp file: #include <iostream> #include <string> #include <map> #include <algorithm> #include <vector> #include "header.h" using namespace std; int main() { //some code here } map <char, char> create(vector <char> &one, vector <char> &two) { //some code here } vector <char> conc(string phrase) { // code here } vector <char> result(vector<char> three, map <char, char> code) { // code here } in header.h have: map <char, char> create(vector <char> &one, vector <char> &two); vector <char> conc(string phrase); vector <char> result(vector<char> three, map <char, char> code); which function declarations.. if put them in .cpp program works great, if in header.h - not. you, please tell m

python - LU decomposition with pivoting in numpy -

i can't find what's wrong attempt @ implementing lu decomposition partial pivoting pseudo-code here (page 6) . code pasted below. can spot problem? def lupdecomposition(matrix): n, m = matrix.shape assert n == m, "lu decomposition applicable square matrices" l = np.identity(n) u = matrix.copy() p = np.identity(n) k in range(n-1): # pivoting: index of maximum in k-th column on diagonal or below index = np.argmax(abs(u[k:,k])) index += k # pivoting: permute rows if index != k: u[[index,k],k:n] = u[[k,index],k:n] p[[index,k]] = p[[k,index]] if index > 0: l[[index,k],0:(k-1)] = l[[k,index],0:(k-1)] # calculating next column in l , modifing rows in u j in range(k+1,n): l[j,k] = u[j,k] / u[k,k] u[j,k:] -= l[j,k]*u[k,k:] return l,u,p

android - Searching the Server IP on Client instead of inputing -

server: pc client: android so client/server app consists in opening webpages , executing bot, fine if use router, able to connect in different places (different router/pc). searching "wi-fi search of ip" , got nothing. possible give server side fix ip? 192.168.1.68? client code public class androidclient extends activity { edittext episode; spinner spinner1; string result; button buttonconnect, buttonclear; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); episode = (edittext) findviewbyid(r.id.episode); buttonconnect = (button) findviewbyid(r.id.connect); buttonclear = (button) findviewbyid(r.id.clear); spinner1 = (spinner) findviewbyid(r.id.animes); arrayadapter<charsequence> adapter = arrayadapter.createfromresource(this, r.array.anime, android.r.layout.simple_spinner_item);

ios - Does a personal VPN created with NEVPNManager affect other apps? -

i've found few articles online such this one discuss using new networkextension.framework in ios 8 , it's corresponding nevpnmanager class create custom vpn configurations programatically. it's implied these configurations affect app, , not other things in background, i've been unable find definitive. code references various things names sharedmanager it's not obvious. so, if create vpn programatically nevpnmanager , connect within ios app, affect other apps and/or background services? we're using nevpnmanager connect vpn, limits internet connectivity. apps on device fail connect services, when our vpn connected. however, system services (like apns) still working somehow.

linux - Programatically edit hyperlinks inside a PDF -

i trying find way programatically edit links inside generated pdf. stack node.js open kind of tech believe can this. doing searches around on stackoverflow , other websites lead me things debenu's pdf library not opensource solution , .net solution. doing strings on 1 of own pdfs shows me kind of strings : # strings mypdf.pdf | grep tfoureur -c2 -- 61 0 obj <</ismap false/s/uri/uri(http://stack.im/tfoureur)>> endobj -- i not know if clean solution walk binary searching these strings , edit them in place. not know if standard format , work time or not. do recommend particular approach ?

angularjs - ui-view wont render nested content -

i've linked plnkr here http://plnkr.co/edit/kuyw1shikwz9wzvmoo5k?p=preview on addproducts tab, want load nested states in ui-view. .state("productedit", { abstract: true, url: "/products/edit/:productid", templateurl: "producteditview.html", controller: "producteditctrl vm", resolve: { productresource: "productresource", product: function(productresource, $stateparams){ var productid = $stateparams.productid; return productresource.get({productid: productid}).$promise; } } }) .state("productedit.info",{ url:"/info", templateurl: "producteditinfoview.html" }) .state("productedit.price",{ url:"/price", templateurl: "producteditpriceview.html" }) producteditinfoview.html has form controls, expect load in producteditview page, not visible what

wordpress - Adding a Select Field to PHP form -

i following this tutorial , going , works brilliantly. i've been able change , add relevant fields need... except one. trying add 'select' field visitors can select inquiry type list. i've attempted few different ways, literally no experience in php i'm finding difficult. could give me guidance towards how so? thanks much. pretty bad tutorial horrific code just add <select> inside form. style css. echo '<form action="' . esc_url( $_server['request_uri'] ) . '" method="post">'; echo '<select><option>option 1</option><option>option 2</option><option>option 3</option></select>'; echo '<p>'; this better code: $uri = $_server["http_host"] . $_server['path_info']; $cf_name = htmlspecialchars( $_post["cf-name"] ) ; $cf_email = htmlspecialchars( $_post["cf-email"] ); $cf_subject = htm

Return value EOF of scanf in C -

scanf in c language, little confused return value. in instruction, says: eof returned if end of input reached before either first successful conversion or matching failure occurs. eof returned if read error occurs, in case error indicator stream set. first, not sure mean if end of input reached before first successful conversion or before matching failure occurs. how possible? second, not sure difference between read error , matching failure? first, not sure mean if end of input reached before first successful conversion or before matching failure occurs. how possible? imagine you're trying read character file , you're @ end of file. end of input reached before successful conversion or matching attempt takes place. second, not sure difference between read error , matching failure? a read error means unable read data file . matching failure means able read data didn't match expected (for example, reading a %d .)

java - Spring Data Repository (JPA) - findByXXX using entity relation -

a schedule entity has 1 one relationship market entity other "simple" properties. here schedulerepository: @repositoryrestresource(path = "schedule") public interface schedulerepository extends jparepository<schedule, long> { collection<schedule> findbymarket(market market); } "findbymarket" method works fine when invoking method programmatically. however, when invoking directly web application ( http://localhost:8080/schedule/search/findbymarket ), request type must get. my question how pass market json object using get? using post wouldn't issues findxxx methods must use get. tried passing like: ?market={marketid:60} in querystring no avail. not knowing controller looks like, assume if wanted pass marketid on like. ?marketid=60 and method like. method use handle converting , json. @get @path("/query") @produces({"application/xml", "application/json"}) public todo whateverna

sql - Oracle query : Missing Keywords/parenthesis -

i executing sql queries in unix. didn't identify error in query. create table flights ( route_id number(10) not null, depart_timestamp timestamp time zone not null, arrive_timestamp timestamp time zone not null, base_price_usd number(17,2) not null check (base_price_usd > cast(0.0 clob)::money), status_id integer not null, primary key (route_id, depart_timestamp), foreign key (route_id) references routes(route_id), foreign key (status_id) references route_statuses(status_id) ); error @ line 2: ora-00905: missing keyword ora-00907: missing right parenthesis ok, posting anwser: 1) make check constraint check base_price_usd > 0 2) timestamp time zone data types can't used primary keys. 3) timestamp time zone implemented in oracle 10g. since you're using oracle 8, won't work there. use date type. i guess add column store time zone. varchar2 , store values 'gmt-6' or something, don't see worth since more recent vers

apache - Website keeps loading -

setup vagrant box (ubuntu 12.04 / nfs mount , performance purposes). apache version apache/2.2.22 (ubuntu) cakephp 3 project. vhost took here . <virtualhost *:80> servername www.kitchen.com serveralias www.kitchen.com kitchen.com documentroot /var/www/kitchen/webroot customlog /var/log/apache2/www.kitchen.com-access.log combined errorlog /var/log/apache2/www.kitchen.com-error.log options -indexes followsymlinks #disable htaccess starting @ / <directory /> allowoverride none </directory> <directory /var/www/kitchen/webroot/> rewriteengine on rewritebase / rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?url=$1 [qsa,l] <files sitemap.xml> rewriteengine off </files> </directory> </virtualhost> all .htaccess inside pr

c# - Problems with AnonymousType ASP.NET MVC -

i error , don't know how fix it, code: var respaldos = db.respaldoes.where(x => x.type == "backup"); if (con_filtro_fecha) respaldos = respaldos.where(x => x.start_time >= _desde && x.start_time <= _hasta); if (con_agrupacion) { switch (agrupar) { case "dia": respaldos = respaldos.groupby(x => new{ x.start_time.year, x.start_time.month, x.start_time.day }) .select(x => new{ anio = x.key.year, mes = x.key.month, dia = x.key.day, bytes = x.sum(y => y.bytes_processed) }).asenumerable(); break; case "mes": respaldos = respaldos.groupby(x => new{ x.start_time.year, x.start_time.month }) .select(x =&g

Checking if user input is an integer in c# -

this question has answer here: c# testing see if string integer? 9 answers so i'm making little text game, , need user enter integer when asks grid size. , if integer isn't entered want question asked again. right have: console.writeline("enter grid size."); int gridsize = int.parse(console.readline()); i need way check if input integer, , ask again if it's not. thanks you can use tryparse : var input = 0; if(int.tryparse(console.readline(), out input) { }

google api - Reference version conflict in nuget package - bindingRedirect doesn't seem to work -

the nuget package google.apis.auth adds reference in project google.apis.auth.platformservices , dll version nuget 1.9.1.12399 , seems google.apis.auth needs version 1.9.1.12397 instead can see in exception thrown below. i tried add <bindingredirect oldversion="1.9.1.12397" newversion="1.9.1.12399" /> app.config , machine.config won't work. this exception: system.io.filenotfoundexception: not load file or assembly 'google.apis.platformservices, version=1.9.1.12397, culture=neutral, publickeytoken=null' or on e of dependencies. system cannot find file specified. file name: 'google.apis.platformservices, version=1.9.1.12397, culture=neutral, publickeytoken=null' @ google.apis.auth.oauth2.googlewebauthorizationbroker.<authorizeasynccore>d__e.movenext() @ system.runtime.compilerservices.asyncmethodbuildercore.start[tstatemachine](tstatemachine& statemachine) @ system.runtime.compilerserv

android - Build gradle map box and google play services -

in android application, have function works gcm , use google_play_services_lib. now implementing mapbox maps, no google maps. i did various tests in separate project mapbox , perfect, when compile both dependencies, applicattion not runs. i think problem of dependencies between google play services , map box. here script , log. hope can me. thank you. build.gradle apply plugin: 'com.android.application' android { compilesdkversion 21 buildtoolsversion "21.1.2" packagingoptions { exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' } defaultconfig { applicationid "storecheck.com.storecheck2" minsdkversion 9 targetsdkversion 20 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro

spectrum - SciPy periodogram for finite-length signal -

i input finite-length signal periodogram function , power spectrum density. however, since signal has finite length, power spectrum density has sinc-like lobes. there implantation in scipy, can used de-couple sinc-like lobes can power spectrum density infinite version of finite-length signal?

java - Eclipse m2e plugin stopped changing classpath to add dependencies -

i have used m2e plugin in luna 4.4.1 while handling dependencies , worked fine. normally, create new java projects convert them maven project. i decided wanted start using standard maven directory layout, recent project created maven project , added eclipse java facet eclipse treat java project. this has broken maven, no longer making it's dependencies available new projects. normally, eclipse adds "maven managed dependencies" library project maven dependencies; new projects no longer , dependencies never added project classpath. projects had been working before still add , remove them normally. i have narrowed problem down .classpath error; reason m2e has stopped modifying project classpath make it's dependencies available. can work around manually copying , pasting entries working project find way "re-automate" correctly. i have sidestepped issue buckling down learn gradle.