Posts

Showing posts from March, 2013

teamcity - Moving files between build chain builds -

what set required move files between builds in tc? needing move both modified source files , build binaries between build configurations of build chain. i have 1 project 4 builds. builds update version number (this build updates 15 sources files) compile (this build compiles dozen objects) test (this build runs regression test) create package (this build creates setup.exe file) information tc setup , chain i using perforce vcs. all 4 builds use same vcs root. on 4 builds under version control settings have "clean files before build" set "on". "update version number" build triggered check in vcs. (this works) i have been able chain , trigger builds. each build starts fresh copy of files vcs. the chaining set use snapshot dependency. based off of tc documentation looks should using snapshot dependency , not artifact dependency. if put build steps of builds same build works. looking have more flexibly , expand on build chain in futu

c++ - More variables or one more dimension in array variable? -

i heard less dimensions better, worth change method b (that use) a? optimal way of using array variables? example code in c method a: int var1[5][10][5][4]; int var2[5][10][5][4]; int var3[5][10][5][4]; method b: int var4[3][5][10][5][4]; i think if "better" or not depends lot on perspective, e.g. performance, readability, maintainability, consistency, , many more. there no clear answer question, , every answer might opinion based. anyway, "mix" both approaches, having separate variables "view" slices of "many-dimension"-array. pick "best" approach respective context: int main() { int var4[3][5][10][5][4] = { {{{1}}}, {{{2}}}, {{{3}}} }; int (*var1)[5][10][5][4] = &var4[0]; int (*var2)[5][10][5][4] = &var4[1]; int (*var3)[5][10][5][4] = &var4[2]; return 0; }

sql - Django: how to add a custom attribute to each element of queryset without N+1 request? -

suppose have basic user model name , age: class user(models.model): name = charfield() # e.g. john smith age = integerfield() # e.g. 21 i want filter users 18+ y/o , each of them add special attribute namesakes (for instance, "john smith" ["john williams", "john neumann", ...] ). i know, how in n+1 requests: for user in user.objects.filter(age__gt=18): user.namesakes = user.objects.filter(name__startswith=user.name.split()).\ all() but how do in one-ish request? ideally, each user object in queryset i'd create custom attribute namesakes contained queryset of namesakes. similar annotate() or prefetch_related() to_attr do, not exactly. i'd prefer avoid using raw sql, if possible. thank you. i found blog post , doing similar need and.... dear god... >>> django.db.models import f, q, case, integerfield, sum, value, when >>> django.db.models.functions i

python - Translate to using Tensorflow from Numpy -

i have following repo , in file lstm written using numpy. friend uses tensorflow , hasnt used numpy in years asked if translate file using tensorflow. how do this.

vuejs2 - Call Vue method from separate JS file compiled with webpack -

