Posts

Showing posts from March, 2013

302 Redirect from CGI script stopped working in Apache 2.4 -

i inherited maintenance of self-written cgi application without documentation , have never met original author. application stopped working in debian 8, worked in debian 7 , centos 5. main changes upgrade apache 2.2 (used debian 7 & centos 5) apache 2.4 (used debian 8) , upgrade perl 5.8 (in centos 5) respectively perl 5.14 (in debian 7) perl 5.20. problematic part boils down following script (a 302-redirect): #!/usr/bin/perl $|=1; # activate auto-flushing of stdout use strict; use warnings; $crlf = "\015\012"; print stdout "status: 302 moved temporarily$crlf" . "location: /does_not_matter$crlf" . "uri: /does_not_matter$crlf" . "connection: close$crlf" . "content-type: text/html; charset=utf-8$crlf$crlf"; close stdout; while(1) { sleep 1; } the observed behavior redirect never reaches client long script still running when used apache 2.4, there no error ...

arraylist - Why my hashmap is null Android? -

i trying value hashmap (from listviewrestaurants) can pass latitude , longitude mapsactivity reason hashmap return null ... can me. public class listviewrestaurants extends activity { static listview listview; static arraylist<hashmap<string, string>> arrlist; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_list); listview = (listview) findviewbyid(r.id.listiew); arrlist = new arraylist<hashmap<string, string>>(); string json_str = getjsondata(); try { jsonarray jarray = new jsonarray(json_str); (int = 0; < jarray.length(); i++) { jsonobject json = null; json = jarray.getjsonobject(i); hashmap<string, string> map1 = new hashmap<string, string>(); // adding each child node hashmap key => value ...

html5 - Two elements - Fixed and flexible width (100% - 170px) -

at top level of website layout 4 div tags. the first 1 full width header section, css: #header { margin-top: 0px; height: 70px; border: 4px double rgb(255,255,255); border-radius: 20px; background: rgb(88,150,183) no-repeat fixed left top; padding: 0px; } at bottom full width footer: #footer { clear: both; margin: 0px; color:#cdcdcd; padding: 10px; text-align: center; border: 4px double rgb(88,150,183); border-radius: 20px; } on left main menu section: #categories { float:left; width:150px; border: 4px double rgb(88,150,183); border-radius: 20px; } all of 3 elements work fine. they're in right place , doesn't change whatever screen resolution user has on monitor, or whether view on not maximum screen size. my problem main element of page - interesting stuff is. it's directly right of menu div - or rather, should be. css is: #main { float:right; min-height: 440px; width: 80%; margin-bottom: 20px; padding:20px; border: 4px double rgb(88,150,183); border-...

javascript - Devbridge JQuery Autocomplete not working with serviceUrl -

i trying implement devbridge autocomplete doesnt work ajax. works when use manual json object without php need data database. php code: <?php require_once "medoo.php"; $database = new medoo([ 'database_type' => 'mysql', 'database_name' => 'elektriksikayet', 'server' => 'localhost', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'port' => '3307' ]); $return_arr = []; $keyword = $_post['keyword']; $companies = $database->select('companies','company_name'); foreach ($companies $comp){ $row_array['label'] = $comp; array_push($return_arr, $row_array); } echo json_encode($return_arr); ?> html code: <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <script src="js/...

asp.net - mvc 6 IApplicationEnvironment causes blank page -

i have asp 5 mvc 6 project , added iapplicationenvironment controller , of sudden going action in controller returns blank screen, 500 error can see in development tools readonly dbdatacontext _dbcontext; readonly iapplicationenvironment _appenv; public contactcontroller(iapplicationenvironment appenv, dbdatacontext dbcontext) { _dbcontext = dbcontext; _appenv = appenv; } does have ideas why might happening? thanks! i figured out - because had microsoft.framework.runtime instead of using microsoft.extensions.platformabstractions; @ top of controller. using second 1 made work fine.

rdd - Returning keys from key-value pairs based on maximum value in apache spark -

i'm new apache spark , need advice. have rdd [string, int] type. rdd values that: ("a,x",3) ("a,y",4) ("a,z",1) ("b,y",2) ("c,w",5) ("c,y",2) ("e,x",1) ("e,z",3) what want accomplish rdd (string,string): ("a","y") //among key's contains a, (a,y) has max value ("b","y") //among key's contains b, (b,y) has max value ("c","w") //among key's contains c, (c,w) has max value ("e","z") //among key's contains e, (e,z) has max value i tried loop concept (by using counter) in flatmap doesn't work. there easy way this? just reshape , reducebykey : val pattern = "^(.*?),(.*?)$".r rdd // split key parts .flatmap{ case (pattern(x, y), z) => some((x, (y, z))) } // reduce first part of key .reducebykey( (a, b) => if (a._2 > b._2) else b ) // go original s...

java - Lack of preprocessor problems -

i writing android application in want portions of code split out can give them out libraries customers can build own apps hit our api. problem need of same code things differently us, build our own in house apps. know java doesn't have preprocessor. there way me compile 1 set of code on 1 kind of compile, , set of code on different kind of compile, without having maintain 2 separate sets of code same thing?

oozie sqoop shell action - sqoop : Command not found -

i trying triggering sqoop command through shell action. getting error - sqoop: command not found. i read contents of file hdfs through shell action. when try trigger sqoop or hive commands saying sqoop of hive command not found. copied libraries location , in oozie properties(oozie.libpath) have given path. oozie.libpath=/user/oozie/share/lib oozie.use.system.libpath=false oozie.wf.rerun.failnodes=true am missing here? can 1 please me on this.

jquery - How to customize JQGrid with another new header -

Image
first of lot shared great answers in many quesioned asked many users. got lot of information answers. i trying implement jqgrid in project. , per requirement trying add header this: i did this: var t1 = ' highmediumlow '; var applychangesdiv = document.createelement("div"); $(".ui-jqgrid-hbox").after(t1); now question correct way of adding new header. here requirement: user selects 1 or more rows , change priority in third line of header, selected value should apply in selected row cells. note: here referring 1st row header scorecard name, priority etc. , 3rd row row want add. now if add said, have write lot code apply changed values in cells , 1 more issues when re-sizing column width, 3rd row not re-size. if demo, great help. thanks! i got answer. instead of adding after ui-jqgrid-hbox, added after ui-search-toolbar. so new code is: $(".ui-search-toolbar").after(t1);

variables - Wordpress: Change number of posts from administration -

i have problem showposts. $recent = new wp_query('showposts=10'); while($recent->have_posts()) : $recent->the_post(); and change number of "showposts" administration. i found instruction how create widget in /wp-admin/ dont know how create simple form change , save number of showed posts. thank help. under settings > reading in wp-admin have configuration of how many posts shown in each page of queries. can remove 'showposts' parameter , wordpress value configured in wp-admin. also, showposts deprecated. should use 'posts_per_page' :) https://codex.wordpress.org/class_reference/wp_query#pagination_parameters hope helps.

Android JSON POST and then response -

i can retrieve data through json in listview want show data relative user logged in have post username php script. don't have idea how post username php script , respond web server. private class getfixture extends asynctask<void, void, void> { @override protected void onpreexecute() { super.onpreexecute(); } @override protected void doinbackground(void... arg) { servicehandler serviceclient = new servicehandler(); log.d("url: ", "> " + url_items); string json = serviceclient.makeservicecall(url_items,servicehandler.get); // print json response in log log.d("get match fixture resps","> " + json); if (json != null) { try { log.d("try", "in try"); jsonobject jsonobj = new jsonobject(json); log.d("jsonobject", "new json object"); //...

Elasticsearch match query with partial text match -

newbie question on elasticsearch. have set elasticsearch lucene index , use searching names contain term, such as search_response = es.search(index = 'sample', body = {'query':{'match':{'first_name':"just"}}}) this not return me name "justin" following query does search_response = es.search(index = 'sample', body = {'query':{'match':{'first_name':"justin"}}}) what doing wrong? shouldn't "match" query return me records contain term? thanks. the best way handle need creating custom analyzer uses edgengram token filter . forget wildcards , using * in query strings, underperform edgengram approach. so you'd have create index first , reindex data it. curl -xput http://localhost:9200/sample -d '{ "settings": { "analysis": { "filter": { "prefixes": { ...

windows - How to setup license server? -

i have windows programm , want make own license server. don't generate key manually. idea check on server 2 copies running @ same time. my algorithm. user buy license key. server script insert key server database. user enters key program. program insert database. user start programm. after that, program login server using license key. , logout when user close programm. if there 2 copies login server same time using same key, server script deactivates license key. but problem substitution of license server fake server hosts file in windows os. may server should return unique in answer after programm authentication , programm must understand user login license server not in fake server. what? any ideas? i not know how can make wish to, easier make login page, user bought license key have insert account program work. i'm telling idea here not how make it.

Hash Merge Error in SAS -

i trying create hash merge between 2 tables, output.hicno_xwalk , , papi_claim_01 . before, had been doing normal match-merge using proc sorts , data step. here original code: proc sort data = output.hicno_xwalk; hicnumber plan_type; run; proc sort data = papi_claim_01; hicnumber plan_type; run; data papi_claim_01a; merge output.hicno_xwalk (in=a) papi_claim_01 (in=b); hicnumber plan_type; if (b); run; now, using this: data hash_merge (drop = rc); set output.hicno_xwalk point = _n_; if 0 set output.hicno_xwalk papi_claim_01; *load properties; declare hash merge(dataset:'output.hicno_xwalk'); merge.definekey (hic); *define variable use key (no duplicates); merge.definedata ('new_hic','plan_type'); *columns merge table include; merge.definedone(); *end hash; until (eof); set papi_claim_01 end = eof; if merge.find() = 0 output; end; stop; *output records hic found in both tables; run; however, error in log saying error: type mismatch method ...

node.js - Terms in Apache Kafka -

i read apache kafka documentation , couple of more articles start on kafka , how can used in application. however, highly confused @ point. i unable understand difference between partition , brokers. kafka provides replication factor reliability. replicated data present on same machine? difference between {high level, low level} + {producer, consumer} if kafka doesn't store consumer position, best methods of storing it? people use databases or may store local information client. is idea build pub-sub system kafka , nodejs (to provide rest api data)? can guide me in direction? please comment if want me add other relevant information helps better provide solutions. thanks in advance. this chance brush on kafka knowledge, i'm sorry if got bit long. most answers here derived documentation linked, or googling relevant documentation. since indicated wanting work node.js, i include references arguably best (to knowledge) kafka 0.9.0 client no-kafka , ,...

Java swing rendering phenomenon in 2D Game -

Image
i working on first jump'n run game. initial part working decent, still "bug" appears when "colums" moving. happens when "move_speed" 1<. tryed timer too, same thing. this how looks like: please have @ code: ... public class board implements runnable, keylistener { jframe frame; arraylist<column> clist; player p; private boolean ingame = false; public final static int init_width = 600; public final static int init_height = 400; public static int width; public static int height; private final int move_speed = 10; //when 1 problem doesnt appear! private final int gravity = -3; private int cplayerstayingon; private double playerbottom; private double floortop; private boolean mr = false; private boolean ml = false; private boolean jump = false; long lastlooptime = system.nanotime(); final int target_fps = 100; final long optimal_time = 1000000000 / target_fps; private int fps; private int lastfpstime; public static double delta = 1;...

javascript - How to unhide select tag HTML? -

i trying following in html , javascript: i using select tag (html) hidden until user clicks on no. if user click on no, select options appears , if user select yes, select options disappear. function works great input , other tags, not select tag. i did lot of research , found out display:none , select tag not work google chrome , ie, solutions given in jquery , asp.net. since still new of this, wondering if there solution using html , javascript? code html: <div id="divmetspec" class="fieldrow"> <div class="leftlabel labelwidth20"> <label for="">met spec upon return:</label> </div> <div class="leftfield"> <div class="formfield68"> <input id="rbmetspec" name="rbmetspec" type="radio" class="radiobuttonfield" alt="met spec" title="met spec" value="yes" ...

c++ - Define String Node in Linked List -

#include<iostream> #include<stdlib.h> #include<conio.h> #include <ctime> #include <fstream> #include <windows.h> #include <string> using namespace std; /* data variable used store data name suggests,the "next" pointer of type node used point next node of linked list*/ /* * node declaration */ struct node { string info; struct node *next; }*start; /* * class declaration */ class single_llist { public: node* create_node(string); void insert_begin(); void insert_pos(); void insert_last(); void delete_pos(); void sort(); void search(); void update(); void reverse(); void display(); single_llist() { start = null; } }; /* * inserting element in beginning */ void single_llist::insert_begin() { string value; cout<<"enter value inserted: "; cin>>value; struct node *temp, *p; temp = create_node(value); if (start == null) { star...

Scala Generics : Cannot write an instance of T to HTTP response. Try to define a Writeable[T] -

following code when written using generic give compilation error. without generic def getdata(id: string) = action.async { val items = getitems(id) sendresult(items) } private def sendresult(result: future[any]) = { result.map { items => { try { val itemstr = items.asinstanceof[string] ok(itemstr) } catch { case t: classcastexception => internalservererror(s"casting exception while processing output $t") } } }.recover { case t:timeoutexception => internalservererror("api timed out") case t: throwable => internalservererror(s"exception in api $t") } } with generic def getdata(id: string) = action.async { val items = getitems(id) sendresult[string](items) } private def sendresult[t](result: future[any]) = { result.map { items => { try { val itemstr = items.asinstanceof[t] ...

ios - How to prevent rotation of all UIImage overlays with MapKit -

i placing overlays mapoverlayrenderer. first use uiimage in view on map , can rotate in view , convert points (define boundingmaprect, coordinate, etc.) , place (renderer/addoverlay) onto map correct inserted image (cgcontextdrawimage) , correct rotation. each time create new overlay [uiimage in view, rotate, convert points, addoverlay) works fine. but, on each successive overlay added map, code rotates of other overlays on map. seems though rotation code (below) being applied of overlays. should making array includes boundingmaprect , coordinates each overlay - if so, should these in viewcontroller? should naming each overlay [overlay.title? - how set , call it?] appreciate guidance - thanks. mapoverlayview.h @interface mapoverlayview () @property (nonatomic, strong) uiimage *overlayimage; @end @implementation mapoverlayview - (instancetype)initwithoverlay:(id<mkoverlay>)overlay overlayimage: (uiimage *)overlayimage { self = [super initwithoverlay:overlay]; if (self) {...

reading json like variable in ansible -

i'm new ansible , i'm having problem reading value json file in ansible role. variable has value following: { "queue": { "first": { "car": "bmw", "year": "1990", "model": "x3", "color": "blue" }, "second": { "car": "bmw", "year": "2000", "model": "318", "color": "red" } } } i'm trying print color's value compare other variable. used with_dict iterate on json object (stored in variable called jsonvar) following: - name: test loop with_dict: "{{jsonvar}}" shell: | if echo "blue" | grep -q "${{item.value.color}}" ; echo "success" so far there no luck in getting comparison of color's value json "blue" if statement. wondering if i...

c++ - Error when using vectors in a map -

i attempting add vector position in map according key. vector<string> words; map<string, vector<string>> wordmap; (int = 0; < words.size(); i++) { string word = words.at(i); if (wordmap.find(word) == wordmap.end()) wordmap.insert(make_pair(word, vector<string>())); vector<string> context = { "empty" }; if (i == 0) context = { "beginning of words", words[i + 1], words[i + 2] }; else if(i == 1) context = { "beginning of words", words[i - 1], words[i + 1], words[i + 2] }; else if (i == words.size() - 2) context = { words[i - 2], words[i - 1], words[i + 1], "end of words" }; else if(i == words.size() - 1) context = { words[i - 2], words[i - 1], "end of words" }; else context = { words[i - 2], words[i - 1], words[i + 1], words[i + 2] }; wordmap[word].push_back(context); cout << context[0] << endl; } ...

date - PHP Session variable - find time difference -

the program trying write simple enough, find difference between 2 times: today's, , time user logs in put in session variable. the session variable $_session['logintime']; is set today's date $_session['logintime'] = date('y-m-d h:i:s'); when user logs out duration have been logged in found using code on separate page: if(isset($_session['logintime'])) { $logtime = $_session['logintime']; $duration = strtotime(date('y-m-d h:i:s')) - strtotime($logtime); $duration = date('h:i:s', $duration); } if log in (22:15 19/04/2016) , stay logged in 1min 10 sec returns 01:01:10 . cannot understand hour coming from, timezones set same. the minutes , seconds calculated fine 1 hour added seemingly no reason thanks reading! appreciated! the datetime object friend. from php manual , simple example follows: $datetime1 = new datetime('2009-10-11'); $datetime2 = new datetime('2009...

Not able to execute a Webdriver Java Code from eclipse -

i configured web-driver in eclipse , configured ant , able execute project. created 1 more project , wrote first java code , when click on run button , not able execute though has no errors. here error throwing when try execute. class not found dashboard java.lang.classnotfoundexception: dashboard @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.loadclass(remotetestrunner.java:693) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.loadclasses(remotetestrunner.java:429) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:452) @ org.eclipse.jdt.internal.junit.run...

How to obtain values above A9999 in MS Access 97 frontend with a MySQL V5.2 backend? -

i have inherited database ms access 97 frontend mysql v5.2 backend. in mysql have table primary key field set @ varchar (50). setup because our reporting system uses alpha numeric identification. same field in linked access table set @ text. @ present, have query returns new sequential values on set value (eg) >s/1234 generate values added above table. users use these values print series sequentially numbered reports. however, have come value s/9999 , users can no longer use query obtain values > s/9999. ideas of how solve problem appreciated. thanks.

ruby - Running multiple processes on a single Heroku dyno -

i have heroku app, use jekyll. procfile looks this: web: jekyll serve --port $port i want use sass, if add procfile , i'll need 2 dynos, costly me now: sass: sass style.scss style.css web: jekyll serve --port $port can add second process still stay on 1 dyno? what's easiest way developer minimal ruby experience? i'm interested in processes, jekyll , sass example. sass not supposed compiled in production, gigantic performance penalty gives no benefit. so short answer is: you should not that . instead, precompile sass before or during deployment , serve static css in production. if there exotic reason justifies compiling sass realtime (you should totally share is!), consider using either of those: jekyll asset pipeline generator_scss.rb (requires compass) sorry if won't work you, haven't tried myself. ps consider changing hosting provider. heroku powerful tool, extremely pricey. have example @ digitalocean . pure vps come no ruby/...

c# - What option define the using of `WcfSvcHost` in the `WCF Service Library` template? -

Image
wcf, .net 4.6, visual studio 2015 from programming wcf services, 4th edition juval lowy book: visual studio offers several wcf project templates. wcf service library project merely prebuilt usage of wcfsvchost , wcftestclient . main difference when using wcf service library template there no need specify config file , specify wcfsvchost.exe startup program, because project file contain new projecttypeguids element wcf service library. wcf service library provides simple template service contract , implementation, matching config file. but if comment projecttypeguids element in csproj -file ide still uses wcfsvchost start external program ... hm... by default debug tab of new project created on base wcf service library template has such settings: i see start external program option empty... why visual studio 2015 project still uses wcfsvchost start external program after commented projecttypeguids element? option define such behaviour? ...

Getting counts of data in R -

i using r first time. have following data set ( mockup of large data set working with): type date size color l shape 2008-04-14 161 blue l shape 2010-10-16 654 yellow l shape 2005-07-03 149 blue l shape 2006-08-16 657 yellow l shape 2007-04-08 229 yellow l shape 2004-03-17 784 green y shape 2014-02-22 917 pink y shape 2012-05-04 186 green y shape 2006-11-25 641 yellow y shape 2015-09-07 493 blue y shape 2011-07-06 953 green i number of occurrances of each color each type, dates each type , min, max , mean size each type. output should this: type colors dates mean size min size max size l shape 3 2008-04-14 439 149 784 2010-10-16 2005-07-03 2006-08-16 2007-04-08 2004-03-17 y shape 4 ...

Grab images from another website, like pinterest -

im trying build images bookmarklet site pinterest, somehow of website doesnt grab image. works fine. additional information, use jquery wookmark grid templates. here codes im use... dont know if right or used wrong method retrieve images. cheers guys in advance comment or help... appreciated. -- html <ul id="tiles"></ul> <div id="loader"> <div id="loadercircle" style="display:none"></div> </div> -- javascript <script type="text/javascript"> function loaddata() { isloading = true; var link_pin ='http://www.somewebsite.com'; $('#loadercircle').show(); $.ajax({ url: '<?php echo(base_url('index.php/home/pin_ajax'))?>', datatype: 'json', data: {link_pin:link_pin}, success: onloaddata }); }; function onloaddata(data) { isloadi...

installation - ios7 beta on ipod touch 4 - how to intsall -

the apple developer newsletter states: ios 7 beta 2 ipad, iphone, , ipod touch... but how install ios7 on ipod touch 4? image should use? available ipod touch image für 5th generation. ios 7 can installed on ipod 5.

android - Rotate screen without turn on auto-rotate -

i'm making small streaming tv application android. i want set video-view fullscreen when user rotates device. allowed when auto-rotate button enabled. how make app rotate screen without turning on auto-rotate button? noticed there many apps , games can that, clash of clan. inside androidmanifest add attribute activity : android:screenorientation="landscape" else add code oncreate method : this.setrequestedorientation(activityinfo.screen_orientation_reverse_landscape); make rotate run hope helps

javascript - How can I add faces to an indexed THREE.BufferGeometry? -

say had generated three.buffergeometry three.geometry named oldgeom so: // using webglrenderer var geometry = new three.buffergeometry(); var indices = new uint16array(oldgeom.vertices.length); var vertices = new float32array(oldgeom.vertices.length * 3); (var = 0; < oldgeom.vertices.length; i++) { indices[i] = i; vertices[i * 3 + 0] = oldgeom.vertices[i].x; vertices[i * 3 + 1] = oldgeom.vertices[i].y; vertices[i * 3 + 2] = oldgeom.vertices[i].z; } geometry.addattribute('position', new three.bufferattribute(vertices, 3)); geometry.setindex(new three.bufferattribute(indices, 1)); hopefully have indexing right. @ point, how add face using indices? i'm planning loop through faces of oldgeom add them here, can't find documentation on this. thanks! similar this question , indexed geometry. from the documentation buffergeometry: index (itemsize: 3) allows vertices re-used across multiple triangles; called using "indexe...

python - Extract the text from `p` within `div` with BeautifulSoup -

i new web-scraping python, , having hard time extracting nested text within html ( p within div , exact). here got far: from bs4 import beautifulsoup import urllib url = urllib.urlopen('http://meinparlament.diepresse.com/') content = url.read() soup = beautifulsoup(content, 'lxml') this works fine: links=soup.findall('a',{'title':'zur antwort'}) link in links: print(link['href']) this extraction works fine: table = soup.findall('div',attrs={"class":"content-question"}) x in table: print(x) this output: <div class="content-question"> <p>[...] die verhandlungen über die mögliche visabefreiung für türkische staatsbürger per ende ju... <a href="http://meinparlament.diepresse.com/frage/10144/" title="zur antwort">mehr »</a> </p> </div> now, want extract text within p , /p . code use: table = soup.findall('div...

linux - Error while comparing in shell -

i trying search pattern(trailer) , if occures more once in file, need filenames displayed f in *.txt if((tail -n 1 $f | grep '[9][9][9]*' | wc -l) -ge 2); echo " file $f has more 1 trailer" fi done your crying syntax error -ge operator [ … ] or [[ … ]] conditional construct. doesn't have chance way wrote program. -ge needs number on both sides, , have on left command. meant have output of command, need command substitution syntax: $(…) . that's if [ $(tail -n 1 $f | grep '[9][9][9]*' | wc -l) -ge 2 ]; this syntactically correct never match. tail -n 1 $f outputs 1 line (unless file empty), grep sees @ 1 line, wc -l prints either 0 or 1. if want search pattern on more 1 line, change tail invocation. while you're @ it, can change grep … | wc -l grep -c ; both same thing, count matching lines. example, search in last 42 lines: if [ $(tail -n 42 -- "$f" | grep -c '[9][9][9]...

javascript - Where is the require.js file generated from? -

i learning angular 2 example https://github.com/pkaul/maven-typescript-example so after run 3rd step (mvn jetty:run), runnable war folder packaged in example-webapp/target folder. however, there 1 file not sure about. under folder example-webapp/target/example-webapp-0.1.0-snapshot/modules , require.js file, old timestamp 2013-05-14. i know comes , for. guessing file related requirejs-maven-plugin plugin defined in pom.xml inside example-webapp. standing confirmed or corrected. <plugin> <groupid>com.github.mcheely</groupid> <artifactid>requirejs-maven-plugin</artifactid> <version>1.0.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>optimize</goal> </goals> </execution> </executions> <configuration> <skip>true</skip><!-- not enab...

c - Is __MSDOS__ still defined when compiling with djgpp? -

is using __msdos__ enough djgpp or should __djgpp__ used instead? by comparison, know _win32 isn’t defined default on cygwin (based on assumption djgpp , cygwin have purpose build unix layer hide real os details) . i no longer have dos machine test it. to list predefined macros , values, use djgpp -e -x c -dm /dev/null

Python - Creating a Reversed String Using a For Loop -

i'm trying figure out how create reversed string using loop. it's understanding isn't efficient way of doing assignment's parameters specify have use loop. have seems should work keep getting error: "typeerror: 'str' object not callable" "line 7, in reversestring test2 = test1(n)". def reversestring(test1): global test2 test2 = "" n in range (len(test1)-1, -1, -1): test2 = test1(n) print (test2) return test2 #input test1 = input("enter string test if palindrome: ") reversestring(test1) you're trying call string see in error message test1(n) want index string doing test1[n] . also, return inside loop want outside, , want use += concatenate instead of reassigning on every iteration. i'm assuming exercise , thats why you're doing iteratively. nonetheless, sake of completeness reverse string can test1[::-1]

node.js - Choose proper async method for batch processing -

i need perform cyclic call external api delay, prevent 'user rate limit exceeded' restriction. google maps geocoding api sensitive 'req/sec', allowing 10 req/sec. should make geocoding hundreds of contacts, , such delay required. so, need have 10 async geocoding functions post-delay in 1 sec each. so, collect contacts in array, , loop through array in async manner. generally, need have n simultaneous threads, delay in d msecs in end of each thread. entire loop iterates on array of user entities. each thread process single entity, usual. i suppose have code like: const n = 10; # threads count const d = 1000; # delay after each execution var processuser = function(user, callback){ somebusinesslogicproc(user, function(err) { settimeout(function() { return callback(err); }, d); }); } var async = require('async') ; var people = new array(900); async.batchmethod(people, processuser, n, finalcallback); in pseudocode bat...

Stuck on simple stupid C/C++ logic statement -

i have 2 switches both need activated before move onto next part of program. normally, either switch can on or off. want run process until both switches engage. seem unable conceptualize logic need write statement. i can use 2 statements want, such as: start_process(); while(!sw1){ read_switches(); delay(); } while(!sw2){ read_switches(); delay(); } end_process(); but sure there better way it. best guess far has been this: while(!(sw1 || sw2)){ read_switches(); delay(); } but not confident correct. and reason doesn't right either. while(!sw1 && !sw2){ read_switches(); delay(); } i've done far more complicated logic statements this, reason, not seeing way through simple statement. thank offered. you need expression evalualtes true till 1 or both of variables sw1 , sw2 false . try this while(!sw1 || !sw2) { read_switches(); delay(); } or while(!(sw1 && sw2)) { read_s...