Posts

Showing posts from April, 2013

json - How to do a SQL like INNER JOIN on multiple Python dictionaries -

i planning out django app allows users not build custom tables associated models (e.g., user create trivial custom "parking spot" table associated "employee" model without having edit models.py), build custom reports using custom tables. way can think having model stores custom table data in jsonfield (i'm using postgres backend works out great), , have reports model allows users build , save "sql-like" queries return joined datasets custom reports. i've figured out how store custom tables , use them in app, , have loose concept on how merge multiple json objects on pseudo foreign keys pulled custom reports, have gotten far creating one-to-one joins. with script below, if of dicts have multiple records on single foreign key last record used. have idea how can accomplish one-to-many join of multiple python dictionaries? if have these 3 datasets: employees = [{"id": 1, "user_id": 303, "name": "mike...

gruntjs - grunt-autoprefixer and grunt-postcss not working -

i have tried both plugins grunt-autoprefixer , grunt-postcss neither adding prefixes. have tried caniuse.com says requires prefix (cursor: grab). here autoprefixer task: autoprefixer: { dev: { no_dest: { src: 'dev/styles.css' } }, live: { no_dest: { src: 'live/styles.css' } } } and here postcss task: postcss: { dev: { options: { processors: [ require('autoprefixer-core')({browsers: 'last 1 version'}).postcss ] }, dist: { src: 'dev/styles.css' } } } could give try following grunt packages grunt-postcss autoprefixer-core and following snippet postcss: { options: { processors: [ require('autoprefixer-core')({browsers: 'last 1 version'})....

sql - Why does using "where rownum = 1" not select the first ordered row? -

this weird, use pair of spare eyes understand what's happening. so have query : with x ( select num_aula, tipo_aula, min(abs(capienza-1)) score aula join ( select num_aula, tipo_aula aula tipo_aula = 'laboratorio' minus select num_aula, tipo_aula occr_lezione to_char(data_inizio_occr_lezione,'hh24:mi') = '12:30' , nome_sede = 'centro direzionale' , giorno_lezione = 2 ) using(num_aula,tipo_aula) group num_aula, tipo_aula order score asc ) select * x wich return result set : num tipo_aula score --- -------------------- ---------- 1 laboratorio 35 2 laboratorio 35 wich desired result. now, if add line query : where row...

javascript - Resize image using Canvas awkward behavior -

Image
i want displayed, big image , resize drawing on canvas. i found following fiddle: http://jsfiddle.net/abdiassoftware/v8app/ exisitng this seems work great since want use resize images , store them later on. however, when try use uploaded images awkward behavior: result img: thanks link image: frankh.ursa.uberspace.de/img/34.png

How can I statically link a C++ library to a C application in OSX? -

i've looked through other similar questions topic, , think there's osx-specific i'm missing. i'm trying statically link basho's fork of leveldb c application (since packaged versions of leveldb use google's mainline). using c++ linker , adding -lc++ command line, still flooded errors missing c++ stl symbols such as: "std::string::_rep::_m_destroy(std::allocator const&)", referenced from: _leveldb_open in libleveldb.a(c.o) the strange thing is, know have c++ bits enabled right because i'm linking libsnappy, , before added link directive there unresolved libsnappy symbols (obviously) cleared up. as far know, have latest version of xcode & rest of compiler chain. libleveldb compiled using same toolchain regular application. here's command line i'm trying: /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/c++ -g -wl,-search_paths_first -wl,-headerpad_max_install_names...

amazon web services - How can I place an image back in the same S3 bucket after running AWS Lambda function? -

i have 2 buckets in s3 - let's call them photos , photos-thumbnails . right now, when user uploads image our ios app, directly upload photo photos bucket, triggers lambda function resizes photo thumbnail , uploads thumbnail photos-thumbnails bucket. i want include image compression images in photos bucket before thumbnail created in original bucket ( photos ). however, if set compression lambda function triggered whenever object created in photos bucket, wind in never-ending loop of user uploading original photo, triggering compression , placing in same bucket, triggering compression again, etc. is there way can intercept before becomes recursive call image compression? or way create third bucket? a third bucket best. if want use same bucket, choose criteria controlling whether image in photos should modified or not (perhaps image file size or something), ensure images have been processed once fall below threshold. lambda still run twice, second time examine ...

c# - How to rewrite a method so that it could be executed in LINQ to Entities? -

i have following helper method: public static double calculatekilospermeter(double diameter, double thickness) { return (diameter - thickness) * thickness * math.pi * 0.008; } i use when creating instance of model class specific entity. return pt => new viewablepipetypemodel() { id = pt.id, kilospermeter = logic.calculatekilospermeter(pt.diameter, pt.thickness) }; when execute code above, following exception: linq entities not recognize method 'double calculatekilospermeter(double, double)' method, , method cannot translated store expression so, suppose because ef requires expressionfunc. how can convert method runs under linq entities? you can obtain anonymous type records first data needed, , use asenumerable() use regular linq objects. var objs = ... pt => new { id = pt.id, diam = pt.diameter, thick = pt.thickness }; var res = objs.asenumerable().select(p => new viewablepipetypemodel() { id = p.id, kilo...

c++ - GoogleTest and Memory Leaks -

i'm surprised google c++ testing framework not explicitly support checking memory leaks. there is, however, workaround microsoft visual c++, linux? if memory management crucial me, better use c++ unit-testing framework? if memory management crucial me, better use c++ unit-testing framework? i don't know c++ unit-testing, used dr. memory, works on linux windows , mac if have symbols tells in line memory leak happened! usefull :d more info http://drmemory.org/

cluster analysis - Cut off point in k-means clustering in sas -

so want classify data clusters cut-off point in sas. method use k-means clustering. (i don't mind method, long as, gives me 3 groups.) my code clustering: proc fastclus data=maindat outseed=seeds1 maxcluster =3 maxiter=0; var value resid; run; i have problem output result. want cut-off point value include in output file. (i don't want cut-off point resid). there anyway in sas? edit: joe point out, can't achieve i'm looking using k-mean clustering. there way? basically, want cut-off point can apply data set. what have: cluster value resid 1 34 11.7668 2 38.9 0.5328 3 42.625 -13.2364 what want: cluster value resid cut-off value (interger) 1 34 11.7668 1-36 2 38.9 0.5328 36-40 3 42.625 -13.2364 40-44 my data: data maindat; input value resid ; datalines; 44 -4.300511714 44 -9.646920963 44 -15.86956805 43 -16.14857235 43 -13.05797186 43 -...

wordpress - varnish 4.0 VCL error : Running VCC-compiler failed -

i use varnish 4.0, , following these operations, vi /etc/varnish/default.vcl # drop cookies sent wordpress. sub vcl_recv {      if ((req.url ~! "wp- (login | admin)")) {          unset req.http.cookie;      } } # drop cookies wordpress tries send client. sub vcl_backend_response {      if ((req.url ~! "wp- (login | admin)")) {          unset beresp.http.set-cookie;      } } i /etc/init.d/varnish restart when executing command got error message. message vcc-compiler: syntax error @ ('input' line 33 pos 1)     if (!(req.url ~ "wp-(login|admin)")) { #------------------------------------------- running vcc-compiler failed, exited 2 vcl compilation failed * syntax check failed, not restarting so,how solve problem? thanks! as documentation says: req.* not available in vcl_backend_response req.* used available in vcl_fetch, after split of functionality, have 'bereq.*' in vcl_backend_response.

vb.net - Late binding in query -

yes know option strict , use quite often. issue stemming linq query , can't seem figure out how throwing up. wanting datarows in given table row's id equals id give it. query works fine without option strict on rows need, want have on. the error: option strict on disallow's late binding here's have right now... dim crows() datarow = (from crow in masterdataset.tables(1).rows crow(childtablekey) = intparid).toarray the error happening underneath: crow(childtablekey) i know error mean's well, can't seem figure how stop seeing error. have tried casting , such well... try using in masterdataset.tables(1) ctype(crow(childtablekey), integer) instead of in masterdataset.tables(1).rows crow(childtablekey) the example below working me option strict: dim ds new dataset dim dt new datatable ds.tables.add(dt) dim dc new datacolumn dc.datatype = gettype(system.int32) dt.columns.add(dc) dim dr datarow = dt.new...

database - MonetDB- Why doubling self-joins can cause query execution time to go from milliseconds to hours on the same data? -

i'm running sql queries on pretty simple table. tables model rdf graph using 'vertical partition' introduced here . thus, have following model s 'subject' , o object. create table a_table (bigint s, bigint o) given have 449669 tuples store in table prop_eventprecedeintask . following query (with 4 self-join on table prop_eventprecedeintask ) ran in 353 ms select t1.s event1, t2.o event2, t3.o event3, t4.o event4, t5.o event5, t6.o event6 "prop_systemcallisexecutedduringtask" t1, "prop_eventprecedeintask" t2, "prop_eventprecedeintask" t3, "prop_eventprecedeintask" t4, "prop_eventprecedeintask" t5, "prop_eventprecedeintask" t6 t1.o = 15667 , t1.s = t2.s , t2.o = t3.s , t3.o = t4.s , t4.o = t5.s , t5.o = t6.s; but when double number of self-joins on same table following query (with 9 self joins), query did not finish after hour. select t...

Save data on python script using a python script -

suppose have file test.py . import using interactive interpreter, add strings data in file. how go saving file afterwards? closing interpreter keeps test.py in original state. i've looked @ couple questions told me use pickle . however, 1 of issues pointed out in documentation pickle not readable @ all. i've tried using open function, i'm not sure how go using effectively. bottom line, how take data python script, add or remove parts of it, , save use afterwards? test.py : # test.py data = [] python shell : >>> import test >>> test.data.append("hello there!") >>> test.data ['hello there!'] there no way work python "data" files while saving them , preserving them scripts. while pickle lacks human readability, it's become choice in handling data , saving them. current program writing, future programs come. while pickle lacks human readability, @ least machine readable, meaning won...

Travis-CI resolving non-maven-central JARS -

i have jar isn't in maven central, travis ci fails below: unresolveable build extension: plugin org.kie:kie-maven-plugin:6.2.0.final or 1 of dependencies not resolved: following artifacts not resolved: org.jbpm:jbpm-bpmn2:jar:6.0.3-redhat-6, org.drools:drools-decisiontables:jar:6.0.3-redhat-6: not find artifact org.jbpm:jbpm-bpmn2:jar:6.0.3-redhat-6 in central ( https://repo.maven.apache.org/maven2 ) -> [help 2] the jar located @ https://maven.repository.redhat.com/nexus/content/groups/product-techpreview/org/jbpm/jbpm-bpmn2/ how can tell travis-ci use repo? fixed adding missing repos[1] [1] https://github.com/garethahealy/poms/blob/master/pom.xml#l760

osx - NSTabView styled like iTunes for Yosemite -

Image
i'm trying build nstabview styled in same way in nspanel/nswindow in itunes. pops when edit track. when add nstabview, appears tinted , bordered rect i've tried can think of remove rect, or set transparent. has 1 found solution this? pointers in right direction extremely helpful. you can create tabless nstabview , can add nssegmentedcontrol select active tab.

c# - Generating TextBoxes to fill in a class -

i have several classes need have properties filled in. example: class recordtype1 { public datetime date { get; set; } public string name { get; set; } public string value { get; set;} } class recordtype2 { public datetime date { get; set; } public string name { get; set; } public string location { get; set; } public float temperature { get; set; } } for recordtype1 generate datepicker fill in date , 2 textbox fill in both name , value . likewise recordtype2 datepicker , 3 textbox name, location , and temperature`. i create file containing separate usercontrol per class has required textblocks , textboxes seems if there better way generate form user fill in. is kind of thing possible? a quick-and-dirty way in winforms use propertygrid control. i'm not sure if there equivalent in wpf, host propertygrid control using windowsformshost .

.htaccess - htaccess redirect if URI contains string to index.php -

i redirect link http://example.com/asdasdas/edit http://example.com/asdasdas/index.php/edit using htaccess. did this: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} edit rewriterule ^ %{request_uri}/index.php [l,r=301] but it's loop , doesn't works well. ideas? you can use rule in /asdasdas/.htaccess : rewriteengine on rewritebase /asdasdas/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.+) index.php/$ [l] this support url of http://example.com/asdasdas/edit

windows - Folder is not deleting. How to delete this folder? -

Image
see image here -> i trying delete "games" folder. folder size huge. it's not deleting. not showing message. if try delete using cmd. shows error: see image here -> what should now? i have used " chkdsk d: /f " command , made folder removable.

Remove Redundant Values in Cell built from LISTAGG, Oracle SQL -

this question has answer here: distinct listagg inside subquery in select list 1 answer i'm new querying in oracle. have built oracle query using listagg so: select a.field1, listagg(d.field2, ';') within group (order d.field2) field_alias table1 a, table2 b, table4 c, table5 d a.field2 = b.field2 , b.field2 = c.field2 , c.field3 = d.field3 group a.field1 which returns: field1 field2 ---------------- 504482 labour;labour;labour;labour;labour;labour;labour;labour what simplify second field , remove redundant values get: field1 field2 ---------------- 504482 labour is possible? i don't think listagg() takes distinct keyword. 1 approach use subquery: select field1, listagg(d.field2, ';') within group (order field2) (select distinct a.field1, d.field2 table1 join table2 b on a.fie...

matlab - How can I merge together two co-occurrence matrices with overlapping but not identical vocabularies? -

i'm looking @ word co-occurrence in number of documents. each set of documents, find vocabulary of n frequent words. make nxn matrix each document representing whether words occur in same context window (sequence of k words). sparse matrix, if have m documents, have nxnxm sparse matrix. because matlab cannot store sparse matrices more 2 dimensions, flatten matrix (nxn)xm sparse matrix. i face problem generated 2 of these co-occurrence matrices different sets of documents. because sets different, vocabularies different. instead of merging sets of documents , recalculating co-occurrence matrix, i'd merge 2 existing matrices together. for example, n = 5; % size of vocabulary m = 5; % number of documents = ones(n*n, m); % flattened (n, n, m) matrix b = 2*ones(n*n, m); % b flattened (n, n, m) matrix a_ind = {'a', 'b', 'c', 'd', 'e'}; % vocabulary labels b_ind = {'a', 'f', 'b', 'c', 'g'}; % voca...

mariadb - MySQL - Grant access permissions does not work -

i trying give access permissions user specific database in mysql. command not seem take effect. here's mean: step 1: create db 'testdb' grant permissions 'dummyuser'@'%' on testbd.* try access mysql testdb user (fails) root@bnode1 /]# mysql -h 172.22.191.202 -u root -ppassword mariadb [(none)]> mariadb [(none)]> create database if not exists testdb; query ok, 1 row affected (0.00 sec) mariadb [(none)]> grant privileges on testdb.* 'dummyuser'@'%' identified 'password'; query ok, 0 rows affected (0.00 sec) mariadb [(none)]> flush privileges; query ok, 0 rows affected (0.00 sec) mariadb [(none)]> exit bye [root@bnode1 /]# [root@bnode1 /]# mysql -h 172.22.191.202 -u dummyuser -ppassword error 1045 (28000): access denied user 'dummyuser'@'bnode1' (using password: yes) on mysql database can see grant priviliges dummyuser below: mariadb [(none)]> show grants 'dummyuser...

jsf - Primefaces columToggler losing effect on filters -

Image
i have lazy datatable filters, have option of toggling columns , works fine on first time, if remove let's 3 columns , make new filter columtoggler keep's state of selection , headers of columns invisible well, values come again... sounds little weird explaining, i'll illustrate it. so after columns selected get: but when filtering or ordering on datatable get: i'm declaring columntoggler following way: <f:facet name="header"> lista de csrs <p:commandbutton id="toggler" update="@form" type="button" value="columns" style="float:right" icon="ui-icon-calculator" /> <p:columntoggler datasource="csrtable" trigger="toggler" /> </f:facet> if other information needed omitted please tell me. i've found answer on primeface...

javascript - why don't these stylus hashes behave the same? -

in javascript: // styl stylus compiler instance styl.define('passedhash', new stylus.nodes.object({ top: 0, right: 2, bottom: 5, left: 20 })); in .styl file: localhash = { top: 0 right: 2 bottom: 5 left: 20 } .foobar nodetype typeof(localhash) padding unit(localhash['top'], 'px') nodetype typeof(passedhash) padding: unit(passedhash['top'], 'px') the compiled output becomes: .foobar { nodetype: 'object'; padding: 0px; nodetype: 'object'; } if uncomment last line in stylus, expect padding rule written out same passedhash localhash . instead, stylus crashes: typeerror: expected "unit" unit, got null:null why? compiler knows they're both objects... appear same exact object me.... well, according source of object node ( https://github.com/learnboost/stylus/blob/master/lib/nodes/object.js ) cannot pass js object constructor. passedhash empty , error. however...

c# - Entity Framework get by weeknumber query -

i'm creating application sportsclub. on homepage want show overview of al games going played week. problem i'm facing on application layer (c#) i've set first day of week on monday. sql server thinks first day of week on sunday. sql server wrong. how can tell query first day of week monday? below can find code. public static class datetimeextensions { // extension method weeknumber date public static int weeknumber(this datetime date) { var cal = system.globalization.datetimeformatinfo.currentinfo.calendar; return cal.getweekofyear(date, system.globalization.calendarweekrule.firstday, dayofweek.monday); } } to fetch games, use following query: var weeknumber = datetime.now.weeknumber(); var games = db.games .where(x => sqlfunctions.datepart("week", x.date) == weeknumber) .tolist(); thanks suggestions did own way. below can find way did it. first, made 2 e...

ruby - Rails DELETE putting a period before :id -

i'm making simple calorie counter, using http://guides.rubyonrails.org/getting_started.html reference. i'm trying add delete button, every time try run it, hit error: no route matches [delete] "/calorieinput.1" i know issue there's period instead of slash, has been common occurrence in app. fixed before in form_for there isn't 1 delete. i'll try add needed, new posting i'm sorry in advance if forget anything. def destroy @calinput = calorie.find(params[:id]) @calinput.destroy redirect_to calorieinput_index_path end prefix verb uri pattern controller#action calorieinput_index /calorieinput(.:format) calorieinput#index post /calorieinput(.:format) calorieinput#create new_calorieinput /calorieinput/new(.:format) calorieinput#new edit_calorieinput /calorieinput/:id/edit(.:format) calorieinput#edit calorieinput /calorieinput/:id(.:format...

ruby on rails - Getting data out of devise -

i'm migrating away rails. using same domain, i'll _session_id cookie rails uses , can bring on old sessions table.i use extract data (the user_id ) old session. can not tell how outside of rails. within controller there's current_user of course or session["warden.user.user.key"] , how can take id, decrypt data in table, , pull stuff out on own (besides running old rails application , creating route on that returns info need , hitting new application)? i'm not entirely sure best way, intrigued went down rabbit hole. works 4.1.10 app sessions stored in cookie. you'll want @ action pack's encryptedcookiejar class , active support's cachingkeygenerator , messageencryptor classes details. obviously you'll need replace 2 strings start "the value…". key_generator = activesupport::keygenerator.new('the value of secret_key_base config/secrets.yml', iterations: 1000) caching_key_generator = activesupport::cachingke...

elasticsearch - Is it possible to create an XY (aka scatter) plot using Kibana 4? -

Image
i have few million documents in elasticsearch index numeric fields, foo , bar . there way use kibana 4 create graph foo values on x axis , bar values on y axis? very, basic chart 1 might create using excel. i'm fine sampling/aggregations of kind. i understand these tools won't show me plot 20 million data points. i'm trying see if there's obvious relationship between foo , bar creating graph. to plot correlation between revenue , employee count use line chart this: in order justify creating scatter plot chart though (since they're awesome , wanted to) generated fake data looked this: { name: faker.company.companyname(), employees: _.random(3, 30), revenue: _.random(10000, 100000), industry: _.sample(industries) } and plotted in visualize breaking down piece-by-piece: start line chart switch options tab of sidebar (since 4.1) uncheck "show connecting lines" check "scale y-axis data bounds" switch data t...

Java: Please tell Me what's wrong? -

here's code: system.out.println("qualifies instate rate: "); instate = keyboard.nextline(); while((instate.equalsignorecase("yes") == false || instate.equalsignorecase("no") == false)) { system.out.println("enter either yes or no:"); instate = keyboard.nextline(); } my problem output never-ending; here's output enter either yes or no: no enter either yes or no: no enter either yes or no: yes enter either yes or no: yup enter either yes or no: it doesn't matter enter in keyboard. please tell me problem , possible solutions. change: system.out.println("qualifies instate rate: "); instate = keyboard.nextline(); while((instate.equalsignorecase("yes") == false || instate.equalsignorecase("no") == false)) { system.out.println("enter either yes or no:"); instate = keyboard.nextline(); } to: system.out.println("qualifies instate rate: "); instate = ke...

sql server - PHP - PDO - MSSQL and Deleting with apostrophes -

i have read posts can apostrophes , i'm still in dark. in code i'm trying delete record contains apostrophe , space. can't delete. code works fine unless there apostrophe. i'm working in php/dbo working mssql database. i've deleted password , username sample code. <?php $attrs = array(pdo::attr_persistent => true); $pdo = new pdo("dblib:host=server;dbname=aer;charset=utf8", "", ""); $pdo->exec('set character set utf8'); $pdo->setattribute(pdo::attr_errmode, pdo::errmode_exception); $teststring="tom's tom"; $teststring = str_replace("'", "''", $teststring) ; try { $stmt = $pdo->prepare('delete jno_clubs club = :id'); $stmt->bindvalue(':id',$teststring, pdo::param_str); $stmt->execute(); } catch(pdoexception $e) { echo 'error: ' . $e->getmessage(); }...

java - Gson.fromJson, how to use dynamic json value on my POJO class? -

gson class: import com.google.gson.*; myjson: { "time": "notime", "query": { "pages": { "18302": { "title": "car", "pagelanguage": "en" } } } } custom pojo class: public class myclass { public string time; public query query; public class query { public ? pages; //... } } java code: gson gson = new gsonbuilder().create(); myclass data = gson.fromjson(myjson, myclass.class); what class should set "pages" variable handle dynamically changing (for exp: "18302") json key? you use map. public class myclass { public string time; public query query; public static class query { public map<string, page> pages; // <-- here public static class page { public string title; public string pagelanguage; ...

angularjs - Do I need a back-end with angular if I'm not storing data in a database? -

i building simple app allows users search popular products in amazon how willing pay calling amazon product api. need 3-4 screens , won't have authentication system. do need back-end framework? or can use angular make api call , redirect them amazon shopping cart populated? you can in angularjs on front end. means don't need backend database. however, @mingshun mentioned, need way of serving static files, such html, css, js , images. there plenty of options static file hosting out there, many of free or cheap.

How do I discriminate between user input sent to my processing.php page from my form page vs any other form page? -

basically, trying prevent processing page processing forms sources other own. my form <form action='processing.php' method='post'> <input type='text' name='first' value='firstname'> <input type='submit' name='submit' value='submit'> their form <form action='processing.php' method='post'> <input type='text' name='first' value='firstname'> <input type='submit' name='submit' value='submit'> how can make sure i'm processing forms sent form, or can i? yes, can (and reflex think it) creating unique token , using token validate origin. this 1 way of preventing csrf attack. you can store token on server when generate form page (for example in session), output in form , validate upon submission. so : <?php // generate token $_session['csrftoken'] = hash('sha256', uniqid()); in ...

c++ - constructor of string from char* not implicitly called? -

i have following code. void print_pair(const std::pair<const std::string&, const int&>& p) { std::cout << p.first << "," << p.second << std::endl; } print_pair(std::pair<const std::string&, const int&>("test",1));//1 print_pair(std::pair<const std::string&, const int&>(std::string("test"),1));//2 which produces following output: ,1 test,1 shouldn't 2 lines produce same output, in first case constructor string char* should implicitly called? why const reference not seem prolong life of first pair argument in first case? it compiled gcc4.9 -std=c++11 -o3. the problem pair pair of references, not values. when have: using pair_t = std::pair<const std::string&, const int&>; pair_t("test",1); the compiler needs find best candidate construction, best match in c++11 is: template< class u1, class u2 > constexpr pair( u1&& ...

fortran - Declare functions as variables in Fortran90 modules? ifort says yea, gfortran says nay -

i testing fortran module on 2 different compilers (ifort on linux machine, gfortran on mac), , i've run strange problem cannot explain. i have simple module 1 public subroutine , 2 functions calls private. looks this: module test implicit none private public :: publicsub contains subroutine publicsub(x,y,arg) implicit none integer(kind=4), intent(in):: x,y real(kind=8), intent(out):: arg arg = func1(x)*10. / func2(y) end subroutine publicsub integer(kind=4) function func1(x) implicit none integer(kind=4), intent(in):: x func1 = x*x; end function func1 integer(kind=4) function func2(x) implicit none integer(kind=4),intent(in):: x func2 = x*x*x end function func2 end module test here main program test: program sgtest use test implicit none integer(kind=4) :: a,b real(kind=8) :: output = 3 b = 4 call publicsub(a,b,output) write *, output end program sgtest i can module compile using ok itself. when compile main program not compile under ifort compile...

android - No suitable HttpMessageConverter for Respose -

i beginner in android.i need call spring web service in android project returns class object response.below code used call web service. int nid=4; resttemplate resttemplate=new resttemplate(); coaaccountlist acclist=resttemplate.getforobject("http://localhost:8080/springproject/getcoalist/{parentid}", coaaccountlist.class, nid); below controller code web-service comes hit. @requestmapping(value = "/getcoalist/{parentid}",method = requestmethod.get) public @responsebody coaaccountlist getcoalist(@pathvariable(value ="parentid") integer parentid) { try{ system.out.println("coaacclist "); coaaccountlist coaacclist=new coaaccountlist(); list<coaaccount> accountlist= saveitdao.getaccounts(parentid); coaacclist.setcoalist(accountlist); return coaacclist; }catch(exception e){ system.out.println("exc on list "+e); return null; } } im getting :- org.springfr...

ios - Convert NSData To UIImage -

first of selecting images in 1 listingstep1view , passing uiimages other view controller using sharedinstance . listingstep1viewcontroller : - (void)elcimagepickercontroller:(elcimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsarray *)info { [self dismissviewcontrolleranimated:yes completion:nil]; (uiview *v in [_scrollview subviews]) { [v removefromsuperview]; } nslog(@"info :%@", info); cgrect workingframe = _scrollview.frame; workingframe.origin.x = 0; nsmutablearray *temparray =[[nsmutablearray alloc] init]; nsmutablearray *images = [nsmutablearray arraywithcapacity:[info count]]; (int =0; i<info.count; i++) { nsdictionary *dict = [info objectatindex:i]; if ([dict objectforkey:uiimagepickercontrollermediatype] == alassettypephoto){ if ([dict objectforkey:uiimagepickercontrolleroriginalimage]) { uiimage* image = [dict objectforkey:uiimage...

javascript - $http GET URL changes and looks for wrong resource -

i'm developing single page application. making use of angularjs.v1.2.28. i'm making http request backend using code. return { getcategories : function(sessionid,terminalid,tableno,section){ var req = { method: 'get', url: config.url+ "/menucategories", params : { 'sessionid' : sessionid, 'terminalid' : terminalid, 'tableno' : tableno, 'section' : section } }; return $http.get(req); }, i make use of promise object returned service in controller. var categorypromise = categoryservice.getcategories(sessionid,terminalid,tableno,section); categorypromise.then(function(payload){ var categories = payload.data; if(categories.status.code == "1"){ if(...

php - when selecting an option from listby another listby dropdown appers in codeigniter -

i have displayed data in database table.on top of table have listby , filterby dropdown. when selecting option listby listby dropdown appers in codeigniter. display.php (view) <?php $con=mysqli_connect('localhost','root','','my_db'); $sql="select * feedback"; $result=mysqli_query($con,$sql); ?> <html> <head> <script> function listby(str) { var xmlhttp; if (window.xmlhttprequest) { xmlhttp=new xmlhttprequest(); } else { xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() ...