first time playing laravel 5.4 , vuejs2 , webpack . have ran issues regards js file scopes before , suspect issue related. i trying make vue instance method available called different js file. my weback.mix.js : mix.scripts([ 'resources/assets/js/app-main.js', <-- call vue method here 'resources/assets/js/app-helpers.js', 'resources/assets/js/common/chat.js', <-- vue instance ], 'resources/assets/js/output/app.js' ) .js('resources/assets/js/output/app.js', 'public/js/app.js' ); in chat.js have vue instance inside document ready wrapper (it receives route , channel values b/e): $(document).ready(function() { vue.component('chat-system-messages', require('../components/chat-system-messages.vue')); vue.component('chat-system-form', require('../components/chat-system-form.vue')); var chatsystem = new vue({ el: '#system-chat

Using chrome dev tool profiler from the console -

i found looks has looking for: https://chromedevtools.github.io/devtools-protocol/tot/profiler/#type-scriptcoverage how use profiler console? expected profile command there, it's not , couldn't find documentation on how access it. my end goal able write query gives me code coverage numbers single file. thanks!

Is there a class equivalent of custom annotations in java? -

i need have set of annotated interfaces corresponding enum for eg: enum type { a, b, c } i using custom annotations ensure don't have define multiple annotations (there lot of types in use case) @interface typeannotation { type value(); } unfortunately there nothing can define interfaces this. hence, have make multiple classes like:- @typeannotation(type.a) public interface typeainterface {} @typeannotation(type.b) public interface typebinterface {} .... i don't need define inside these interfaces, need define annotated interfaces use in framework using. hence, looking analogue custom annotations save me boilerplate. a generic type generic class or interface parameterized on types. i'm looking generic interface parameterized on enum values.

PHP outputs mysqli row values outside while loop -

i trying output row values outside while loop this $sql = mysqli_query($connection, "select username accounts rank='admin'"); while($row = mysqli_fetch_array($sql)) { $username = $row['username']; } i output , print result outside while loop. tried print_r doesn't seem work, shows last or first value not all. you need save each value in array inside of while loop. while($row = mysqli_fetch_array($sql)){ //save in array $username[] = $row['username']; } //output values print_r($username); you need brackets [] save each value array. $username[]

java - Running android emulator on travis-ci and Push .apk file -

i have problem push apk file on emulator android travis. this config file. script: - adb install -r $travis_build_dir/last-app-version/myapp.apk travis start process install apk , in console. [100%] /data/local/tmp/myapp.apk /home/travis/build/last-app-version/myapp.apk: 1 file pushed. 3.7 mb/s (10766791 bytes in 2.768s) pkg: /data/local/tmp/app-staging-release.apk after awhile error. no output has been received in last 10m0s, potentially indicates stalled build or wrong build itself. check details on how adjust build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received build has been terminated

ios - How to use auto layout so my app fits all screen sizes in swift? -

Image
i need buttons stay in same positions phones. i want on iphones: but when switch larger size phone this, looks ugly on smaller phones well: that broad question, lot of ios ui depends on autolayout. suggest work through these tuts @ at least autolayout . screen shots, looks if have set width constraint on view green background instead of pinning leading, trailing, top, , bottom edges.

rubygems - Capybara Webkit installation -

hey first project in ruby , trying install capybara using the instructions here: https://github.com/thoughtbot/capybara-webkit/wiki/installing-qt-and-compiling-capybara-webkit i keep running error constantly. appreciated. windows 10 ruby 2.3 qt 5.9.1 path has c:\qt\5.9.1\msvc2015_64\bin , c:\ruby23\bin current directory: c:/ruby23/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0 c:/ruby23/bin/ruby.exe -r ./siteconf20170817-33208-1eyrgjv.rb extconf.rb *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=c:/ruby23/bin/$(ruby_base_name) --with-gl-dir --without-gl-dir --with-gl-include --without-gl-include=${gl-dir}/include --

Javascript that changes specific href link to new one? (no jquery) -

friends, can give me simple javascript change href link new 1 on posts in blogger blog. <a href="http://domainone.com/brb.php"> to become <a href="http://domaintwo.com/brb.php"> the problem domainone no longer available , need mass change when user asks domain directed new one. please no jquery oldschool javascript. regards! you can use .setattribute() , this: var links = document.getelementsbytagname('a') for(var i=0;i<links.length;i++){ if(links[i].getattribute('href') && links[i].getattribute('href').indexof('domainone') >=0 ) links[i].setattribute('href', 'http://domaintwo.com/brb.php'); } <a href="http://domainone.com/brb.php">link</a>

java - persisting data across all activities in Android extending the Application class -

so have looked online answer , seems straight forward there must i'm missing. here is: i'm trying persist data across activities in app. have created object store global data: package com.checkinsystems.ez_score.utils; import android.app.application; public class startupconfig extends application{ private string currentmatch; public startupconfig(){ currentmatch = null; } public startupconfig(string currentmatch) { this.currentmatch = currentmatch; } public string getcurrentmatch() { return currentmatch; } public void setcurrentmatch(string currentmatch) { this.currentmatch = currentmatch; } } in manifest have added name attribute application element this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="co

java - RecyclerView.Adapter hook method issue -

as title suggests have issue recyclerview adapter callback hooks. have 6 items in recyclerview , these views custom views have own logic, animations etc.. these views fine, , work expected. have issue when show framelayout on recyclerview layout. framelayout nothing special, , change visiblity gone visible . when happens recyclerview calls these methods: @override public void onviewdetachedfromwindow(recyclerview.viewholder holder) @override public void onviewdetachedfromwindow(recyclerview.viewholder holder) @override public void onviewrecycled(recyclerview.viewholder holder) these called positions (0 - 5). @ point stop animations in custom views, , reset them ready state. far seems reasonable, views obscured, these hooks called. the issue when set overlay framelayout visible gone again recyclerview calls onbindviewholder first 4 positions (0-3), not called positions 4 & 5 (confirmed break points , logging). means views in these positions don't i

sql - Speed up "find or create" postgres query that searches from id and timestamp -

i've got postgres query i'm using "find or create" record, however, taking ~60-80ms complete ~20k rows, , part of loop. running whole loop starting drag out, @ ~20s, , getting longer (the whole loop inside transaction). i'm using market_id , timestamp select rows. i suspect timestamp field giving me trouble, i'm not sure. i'm using in c. here how create table: create table market_summary( id serial primary key, market_id int, market_name varchar(20), high float, low float, volume float, last float, base_volume float, timestamp timestamp, bid float, ask float, open_buy_orders int, open_sell_orders int, previous_day float, market_creation_date timestamp, created_at timestamp default current_timestamp, updated_at timestamp default current_timestamp ) and here sample of query i'm using: insert market_summary(market_id,market_name,high,low,volume,last,base_volume,timestamp,bid,ask,open_buy_orders,open_sell_or

javascript - Using html5 <video> tag to let the video pause when clicking next in BXSLIDER -

isn't there simple code pauses html 5 video when click on next button? hard find on google, searched 2 hours , found nothing or didn't work. i use bxslider client in page https://www.gester.nl/mbarara/about scroll down see videoslider. said above problem when click arrownext previous video keeps playing can hear. i find annoying when simple can't have simple code. can please me problem? thank taking time me problem. this code: <h1> choose between 8 video's </h1> <!-- video plugin --> <ul class="videoslider"> <li> <div id="content"> <video class="myvideo" controls > <source src="video1.mp4" type="video/mp4"> </video> </div> <div id="videocover"></div> <div class="overlay"> <pppp>video number 1</pppp> <pp>swipe or touch left/right arrow<

java - JSON using loopj android listview failed -

heyy im doing movie project,i want use parsing json lisview,im using loopj library, im implement code,but not work,the listview still empty,i dont know error code, show item class first, public class movieitem { private int id; private string title; private string description; private string rate; public movieitem(jsonobject object){ try { string title = object.getjsonarray("results").getjsonobject(0).getstring("title"); string description = object.getjsonarray("results").getjsonobject(0).getstring("overview"); double movieratet = object.getjsonarray("results").getjsonobject(0).getdouble("vote_average"); string movierate = new decimalformat("#.#").format(movieratet); this.title = title; this.description = description; this.rate = movierate; }catch (exception e){ e.printstacktrace(); } } public int getid() { return id

hibernate - spring-data-jpa to insert using @Query & @Modifying without using nativeQuery or save() or saveAndFlush() -

i have seen these links how use jpa query insert data db? uses nativequery=true how insert db in spring-data? suggests using built-in save method (there saveandfulsh() method) my example below: person simple entity w/ 3 fields "long id, string name, integer age", and, maps corresponding person table w/ 3 columns per above) @repository public interface dualrepository extends jparepository<dual,long> { @modifying @query(? - goes here - ?) public int modifyingqueryinsertperson(@param("id")long id, @param("name")string name, @param("age")integer age); } is there way insert using @query & @modifying (i.e. without using native sql query & nativequery=true, or, save(), or, saveandflush() ? after trying several things, there way depends on db you're using. below worked me in oracle & 1 row inserted table (using dual table because can use "from dual" after "select"):

microsoft dynamics - How to generate Data Matrix Barcode from Nav 2015? -

i searched lot regarding data matrix code generation nav 2015 not proper solution though, got code below link still, of automation variables not there in navision, need guys on this, there code unit or object or other way in nav.. http://www.barcode-soft.com/dynamics-nav-barcode.aspx

bash - SQLITE3 Import .csv via Mac Terminal and Skip the First Row -

i have thousands of .csv files i'd import sqlite3 database. each .csv file has labels on first row. my idea run loop on file names , import them using .import command: sqlite3 options.db ".mode csv data" ".import $f data" the problem import first row contains labels. question: how .import .csv files without importing first row of each file? thanks helping! :d assume file1.csv looks this: file1,line1 file1,line2 file1,line3 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 1,2,3,4,5,6 and file2.csv looks this: file2,line1 file2,line2 file2,line3 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 1,2,3,4,5,6 then can make awk print csv files whilst skipping first line (where fnr , i.e. file line

jquery - Bootstrap 3 columns shifting over horizontially after fixed positioning is applied -

Image
i having issue 2 of bootstrap columns shifting left when 'position: fixed' property applied far left sidebar column. fixed position property applied once column hits top of window, otherwise column static. doing jquery. prior jquery code firing , applying fixed position property, aligned properly. thinking once fixed position added far left sidebar column, there "void" , 2 columns in question shift left fill it. here code below further detail. apologize if explanation unclear! html : #fixed1 is far left sidebar column being fixed once page scrolls top of browser window. commented "shifting column 1" & shifting column 2" next 2 columns shifting left after #fixed1 changed fixed position via jquery. <div class="container-fluid"> <div class="row" id="places-container"> <!-- begin places side box --> <div class="col-md-2" id="fixed1">

css - How to draw cross diagonal lines without using SVG or HTML Canvas -

how draw cross diagonal lines without using svg or html canvas ? my tutor hope use simple css make it. here's 2 diagonal lines forming x using css , 1 element. .x { width: 100px; height: 100px; position: relative; } .x::before, .x::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-right: 1px solid #000; } .x::before { transform: rotate(45deg) translate(-50px, 0); } .x::after { transform: rotate(-45deg) translate(-50px, 0); } <div class="x"></div>

Create and add Documents to only 1 segments in Lucene -

i using lucene .net 4.8.0 apache lucene 4.8.0 i have situation have perform forcemerge 1 segment everytime indexing complete expensive there way lucene creates , adds documents 1 segment , not have forcemerge eveytime?

ionic framework - Inoic 3, Android: How to only allow number input field? -

i have input field this: .html file: <ion-input formcontrolname="codepin" type="tel" pattern="[0-9]*" class="itemborder" placeholder="only number" maxlength="4" style="-webkit-text-security:disc" [(ngmodel)]="codepin" (keydown)="isvalidnumber($event)"> </ion-input> .ts file: isvalidnumber(event) { //return /\d|backspace/.test(event.key); if ([8, 13, 27, 37, 38, 39, 40].indexof(event.keycode) > -1) { // backspace, enter, escape, arrows return true; } else if (event.keycode >= 48 && event.keycode <= 57) { // numbers 0 9 return true; } else if (event.keycode >= 96 && event.keycode <= 105) { // numpad number return true; } return false; } the problem is, runs ok in ionic serve's lab, ios

If I delete Azure Data Lake Analytics Account will it delete it's Default Data Source? -

i'm new azure, , trying out azure data lake analytics. i created new azure data lake analytics account testing purposes , delete now, used existing azure data lake storage (adls) account default storage account during setup. know should have added existing adls associated data store . i assume can safely delete azure data lake analytics account without affecting underlying default storage account, want check before massive problem if existing adls gets deleted. any pointers appreciated. thanks the 2 separate. deleting azure data lake analytics service not affect azure data lake store. as disclaimer, test test test. set instance of both in same way , confirm delete behaviour, 110% sure.

web - Subdomain take over with github? -

i have username on github "as name is" , subdomain otherusername.github.io , on subdomain github error pages there, search on google , found subdomain vulnerable subdomain take over, big question how claim on it? . is create repository on profile name "otherusername.github.io? , that's all. " if next? i want clear doubt. you need create user page you need name repository account name. you must use username.github.io naming scheme. content master branch used build , publish github pages site. that means need account right username ( otherusername ), , repo named otherusername.github.io .

excel - VBA enumerate through using enumchildwindows -

Image
i'm trying create excel document communications 1 of our external apps. i have sendmessage working in order wm_gettext specific window, can't next childwindow class names same: my first code grabs text first class under parentwindow named "windowsforms10.edit.app.0.2004eee" grange = findwindow(vbnullstring, "general account enquiry") account_number = findwindowex(grange, 0&, "windowsforms10.edit.app.0.2004eee", vbnullstring) the_count = sendmessage(account_number, wm_gettextlength, 0&, 0&) buffer$ = space$(the_count) call sendmessagebystring(account_number, wm_gettext, the_count + 1, buffer$) but need grab text circled red box, has same class name. have experience api calls class names unique. i've been told helpful stackoverflow contributor use enumchildwindows cycle through 5 other child windows of same name, after few days searching havn't been able find right code this. is able or provide example c

javascript - Export to excel a table with proper file name using jquery in IE and Mozilla both -

i have written code exporting table excel file in jquery. working fine me without proper file name. file name character, digits % sign. here code- function exporttoexcel() { var contents = $(".pvtrendererarea").html(); var ua = window.navigator.useragent; var msie = ua.indexof("msie "); if (msie > 0 || !!navigator.useragent.match(/trident.*rv\:11\./)) // if internet explorer { txtarea1.document.open("txt/html", "replace"); txtarea1.document.write(contents); txtarea1.document.close(); txtarea1.focus(); txtarea1.document.execcommand("saveas", true, "dataanalytics.xls"); } else { window.open('data:application/vnd.ms-excel,' + encodeuricomponent(contents)); // content id of div element } } how give proper file name can tell me? also export excel in ie above code, saving file in html format html content. how write code ie work properly? here txtarea1 iframe id added in asp

Unable to start jenkins on windows 7 -

i have used following command java –jar jenkins.war error occurred: picked _java_options: -xmx512m error: not find or load main class ?jar looks have copy-pased command internet, cause – character before jar isn't actual dash, special unicode character looks similar dash, isn't (thank microsoft). more specific character en-dash (u+2013). so if replace incorrect dash correct 1 - , command work: java -jar jenkins.war note might need type since browsers (looking @ ie) may auto convert incorrect characters!

How to restrict image upload maxsize to 2MB in CKEditor? -

i working on requirement of upload image in 'ckeditor' image uploaded should below 2mb size. using 'ckfinder' image upload, know there 'maxsize' option images in 'ckfinder\config.php' file, maxsize=0 there have changed '2000' , after tried upload image above 2mb still accepting image upload. observed here happening whenever user uploads image in ckeditor is doing image compression automatically , 2mb or above image getting compressed kb's. below code of config.php file: ckeditor/ckfinder/config.php $config['resourcetypes'][] = array( 'name' => 'images', 'directory' => 'images', 'maxsize' => 2000, 'allowedextensions' => 'bmp,gif,jpeg,jpg,png', 'deniedextensions' => '', 'backend' => 'default' ); ckeditor/config.js ckeditor.editorconfig = function( config ) { config.

arrays - AS3 How to i turn head of the Vector list? -

i have vector ip , port list , socket connection, when connection lose click button , call next ip , port vector list. my question when finish list how turn head of list ? this current code public class uriiterator { private var _availableaddresses: vector.<socketconnection> = new vector.<socketconnection>(); public function uriiterator() { } public function withaddress(host: string, port: int): uriiterator { const a: socketconnection = new socketconnection(host, port); _availableaddresses.push(a); return this; } public function next(): socketconnection{ return _availableaddresses.length ? _availableaddresses.pop() : null; } } thanks in current implementation can traverse list once. need change code keep list unmodified: public class uriiterator { private var _currentindex:int = 0; private var _availableaddresses: vector.<socketconnection> = new vector.<socket

.net - How to open service on computer inner exception access is denied? -

i invoking service inside service.when start service getting exception saying "cannot open service on computer" , inner exception "access denied". have tried running application administrator.changed app.manifest "highest rights" still no use.i added local computer name.i followed changes mentioned in similar questions. code steing[] parameter=new string[1]; parameter[0] = servicename+","+param; sc.machinename= "xyz"; sc,start(parameter); when run sc.start getting above said exception.thanks in advance

r - How to sample a dataframe column within a group without reordering of rows? -

i have r dataframe d2 2 columns i.e., "class" , "entry". "class" categorical variable , "entry" continuous given by d2 class entry 1 1 1 2 2 2 3 3 3 4 4 4 5 1 5 6 2 6 7 3 7 8 4 8 9 1 9 10 2 10 11 3 11 12 4 12 13 1 13 14 2 14 15 3 15 16 4 16 17 1 17 18 2 18 19 3 19 20 4 20 i want sample "entry" column within group given as ddply(d2,.(class),function(x) x[sample(nrow(x)),]) class entry 1 1 9 2 1 1 3 1 5 4 1 13 5 1 17 6 2 14 7 2 10 8 2 2 9 2 6 10 2 18 11 3 15 12 3 19 13 3 7 14 3 3 15 3 11 16 4 16 17 4 20 18 4 12 19 4 8 20 4 4 it visible desired results obtained order of "class" variable changed compa

Yammer OAuth2 REST authentication always gives same access token for different users -

we developing app, , integrating our app yammer, wanted post our app messages yammer, have office 365 login, , can able login in yammer office 365 account , post messages , not verified admin in yammer. first, nodejs code calls office 365 authentication checks in db whether bearer token available authenticated user if token not available in db, redirects yammer oauth authentication yammer authentication dialog box appears logged in user (new user, not registered app), registered in yammer redirecting access_token rest api getting duplicate access token https://api.yammer.com/oauth2/access_token rest api, received access token duplicate of user the problem, why am getting duplicate access token different users, thing have go impersonation, should verified admin user can help?, in advance. var express = require('express'); var passport = require('passport'); var bearertoken = require('express-bearer-token'); var strategy = requ

java - How to find count of duplicate elements in arraylist and append the dupplicate elements to different textviews -

how find count of duplicate elements in arraylist , append duplicate elements different textviews in andorid. i have 3 different textview , single arraylist contains 25 elements duplicate elements 1) how many duplicate values present in arraylist 2) count of duplicate values should append textview. collections.frequency gives occurrences of object in list. another option since small array sort , iterate, , in case array[i+1] == array[i] , increase count of duplicate values. if elements in case not primitive type, remember overload operator. sample implementation: void countocc(int []arr) { set<integer> uniques = new linkedhashset<integer>(); for(int x : arr) { uniques.add(x); } for(int y : uniques) { int totalocc = collections.frequency(arrays.aslist(arr), y); //gives total occurences each unique element in array } }

swift - How do I "combine" an un-zoned date and a time zone? -

Image
my question similar get "time time zone" "time without time zone" , time zone name (i think). want in swift. anyway, trying write function following signature: func combine(_ date: date, timezone: timezone) -> date? what takes in date , returns "zoned" date. if date not exist in time zone, returns nil . to avoid being xy question, here screenshot: i'm asking user date , time zone , want combine these 2 1 single date . i'll try best explain. express dates in format of timeintervalfrom1970 make clear possible. say pass in 0 date , gmt-1 time zone, it'll return 3600. 0 1970-1-1 00:00:00. 1970-1-1 00:00:00 in gmt-1 1970-1-1 01:00:00 in gmt, 3600. this how tried implement this: return date.addingtimeinterval(-timezone.secondsfromgmt(for: date)) this seems work not of time. however, don't think returns correct results if dst gets involved , whole thing becomes messy. feels "math-ish". prefer approach witho

16 bit - Can I make gcc treat an 'int' as 16 bits on an x86 platform? -

i developing code proprietary architecture. development environment consists of half-ported gcc 4.3 available windows, , primitive ide. because of this, develop on linux primary environment, using newer gcc nicer warnings. however, maximize number of relevant warnings gcc work 16-bit ints while still being able run on native x86 platform. can think of 3 ways of doing this, in order of preference: a flag makes 'int' 16-bit integer. far have not found any. -m16 not seem it, maybe 1 of architecture options it. a flag turns on warnings things might problem if int 16 bits, if int 32 or 64 bits in actual code. can happen due integer promotions , hard see @ glance. compiler warnings helpful here. a compiler flag when building gcc. build custom x86 version of gcc, treats 'int' 16 bits. there such option?

c++ - What does it mean by setting the failbit/badbit/eofbit? -

what mean "setting failbit" - can infer underlying code failbit set ( it non-zero ) before when error occurs - on passing input t value of failbit still remains same - why remains same before ` #include <iostream> using namespace std; int main() { int i; if(cin.good()) { cout<<"all good"<<endl; cout<<"rdstate: "<<cin.rdstate()<<" failbit: ". <<cin.failbit<<endl; } cin>>i; while(cin.fail()) { cout<<"failed"<<endl; cout<<"rdstate: "<<cin.rdstate()<<" failbit: ". <<cin.failbit<<endl; break; } return 0; }

momentjs - Which version of moment.js support react-native v0.38 -

i want use moment.js react-native v0.38 . when install moment.js using following command in terminal. npm install moment then shows dependency error. so, please guide me version of moment.js , can use react-native v0.38 . you can install moment along it's dependencies. npm install --save moment react-moment

how to exclude Hosts from IP range from scanning inside nmap python script -

would appreciate advice how exclude hosts scanning inside nm.scan().i have following script works when enter range : example 10.0.0.0/24 import sys import os import subprocess import csv import nmap # import nmap.py module try: nm = nmap.portscanner() # instantiate nmap.portscanner object except nmap.portscannererror: print('nmap not found', sys.exc_info()[0]) sys.exit(0) except: print("unexpected error:", sys.exc_info()[0]) sys.exit(0) file = raw_input('\nenter name of file scan saved/add .csv/: ') ip_range = raw_input('\nenter ip range want scan/in following foramt:x.x.x.x/mask: ') nmap_arguments= raw_input('\nenter nmap arguments : ') nm.scan(hosts=ip_range, arguments= nmap_arguments) nm.command_line() # command line used scan nm.scaninfo() # nmap scan informations {'tcp': {'services': '22-443', 'method'nect'

php - YII2extend yii2-queue -

the official example:: $id=yii::$app->queue->push(new downloadjob([ 'url' => 'www.baidu.com', 'file' => '111-txt', ])); // 将作业推送到队列并获得其id // 这个作业等待执行。 $res_waiting=yii::$app->queue->iswaiting($id); // worker 从队列获取作业,并执行它。 $res_reserved=yii::$app->queue->isreserved($id); // worker 作业执行完成。 $res_done=yii::$app->queue->isdone($id); file_put_contents('queue.json',json_encode( [ 'id'=>$id, 'waiting'=>$res_waiting, 'reserved'=>$res_reserved, 'done'=>$res_done ] ),file_append); downloadjob.php <?php namespace backend\controllers; use yii\base\object; class downloadjob extends object implements \yii\queue

PHP to SQL and email form submission -

i have working php form taking data form in backend of website , inserting sql database applicable. issue is, whenever try , set send data email address ( email captured in form & email defined ) recieve error 500. code below: <?php /* attempt mysql server connection. assuming running mysql server default setting (user 'root' no password) */ $link = mysqli_connect("#", "#", "#", "#"); // check connection if($link === false){ die("error: not connect. " . mysqli_connect_error()); } // escape user inputs security $name = mysqli_real_escape_string($link, $_post['name']); $initials = mysqli_real_escape_string($link, $_post['initials']); $item = mysqli_real_escape_string($link, $_post['item']); $issue = mysqli_real_escape_string($link, $_post['issue']); $tel = mysqli_real_escape_string($link, $_post['tel']); $email = mysqli_real_escape_string($link, $_post['email']); $co

java - Make button only visible when variable reaches certain value is not working -

im trying make cookie cliker "game" , current obstacle make button turns visible when have enough gold. code: (without start class) import java.awt.color; import java.awt.component; import java.awt.font; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.util.scanner; import javax.swing.icon; import javax.swing.imageicon; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jtextfield; import javax.swing.swingconstants; public class gui extends jframe implements actionlistener{ jframe jframe = new jframe(); private jbutton klick, upgrade1, miner1; private jtextfield punkte; static jlabel test; private jlabel pickaxe; private jlabel goldbarren; private jlabel minerlbl1; public static int minerkosten=200, pickaxekosten=50; public static int klicks=0; //dies ist ihre punkzahl. int k = 1; //diese variable gibt an, wieviel punkte