Posts

Showing posts from March, 2013

php - Show a Parse error: "@" on dbc connect. how i fix it? -

this question has answer here: php parse/syntax errors; , how solve them? 11 answers error - "parse error: syntax error, unexpected '@' in /home/vol2_8/byethost13.com/b13_16347614/digiquiz.my-style.in/htdocs/simplephpquiz-master/includes/db_conn.php on line 7" here code: <?php // set database access information constants define ('db_user', 'xxxxxxxxx'); define ('db_password', 'xxxxxxx'); define ('db_host', 'xxxxxxxxxxx'); define ('db_name', 'xxxxxxxxxxx'); @ $dbc = new mysqli(xxxxxxxxxx, xxxxxxxx, xxxxxxxxx, xxxxxxxx); // details added constants not define's if (mysqli_connect_error()){ echo "could not connect mysql. please try again"; exit(); } ?> why not using defines so: <?php //set database access information constants define

python - How to print output of for loop on same line -

here code: def missing_ch(number, string): in range(len(string)): if i==number: continue else: print(string[i], end=' ') return string='hello' num=int(input("enter position of char")) missing_ch(num, string) how output characters printed in same line? i see 3 issues in program - in for loop in second line , have missed closing bracket - for in range (len(str): , should - for in range (len(str)): there no casting in python, convert input string, have use int function, int(...) , line (int)(input(...)) should - int(input(...)) . in loop, defining index i , using ch inside loop, should using i instead of `ch. example - in range (len(str): if(i==num): continue print(str[i],end=' ') return the print statement print items without appending newline fine, should working. a working example - >>> def foo(): ... print(&q

javascript - Parsing JSON to HTML table using jQuery -

i using below code parse json file, getting undefined in each table column. <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $(document).ready(function () { var json = [{ "rate_upload_date": "07/01/2015 8:17 ct", "groups": [ { "name": "conforming fixed rate mortgage purchase", "product": [ { "descr": "30 year fixed rate", "rate": "4.25", "apr": "4.277", "points": "0", "<payment_stream_url>": "https://publicservices.mortgagewebcenter.com/paymentstream.aspx?cobranderid=1152&criteriaid=113444902&resultid=58" }, {

System getting crashed whenever i try to open fabric plugin in eclipse -

steps performed: install fabric plug-in in eclipse, restart eclipse, click on fabric icon menu bar @ top of eclipse. logged in, after ubuntu crashed. after whenever click on fabric icon menu bar system gets crashed os version - ubuntu 15.04 eclipse version - luna (4.4.2)

mysql - List users by program -

having tables these: users: create table `affiliate__model__user_node` ( `id` bigint(20) not null auto_increment, `user_id` bigint(20) default null, primary key (`id`) ) engine=innodb programs: create table `affiliate__model__program` ( `id` bigint(20) not null auto_increment, `name` varchar(255) not null, primary key (`id`), ) engine=innodb users using programs: create table `affiliate__model__user_program` ( `user_id` bigint(20) not null default '0', `program_id` bigint(20) not null default '0', `username` varchar(255) not null, primary key (`user_id`,`program_id`) ) how list users belonging particular program, this? user_id | program 1 | program 2 | program 3 | program n .... --------------+-----------+-----------+-----------+----------- 1 | y | n | n | y 3 | n | n | n | n 7 | n | y | n | n 12

wso2esb - Validation error with WSO2 ESB generated WSDL -

i created proxy service wso2 esb 4.8.1 using complex wsdl using wsdl import , lot of schema imports. can import original wsdl soapui not 1 generated proxy service. wsdl validation gives error error - rpcmessagereceiver wsdlexception (at /wsdl:definitions/wsdl:message 1 /wsdl:part): faultcode=unbound_prefix: unable determine namespace of 'null:updateconsumerbydms_v1'. i found similar problem https://wso2.org/jira/browse/carbon-12030 . how solve problem? appreciated. best regards, teemu i think on using original wsdl proxy parameters <parameter name="useoriginalwsdl">true</parameter> <parameter name="modifyuserwsdlportaddress">true</parameter> wso2 esb alters wsdl keep original wsdl file in registry, lets in conf/myresources folder , use below after target. <publishwsdl key="conf:myresources/<wsdl_file>.wsdl"/> <parameter name="useoriginalwsdl">true</paramet

node.js - Is there a way to enable paging in node js REPL -

i see paging when have long outputs in node js repl. is possible, how? vorpal.js node module looks trick. vorpal turns node app interactive cli, , supports extensions including implementation of less command in node. something work: var vorpal = require('vorpal')(); var less = require('vorpal-less'); vorpal .catch('[commands...]') .action(function (args, cb) { args.commands = args.commands || []; var cmd = args.commands.join(' '); var res; try { res = eval(cmd); } catch(e) { res = e; } this.log(res); cb(); }); vorpal .delimiter('myrepl>') .show(); this turn application repl within context of app, can accept less command: $ node myrepl.js myrepl> 6 * 6 | less 36 : (less prompt) disclaimer: wrote vorpal

c++ - multichannel support for Windows Media Foundation AAC encoder -

i'm writing program using windows media foundation aac encoder encode audio. according documentation here - aac encoder - 6 channels supported. in program when set 6, i'll mf_e_invalidmeidatype error. below code clsid* pclsids = null;// pointer array of clisds. uint32 ncount = 0; mft_register_type_info encoderinfo; encoderinfo.guidmajortype = mfmediatype_audio; encoderinfo.guidsubtype = mfaudioformat_aac;// aac encoder class id not exposed, have enumerate hresult hr = fpmftenum(mft_category_audio_encoder, 0, null, &encoderinfo, null, &pclsids, &ncount); ciencoder.createobject(pclsids[0], iid_imftransform); lcomobject<imfmediatype> ciinputtype; // input media type of encoder hr = fpmfcreatemediatype((imfmediatype**)(ciinputtype.getassignableptrref())); hr = ciinputtype->setguid(mf_mt_major_type, mfmediatype_audio); hr = ciinputtype->setguid(mf_mt_subtype, mfaudioformat_pcm); hr = ciinputtype->setuint32(mf_mt_audio_bits_per_sample, 16);

linux - Working with files in Expect -

i want read file contents, processing , write them file using expect scripting tool. let's assume have file_a contains following data: the ip address of machine is: "0.0.0.0" i want read contents of file_a, modify them , write them file_b, should following: the ip address of machine is: "192.168.0.69" can please me this? you can use sed command replace file content below.then use move command make backup file want. sed -i.bk 's/0.0.0.0/192.168.0.69/g' file_a.txt mv file_a.txt.bk file_b.txt explanation: sed = stream editor -i = in-place (i.e. save original file) command string: s = substitute command 0.0.0.0 = regular expression describing word replace (or word itself) 192.168.0.69 = text replace with g = global (i.e. replace , not first occurred

How to store files in the web that can be accessible from Android App? -

i need store audio files in web can downloaded android app through url. how can store these files free? google drive help? if want direct downloads files you'll want host files on web host. can use amazon's s3 (free) example. way you'll have direct links files.

Problems with parametrized derived types in Fortran 2003 -

i'm teaching myself fortran 2003 use research project i'm working on. i'm used fortran 90, project requires use of parametrized types, , i'm moving on 2003. i following this site's description of how define parametrized type, , wrote simple example program based on site's example test out: module example implicit none type :: param_matrix(k,a,b) integer, kind :: k integer, len :: integer, len :: b real(kind=k), dimension(a,b) :: m end type param_matrix end module example when compile command gfortran -c test.f03 i errors test.f03:4.2: type :: param_matrix(k, a, b) 1 error: unclassifiable statement @ (1) test.f03:5.13: integer, kind :: k 1 error: invalid character in name @ (1) test.f03:6.13: integer, len :: 1 error: invalid character in name @ (1) test.f03:7.13: integer, len :: b 1 error: invalid character in name @ (1) test.f03:8.16: real(k

javascript - DataTable Uncaught TypeError: Cannot read property 'cell' of undefined -

i have datatable local data consisting of 8 headers/rows. i'm getting uncaught typeerror: cannot read property 'cell' of undefined. did investigation , if comment out 1 of columns not getting error anymore. seems table can show 7 rows. know how fix this? <tr> <th class="surname">surname</th> <th class="firstname">first name</th> <th class="loginemail">login email</th> <th class="customer">customer</th> <th class="capabilities">capabilities</th> <th class="currentstatus">status</th> <th class="lastinvitesent">last email sent</th> <th class="removereq"></th> </tr> data data.loginemail = img.attr('data-email'); data.firstname = im

php - How do I get only JSON in res? -

i building search list number of users , getting error when trying load more pages show more users: syntaxerror: json.parse: unexpected character @ line 1 column 1 of json data var result = json.parse(res); here ajax function in index.volt function(cb){ $.ajax({ url: '/search/search?q=' + mapobject.q + '&sort=<?php echo $sort;?>' + '&page=' + mapobject.page, data:{}, success: function(res) { var result = json.parse(res); if (!result.status){ return cb(null, result.list); }else{ return cb(null, []); } }, error: function(xhr, ajaxoptions, thrownerror) { cb(null, []); } }); and here searchaction() in controller: public function searchaction() { $q = $this->request->get("q"); $sort = $this-&

python - Get a classification report stating the class wise precision and recall for multinomial Naive Bayes using 10 fold cross validation -

i have following piece of code uses nb classifier multi class classification problem. function preforms cross validation storing accuracies , printing average later. instead want classification report specifying class wise precision , recall, instead of mean accuracy score in end. import random sklearn import cross_validation sklearn.naive_bayes import multinomialnb def multinomial_nb_with_cv(x_train, y_train): random.shuffle(x) kf = cross_validation.kfold(len(x), n_folds=10) acc = [] train_index, test_index in kf: y_true = y_train[test_index] clf = multinomialnb().fit(x_train[train_index], y_train[train_index]) y_pred = clf.predict(x_train[test_index]) acc.append(accuracy_score(y_true, y_pred)) if not perform cross validation have is: sklearn.metrics import classification_report sklearn.naive_bayes import multinomialnb def multinomial_nb(x_train, y_t

php - How to disable cache in open cart CMS -

i used set $expire = 0; in cache.php files. delete cache folder. put $this->cache->delete(); in random files. use ctrl+f5 in brouser. cache still alive. easiest way return false cache->get method: system/library/cache.php: public function get($key) { return false;

c - Why do names that are not part of the implementation still use the double underscore naming convention? -

aren't double underscores reserved implementation? i'm referring this . people seem ignore convention time. here's code: signed int __cdecl upload_exploit() { int device_type; signed int payload_address; int free_address; int deviceerror; char *chunk_headers_ptr; ... here convention defined: in addition names documented in manual, reserved names include external identifiers (global functions , variables) begin underscore (‘_’) , identifiers regardless of use begin either 2 underscores or underscore followed capital letter reserved names. library , header files can define functions, variables, , macros internal purposes without risk of conflict names in user programs. edit: although bad example, spirit of question still stands: have seen programmers "incorrectly" use double underscore. connotation carry? trying convey function/keyword? people write lot of things invalid c. lack of strictness compilers principal reason they&

c# - Expose boolean property in list of of objects to a WPF Checkbox -

Image
i have working wpf mvvm app. i'm attempting expose list of mappable objects called targets. targets populated after app start. , exposed via viewmodel set targetfilter usercontrol data context. in targetfilter control listbox expose bool property called showonmap. able expose data via dictionary, clunky , not way turn targets on off. plus hacky , breaks databinding of mvvm. public class target { public int index { get; set; } public int targetid { get; set; } public targetlocation lastlocation { get; set; } //lastlocation contains lat long etc. public string name { get; set} public bool showonmap { get; set; } } on user session object have observablecollection: public observablecollection<target> targetcache; i have view model exposes data public class mapviewmodel : viewmodelbase { private serversession _serversession; public observablecollection<target> gettargetcache { { //if (_serversessio

flash - Web based audio/video chat api provider (no webrtc) -

i had developed video chat script website opentok flash.but opentok stopped flash service 6 months ago , force clients use webrtc solutions.so application has became useless because of this. for moment webrtc limits developers key points. i need access user's audio/video device list programmatically via user's browser able enumerate them, able design custom device selection window.(this can done google chrome if infrastructure webrtc.but want major browsers.) i need able make multiple streams same user different audio/video sources. flash based providers working fine needs above, can no longer find 1 now. can lead me find paid/free api provider needs ? thanks in advance. just wanted let know opentok in fact able support device enumeration across chrome, firefox, , ie (with plugin) soon. within couple weeks, next version of firefox (39) released, , opentok.js have release, normalize different apis offered browsers 1 api use called ot.getdevices() . also

python - Fastest data structure for numerically indexed data structure? -

i using regular python 2.79 , want use standard libaries. want create 2 dimensional array, each cell referenced 2 dimensions point small dictionary of miscellaneous data. want fastest way access cell containing dictionary. data have 2 integer indexes can reference each cell. know x , y (let's call them..) 1) x , y elements have permissible values between -58600 , +58600. 2) not every cell contain information, need , cell data numerical x,y index. 3) contents of data cell size or configuration , change on time, upgrade code or include new parameters, etc. my first thought nested dictionary such that dictionary_structure[x][y]["data"] would data .. or test exists by if "data" in dictionary_structure[x][y]: what sort of data structure should use fastest lookup? i think performance improve if have 1 top-level dictionary, rather 1 each dimension. here few possibilities: use tuples: if (x, y) in dictionary_structure: print(dic

vb.net - MySQL DataGridView bind -

i have following code connect mysql server dim oconn mysqlconnection dim sconnstr string dim odbadapter mysqldataadapter dim otable data.datatable sconnstr = string.format("server=localhost;user=user; password=pass; database=db; pooling=false") ' oconn = new mysqlconnection(sconnstr) oconn.open() otable = new data.datatable() odbadapter = new mysqldataadapter("select * test", oconn) datagridview1.datasource = otable odbadapter.fill(otable) this code works, however, when switch order of last 2 row dim oconn mysqlconnection dim sconnstr string dim odbadapter mysqldataadapter dim otable data.datatable sconnstr = string.format("server=localhost;user=user; password=pass; database=db; pooling=false") ' oconn = new mysqlconnection(sconnstr) oconn.open() otable = new data.datatable() odbadapter = new mysqldataadapter("select * test", oconn) odbadapter.fi

html - How to get rid of tiny gap between floated elements? -

i float 2 divs on html page that: http://5toneface.eu/temp/ (ignore php-warnings). between ruutleft , ruutright div there small gap or white border-like stripe. how rid of it? ruutleft , ruutright divs sides side-to-side exactly? html is: <!doctype html> <html lang="et"> <head> <title>dynamint</title> <link rel="stylesheet" href="style.css" type="text/css" > <link rel="stylesheet" href="navistyle.css" type="text/css" > <script src="script.js" type="text/javascript"></script> </head> <body> <div id="wrp"> <div id="header"><?php include("includes/header.php"); ?></div> <div id="container"> <div class="ruutleft">ruutleft</div> <div class="ruutright">ruutright</div> <div class="c

angularjs - How to show and hide element in my case -

i trying create directive modal can use on other place. i want modal pop when user something. use ng-show hide it. my html <my-modal ng-show="showmodal" data-text="my text"></my-modal> my directive angular.module('myapp').directive('mymodal', ['$modal', function($modal) { return { restrict: 'e', scope: false, link: function(scope, elem, attrs) { $modal({ template: '<div>{{scope.attrs.text}}</div>' scope: scope, }); } }; } ]); my controller angular.module('myapp').controller('tctrl', ['$scope', function($scope) { $scope.showmodal = false; } }]) for reason, can't hide modal , pops when page first loads. how hide when page first loads? help! the link function runs directive loa

javascript - Simple-Jekyll-Search will no longer trigger on-click after firing smoothState -

i trying implement on-click search event, using simple-jekyll-search on page smoothstate . after following suggestion written in question: how simulate button press in javascript, trigger searching in simple-jekyll-search , , adding following snippet library, appears onclick event no longer triggers search event after smoothstate loads new page. $('#yourbutton').click(function(){ render( searcher.search(store, opt.searchinput.value) ); }) any suggestions appreciated. there's section in faq section of readme might help. here's excerpt: help! $(document).ready() plugins work fine when refresh break on second page load. smoothstate.js provides onafter callback function allows re-run plugins. can tricky if you're unfamiliar how ajax works. when run plugin on $(document).ready(), it's going register on elements on page. since we're injecting new elements every load, need run plugins again, scoping new stuff.

python - ValueError when inserting data into numpy Array -

i trying insert data dataframe df numpy array matrix_of_coupons_and_facevalues . however, need add value associated row of df['coupon'] each column of corresponding row of array many columns number numberofcoupon_payments = row1['months_to_maturity']/6 . error valueerror: not broadcast input array shape (1,2) shape (1,61) in line np.insert(matrix_of_coupons_and_facevalues, row_no+1, rowtobeadded, 0) , understand why, don't know how proceed. the code using follows: matrix_of_coupons_and_facevalues = np.zeros((number_of_rows_and_columns, number_of_rows_and_columns)) rowtobeadded = np.zeros(number_of_rows_and_columns) (i1,row1) in df.iterrows(): numberofcoupon_payments = row1['months_to_maturity']/6 row_no in range(int(number_of_rows_and_columns)): index_no in range(int(numberofcoupon_payments)): coupon = row1['coupon'] rowtobeadded = np.full((1,

AngularJS: Under what specific circumstances is a promise returned by $http rejected? -

i'm pretty new angular (or javascript in general) , have dumb question here. understand how promises work, under specific circumstances promise returned $http request ( put or get or whatever) rejected? i'm pretty sure if request times out promise rejected; other errors 404 or 403? couldn't find such information angular docs... lot! if somehow $http error occur, promise rejected. $httpprovider based on interceptor pattern , every request/response pass through pipeline handles error. the default interceptor, built in angularjs this, reject promise: 'responseerror': function(rejection) { // on error if (canrecover(rejection)) { return responseornewpromise } return $q.reject(rejection); //<------ rejecting promise here given http error } you can build , attach own interceptor inside $httpprovider handle specific errors (400, 500, etc). take @ interceptor section, under $http documentation.

plot - how can i combine these 3 matlab graphs to a single one? -

Image
hello have these 3 polar plots: polar(a,(v1).^(-1),'-r') polar(a,(v2).^(-1),'-g') polar(a,(v3).^(-1),'-m') where v1,v2,v3 matrices , how can combine these 3 graphs single 1 (not subplot , more copyobj)? note: axes remain same in every graph. thank you you can use hold on other types of graphs. example: clear clc close figure; theta1 = 0:0.01:2*pi; rho1 = sin(2*theta1).*cos(2*theta1); theta2 = 0:0.1:2*pi; rho2 = cos(2*theta2).*cos(2*theta2); theta3 = 0:0.1:2*pi; rho3 = cos(2*theta2).*tan(2*theta2); polar(theta1,rho1,'--r') hold on polar(theta2,rho2,'-b') polar(theta3,rho3,'-g') output:

android - JavaCV bad install on AndroidStudio. Couldn't find *.so -

Image
i'm develloping application android using android studio. built camera part of application camera2 api, want process images using javacv (to frames going on , imagereader, give me yuv_420_888 frames can't save in shape). so followed manualy install tutorial of javacv androidstudio here : https://github.com/bytedeco/javacv when write code, library found. when execute : opencv_highgui.cvcapture capture = opencv_highgui.cvcreatecameracapture(opencv_highgui.cv_cap_android); i got (warning, lot of crap down there): 07-01 18:00:41.649 9655-9655/ca.uqtr.camera2videobasic e/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r2.2.0.so", rtld_lazy) failed: dlopen failed: cannot locate symbol "_zn7android6camera10disconnectev" referenced "libnative_camera_r2.2.0.so"... 07-01 18:00:41.653 9655-9655/ca.uqtr.camera2videobasic e/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_

angularjs - JQuery File input element inconsistently fires in Chrome when wrapped in $timeout -

so, have directive handling file uploads, (wraps around angular-file-upload), , in instances directive wraps anchor tag. anchor tag's click event results in $apply being run when directive runs following code, .fileuploadinput element <input type="file" /> : fileuploadclick = (event: any) => { this.element.find('.fileuploadinput').click(); }; to solve problem wrapped in $timeout : fileuploadclick = (event: any) => { this.$timeout(() => { this.element.find('.fileuploadinput').click(); }); }; in chrome 43 (not ff/safari), file picker requires multiple click events before opening os picker. can see function call inside timeout run each time, intermittently os picker open. removing $timeout cause picker open every time, cause $apply in progress error. does 1 have idea cause adding timeout cause behavior in chrome? alternatively, there way stop existing $apply or way wait outside of $timeout ? $interval causes same pr

c# - Unity 5 - Playerprefs saving in unity but not on android? -

i have attached hero object gets destroyed . part of problem? want save highscore display on start scene. here code: public int highscore; public int score; void addpoint1() { if (score > highscore) { highscore = score; playerprefs.setint ("highscore", score); playerprefs.save (); } } here second script attached empty object in start scene (different scene) void ongui() { gui.label (new rect (screen.width / 2, screen.height/2, 100, 100), "highscore: " + playerprefs.getint("highscore"), customguistyle); } from knowledge of unity not need call playerprefs.save(), i've noticed have highscore stored locally , never defined, therefore comparing score null value. new code this: public int score; void addpoint1() { if(score > playerprefs.getint("highscore")) { playerprefs.setint("highscore", score); } } also if set highscore something, 1.

javascript - Use wildcard in src attribute of <script> tag? -

ok, stupid question , don't think it's possible but, have markup @ top of .aspx page... <%--third party libraries, plugins, extensions --%> <script src="libraries/raphael/raphael.js" type="text/javascript"></script> <script src="autocomplete/jquery.autocomplete.js" type="text/javascript"></script> <script src="libraries/jquery/1.4.2/jquery.js" type="text/javascript"></script> <script src="libraries/jquery/ui/1.8.4/jquery.ui.core.js" type="text/javascript"></script> <script src="libraries/jquery/ui/1.8.4/jquery.ui.widget.js" type="text/javascript"></script> <script src="libraries/jquery/ui/1.8.4/jquery.ui.mouse.js" type="text/javascript"></script> <script src="libraries/jquery/ui/1.8.4/jquery.ui.draggable.js" type="text/javascript"></script> &

Visual C++ system command batch file -

when type name of batch file on command line, executes fine, when run vis c++ program uses system("gen.bat") command, doesn't execute it! here how i'm doing it: int ret = system("gen.bat"); you should specify full path of batch file this: int ret = system("c:\\folder_name\\gen.bat");

Nashorn/Rhino to convert a string from Java to Javascript -

i'm using play framework , have .java controller file in obtain array of strings. want pass java array html file use javascript in order plot data using flot charts . data "transfer" done in render. this: string[] array = new string[list.size()]; int = 0; (sample sample : list) { array[i++] = sample.getcontent(); } render(array); but when i'm unable call variable in .html file inside views folder. if use ${array}, firebug tells me not recognize valid js string array. i've read rhino or nashorn trick, not know if best , simplest option. ideas? thanks! i'm not familiar play framework i'm doing similar stuff using sparkjava in both java , javascript (using nashorn). i suggest use boon library generate json: https://github.com/boonproject/boon . here's small nashorn snippet speed, adaptable java: // 1st create factory serialize json out var jso = new org.boon.json.jsonserializerfactory().create(); // 2nd directly use boon on

How to write all the records from the mysql database with PHP? -

como escribo todos los registros de la base de datos mysql con php? tengo este código y cuando genero el documento solo me escribe el último registro de la base de datos. quiero obtener todos los registros pero ya no se como; lo que observe es que estoy reasignando los valores, pero no se como corregir esto. saludos translation bilingual person: i have code , when generate document writes (outputs?) last row in database. want obtain rows not know how. observe reassigning values, don't know how correct this. cheers. $servername = "localhost"; $username = "root"; $password = ""; $dbname = "codeigniter"; //establecemos la conexion $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select timestrap, numero, ip, codigo, estado, url, puerto, resolucionaccion regi

Does app store or / and Play Store allow apps that have a WebView only to my site? -

i want publish app witch contains webview site only. , thats whole app. mobile web app comes stores. apple/ google allow it? 10x yes, can published app contains webview of own website. please note according google play developer program policies , it's not allowed publish apps provide webview of website don't own or administer: do not post app primary functionality to: provide webview of website not owned or administered (unless have permission website owner/administrator so) reference: http://play.google.com/about/developer-content-policy.html according apple's app store review guidelines , apps web views not allowed: functionality 2.12 apps not useful, unique, web sites bundled apps, or not provide lasting entertainment value may rejected. reference: https://developer.apple.com/app-store/review/guidelines/#functionality

linux - Consequences of using kill -9 for node processes? -

when reading mongodb's documentation 1 of thing stood out was: warning : never use kill -9 (i.e. sigkill) terminate mongod instance. i've been running issues while using foreman start start node server. foreman start multiple node processes same pid. however problem when stop node process, node won't stop running , continues use port listening on. to work around i've been using sudo kill -9 <pid> node process want terminate. there negative consequences doing this? also, why mongo warn against using kill -9 terminate mongod instance? it doesn't give process chance cleanly: 1) shut down socket connections 2) clean temp files 3) inform children going away 4) reset terminal characteristics these bad consequences of can happen when use kill -9 . should use kill -9 last resort if else has failed. and second question, because kill -9 kill process if in middle of doing while kill shutdown process after clean exit.

css - How to stylize the jquery countdown -

i using jquery countdown source contains javascript needed make countdown works. wondering how can same "animated" style "black countdown" here http://hilios.github.io/jquery.countdown/ the source of main.css styles follows: /** * main module */ main a, main a:link, main a:visited { color: #777; text-decoration: underline; } main a:hover, main a:active, main a:visited:hover { color: #000; text-decoration: underline; } main article { padding: 1em; } main [class*="pure-u-"]:first-child article { padding-left: 0; } main [class*="pure-u-"]:last-child article { padding-right: 0; } @media screen , (max-width: 48em) { main article { padding: 0 !important; } } .main-example { margin: 0 auto; width: 355px; } .main-example .countdown-container { height: 130px; } .main-example .time { border-radius: 5px; box-shadow: 0 0 10px 0 rgba(0,0,0,0.5); display: inline-blo

c# - AutoResize Not Working Properly When ColumnHeader Is Longest String -

Image
dgvsampled.autoresizecolumns(datagridviewautosizecolumnsmode.allcells); i'm trying size columns allcells mode. problem when longest string in column header, buffer left over. compare requested column coil # column. why coil # column size content, requested column sizes large header title? after making columns unable sorted, being sized expected them in first place. from documentation (emphasis mine): allcells: column widths adjust fit contents of cells in columns, including header cells . from description, seems want datagridviewautosizecolumnsmode.allcellsexceptheader

javascript - Function inside object -

well, don't know if return in transform function can work, but, know if there way can similar this? put function inside object... var t = $(this).scrolltop(); var h = $(window).height(); function transform(val){ return "-webkit-transform": "translatey(" + val + "%)", "-ms-transform": "translatey(" + val + "%)", "transform": "translatey(" + val + "%)"; } $("#header").css({ opacity: 50 * (t/h), tranform(50 * (t/h)) }); you use css extension language (like less or scss) handle variables, process , use simple stylesheet. if want stick js, suggest returning hash transform , extending later, like: function transform(val) { return { "-webkit-transform": "translatey(" + val + "%)", "-ms-transform": "translatey(" + val + "%)", "transform": "translatey(" + v

templates - In WPF how does Panel render its content? -

i know can inherit panel class , use (measureoverride , arrangeoverride) measure , arrange ui-elements. how panel class render content without template? panel inherits frameworkelement class not have concept of template. causes render?

command line - Creating new file with Node.js and Express -

i'm trying learn how use node.js , packages. i'm in command prompt (i'm on windows), changed directory project folder. installed express package: npm install express --save the npm installed express package. now, while i'm still in directory, i'm trying create new file: touch index.js but file isn't created , i'm getting following message: 'touch' not recognized internal or external command, operable program or batch file. why that? doing wrong? touch no windows command. in this answer , suggest equivalent: echo $null >> filename

node.js - node server available at port 80, but specified 3000 (iptables) -

i have serious problem! have set first root server , have no experience server security. used run node apps on localhost have run app on server. node app works. have specified in index.js file server listens on port 3000. app loads without problem on port 3000 available @ port 80. wtf? currently iptables file allows testing purposes. file looks this: -a input -j accept -a forward -j accept -a output -j accept if makes difference or has issue... what reason app listening on port 80? ps: app available @ 80 , 3000, tested. im using express framework btw... i found solution. feel stupid :) playing around iptables have no idea tool :-/ after blocking myself out 2 times, found out looking @ wrong file. there port redirect in nat table... i couldnt see because looking @ wrong file so nevermind :-) thank hint!

javascript - How to execute two asynchronous function in sequence -

how make asynchronous javascript function execute in sequence socket_connection.on('request', function (obj) { process(obj); }); function process(obj){ readfile(function(content){ //async //read content //modify content writefile(content, function(){ //async //write content }); }); } this results in sequence: read content read content modify content modify content write content write content how can enforce: read content modify content write content read content modify content write content what want known blocking. in case want block second or consecutive request until first request completes. my honest opinion - nodejs not suitable platform if want block call. nodejs not able perform freely should be. that being said can similar - var isexecuting = false; socket_connection.on('request', function (obj) { // in other languages have done similar // while(isexecuting); // ma

javascript - Generate two webpack packages with slightly different configs at once -

i'm trying generate twice amount of packages/chunks in webpack difference 1 loads includepaths of ie9 styles , other doesn't, , lazy load 1 package or other depending on browser. i've got lazy loading part down i'm not sure how generate bundles. here's standard config relevant parts being scss loader , apppaths variable set @ top: var fs = require('fs'), path = require('path'), webpack = require('webpack'), apps = fs.readdirsync('./app'); appmoduleregex = new regexp("^(" + apps.join('|') + ")/(.*)$"), apppaths = apps.map(function(appname) { return 'app/' + appname + '/src'; }); entrypoints = {}; apps.foreach(function(appname) { entrypoints[appname] = [ 'webpack/hot/dev-server', appname + '/app' ] }); entrypoints['vendor'] = [ 'classnames', 'd3', 'fetch', 'lodash',

javascript - How do i overwrite protractor.conf.js values from the command line? -

i have protractor setup run on our integration server. inside protractor.conf.js file have following: multicapabilities: [{ 'browsername': 'firefox', 'platform': 'mac' }, { 'browsername': 'chrome', 'platform': 'mac' }] i override when running locally command line. i've tried following no success protractor --verbose --browser=chrome question: how switch using single instance of chrome when running locally command line? this problem. according source code , browser command line argument alias of capabilities.browsername . according referenceconf.js documentation : // if run more 1 instance of webdriver on same // tests, use multicapabilities, takes array of capabilities. // if specified, capabilities ignored. multicapabilities: [], in other words, since multicapabilities specified, capabilities ignored. what can try reset multicapabilities command-line: protr