Posts

Showing posts from May, 2013

ios - The same URL, why urlsession gets wrong, but using NSURLConnection always succeeds -

let url = url(string: "https://soufunapp.3g.fang.com/http/sf2014.jsp?messagename=usercount&wirelesscode=dd146fd49861797918ada44b7e201180") let task = urlsession.shared.datatask(with: urlrequest(url: url!)) { (data, response, error) in print("always fail") if error != nil { print(error!) } } task.resume() nsurlconnection.sendasynchronousrequest(urlrequest(url: url!), queue: operationqueue.main) { (response, data, error) in print("always succeed") } error domain=nsurlerrordomain code=-1001 "the request timed out." userinfo={nsunderlyingerror=0x60000005ccb0 {error domain=kcferrordomaincfnetwork code=-1001 "(null)" userinfo={_kcfstreamerrorcodekey=-2102, _kcfstreamerrordomainkey=4}}, nserrorfailingurlstringkey= https://soufunapp.3g.fang.com/http/sf2014.jsp?messagename=usercount&wirelesscode=dd146fd49861797918ada44b7e201180 , nserrorfailingurlkey

python - How to find out number of unique values in a column along with count of the unique values in a dataframe? -

as per following data set want no number of unique values , count of unique values. my data set: account_type gold gold platinum gold output : no of unique values : 2 unique values : [gold,platinum] gold : 3 platinum :1 use pd.value_counts pd.value_counts(df.account_type) gold 3 platinum 1 name: account_type, dtype: int64 get number of unique well s = pd.value_counts(df.account_type) s1 = pd.series({'nunique': len(s), 'unique values': s.index.tolist()}) s.append(s1) gold 3 platinum 1 nunique 2 unique values [gold, platinum] dtype: object

entity framework - how to make current primary key update itself instead of table generating a new primary key Asp.net mvc -

Image
please bare me while explain issue having. i have application stores can complete questionnaire. within application have 2 tables db.storeaud(pk:auditid) contains stores information db.storequests(pk:reviewid) holds questions information. auditid foreign key in db.storequests table. now here issue if store complete questionnaire data saves in database, same store questionnaire again db.storequests creates new row in database new primary key value instead of updating previous row. please check following image more information, i highlighted row updated second row data. question how can update previous row if same store same questionnaire again. hope made since. db.storeaud [databasegenerated(databasegeneratedoption.identity)] [key] [column(order = 1)] public int auditid { get; set; } public string date { get; set; } public int storenumber { get; set; } public string storename { get; set; } db.storequests [databasegenerated

sql server - The multi part identifier "subscript0_1_.partenaire_id" can not be bound after upgrading hibernate from 3 to 4 -

so i'm building project hibernat 4.0.1.final , spring 3.2.3.release , i'm trying execute query stringbuffer requete = new stringbuffer("select distinct new ma.mamda.per.model.souscription(souscription.id, ") .append("souscription.numeropolice, souscription.dateeffet, souscription.cotisationperiodique.epargne.montant,souscription.produit.familleproduit.code, ") .append("souscription.garntieoptionnelle, souscription.dureecontrat, souscription.etat, ") .append(" souscription.souscripteur.nom, souscription.souscripteur.prenom,souscription.partenaire.libelle,souscription.partenaire.id,souscription.produit.libelle,assure.numerocompte, assure.nom, assure.prenom)") .append(" ma.mamda.per.model.souscription souscription left outer join souscription.souscripteur souscripteur") .append(" left outer join souscription.cotisationperiodique cotisationperiodique") .append(" left outer join sousc

c take a slice of an array by advancing the array -

i've got array of binary data in need count amount of times char sequence appears. @ moment defined function, find index of 'needle' in 'haystack' int indexof(const char *needle, int needlelen, const char *haystack, int haystacklen) { /.../ } it returns -1 if needle can't found, otherwise returns index. the next step run indexof in while -loop (till -1 ) count. my question is: whenever found index in haystack , how take slice of haystack first char's determined indexof have been chomped off? example: haystack hello_world , needle o . indexof return 4 . how take slice of hello world without first 4 chars? e.g. want _world my haystack hello_world, needle o. indexof return 4. how take slice of hello world without first 4 chars? e.g. want _world if index 4, need skip first 5 characters (remember indexing in c 0 based). that haystack + 4 + 1 . remember update size of haystack accordingly, not access off end it. or in c:

matlab - Find a value in a field of a cell array of structures -

having defined gnu/octave cell array dict = { [1,1] = scalar structure containing fields: id = integers vl = ... -2, -1, 0, 1, 2, ... [1,2] = scalar structure containing fields: id = positive integers vl = 1, 2, 3, 4, ... [1,3] = scalar structure containing fields: id = negative integers vl = -1, -2, -3, -4, ... } how find (in octave code, without looping!) structs have given value in field, say, containing 'integer' in id field, or -1 in vl field. update: command operate find(dict,'vl','-1') , returning 1, 3 , or 1 0 1 . a possible implementation of search function like: function arrayvalues = findinfield(mycellarray, inputfield, outputfield, fieldvalue) positions = ~cellfun(@isempty, regexp({[mycellarray{:}].(inputfield)}, fieldvalue)); arrayvalues = {[mycellarray{positions}].(outputfield)}; end for exact matching add ^ , $ beginning , end, respectively, of regular expres

Back and forth UTC dates in lua -

i'm having problems converting lua date timestamp , obtaining original date it. work non utc dates, not utc. currently example code is: local dt1 = os.date( "*t" ); print( dt1.hour ); local dt2 = os.date( "*t", os.time( dt1 ) ); print( dt2.hour ); print( "-=-=-" ); local dt1 = os.date( "!*t" ); print( dt1.hour ); local dt2 = os.date( "!*t", os.time( dt1 ) ); print( dt2.hour ); local dt2 = os.date( "*t", os.time( dt1 ) ); print( dt2.hour ); which yields output: 12 12 -=-=- 10 9 11 so, in second part, after obtaining timestamp using os.time( os.date( "!*t" ) ) ; don't know how obtain original date back. i'm doing wrong? working "date tables" in lua let dt "date table". example, value returned os.date("*t") "date table". how normalize "date table" example, after adding 1.5 hours current time local dt = os.date("*t&

php - PDO exception - SQLSTATE[HY000] [2002] An attempt was made to access a socket in a way forbidden by its access permissions in azure -

i have web app developed in php + mysql .where application deployed in azure trying access mysql @ machine. here above mentioned error displayed while connecting through azure mysql db works when try app locally system. these connection strings @ .env file db_connection=mysql db_host=10.79.40.233 db_port=3306 db_database=laravel db_username=blog db_password=root123 db_adapter=pdo_mysql i m using php 7.1.1 version. it may remote acces. try enable remote acces on azure web panel. pay attention connection parmeters. check if parameters correct (port , username, password ...)

osx - git status does not work properly with Virtualbox Shared Folders -

details host machine : macos sierra guest machine : ubuntu 64bits 16.04 lts virtualbox : 5.1.14 on host repository local now. initialized , have several [local] commits without single push remote. symptoms on host machine have parent folder git repository on it. have shared parent folder guest machine, after login on vm folder in /media/sf_parent . in terminal cd /media/sf_parent @ moment content seems shared. when change repo folder tried git status , output single file in repository tracked modified. the strange part git log delivers last commit have made on host. tried visually compare both "versions" of repository folder ls , same value "update date" , "file size" have different values "owner", "group" , "permissions". what problem? maybe virtualbox somehow not support this? might conflict on filesystem level "owner" , "permissions"? linux user administrat

html - How to avoid Wechat warning about visiting an external page? -

Image
i have site hosted on aws s3, cdn managed cloudflare. purposes site works fine, when try share through social media app wechat, warning (pictured below) , site doesn't render properly. doesn't happen consistently, when warning appears, site fails load properly. my first line of thought problems might different settings of s3 compared more standard apache server triggering security issue in wechat, , cloudflare might fix problem, doesn't seem have made difference. removing google analytics , cdn-ified resources doesn't seem have made difference. any thoughts or input on either weirdness in wechat browser's rendering rules or why s3 might triggering warning appreciated. running bit of wall here. tl;dr wechat shows warning top-level domains. site on .me tld, triggered warning. page rendering incorrectly based on warning (not sure why these 2 things connected) after messing around https (security issues) , removing cdn-ified assets (thought might

javascript - NodeJS MongoDB Dynamic Query -

i have nodejs server running express method @ '/api/jobs/'. when called querystring parameters url , make query against mongodb database jobs. example url: '/api/jobs/?groups=1,2&statuses=3,4' the mongodb query trying construct this: { $or: [{"group.id" : 1}, {"group.id" : 2}], $or: [{"status.id": 3}, {"status.id": 4}]} if run directly against database results need can't think of way of constructing query dynamically in javascript. attempt i've made gives me object $or property can exist once in proper json object. {$or : [{"group.id" : 1}, {"group.id" : 2}]} any ideas on how either using javascript or thorugh mongodb node api? firstly query properties, strings: const groupstring = req.query.groups; // === '1,2' const statusstring = req.query.statuses; // === '3,4' split @ commas , parse integers: const groupnums = groupstring.split(',').map(par

php - Weird result when taking date from mysql -

i want substract 2 dates , take result in minutes code bellow gives me answer want. $to_time = strtotime("2017-03-27 17:31:40"); $from_time = strtotime("2017-03-27 18:32:40"); echo "sunolo1: ".round(abs($to_time - $from_time) / 60,2). " minute"; but when try retrieve dynamically date mysql using php doesnt work returns 0. (date in table in timestamp) $d = new datetime("now", new datetimezone("europe/athens")); $datem = $d->format("y-m-j h:i:s"); $result = mysqli_prepare($con, "select date mytable id= ? "); mysqli_stmt_bind_param($result, 'i', $ids); mysqli_stmt_execute($result); mysqli_stmt_bind_result($result, $ddd); while(mysqli_stmt_fetch($result)){ $sunolo_krathshs = round(abs($ddd - $datem) / 60,2); echo "sunoloo: ".$sunolo_krathshs; } you need parse value of $ddd datetime object, since easiest way compare datetime

How to passing data between 3 activities (Android Studio) -

this question has answer here: how pass data between activities in android application? 38 answers enter image description here look @ image link above, how code simple passing data between 3 activities? activity 1: input name then click insert button then intent activity 2 activity 2: click show button then intent activity 3 activity 3: settext input name activity 1 maybe should have use setter getter? how? i need learning basic, :) in activity 1:on click listener of insert button put this: intent = new intent(activity1.this, activity2.class); string name = input.gettext(); i.putextra("name",name); startactivity(i); above code pass value activity 1 activity 2,i assume quite new android development go through link understand intents , starting activity now in activity2 values intent string name=ge

Vi equivalent to "meta =" in Emacs? -

i count characters in selected block of text, in emacs can use 'meta =', displays following: region has 7 lines, 417 characters. how can same in vi(m) ? in visual mode, g ctrl+g display word, character, line, , byte counts visually selected region. see :help v_g_ctrl-g .

java - Multilistmap - getting data from resultset -

i using linkedlistmultimap store values resultset . //map declaration: listmultimap<string, string> multimap = linkedlistmultimap.create(); while(rs.next()) { multimap.put(address,name); } database values : add1 phalani add1 vaishu when resultset stores data ,for same key both values stored. output of multi map : {add1=[vaishu ,phalani]} but output expect : {add1=[phalani,vaishu]} same stored in database .what can done.

angular4 - Toggle an auxiliary router outlet in angular -

i want toggle auxiliary/named router outlet : <a *ngif="asideshow$ | async link" [routerlink]="[{outlets:{aside: link}}]">toggle</a> the link variable either null or string required named outlet display. problem if asideshow$ observable emits null value, element dissapear... how can achieve without ngif ? want keep code reactive async pipe.

How can I install the MSVC++ Redistributable 2008 in silent mode using Install4j? -

i tried "run executable or batch file" action [info] com.install4j.runtime.beans.actions.misc.runexecutableaction [id 36]: execute action property arguments: [/q] property rollbacksupported: false property includeparentenvironmentvariables: true property workingdirectory: . property userollbackexecutable: false property rollbackexecutable: null property rollbackworkingdirectory: null property rollbackarguments: null property returncodevariable: property stdoutredirectionmode: log file property stdoutvariablename: property failonstdoutfileerror: false property stderrredirectionmode: log file property stderrvariablename: property failonstderrfileerror: false property stdinredirectionmode: no redirection property failonstdinfileerror: false property environmentvariables: {} property showwindowsconsole: false property keepconsolewind

c# - Initialize Collection of DataTemplates in XAML -

i have dependencyproperty public observablecollection<datatemplate> wizardtemplatecollection { { return (observablecollection<datatemplate>)getvalue(wizardtemplatecollectionproperty); } set { setvalue(wizardtemplatecollectionproperty, value); } } // using dependencyproperty backing store myproperty. enables animation, styling, binding, etc... public static readonly dependencyproperty wizardtemplatecollectionproperty = dependencyproperty.register("wizardtemplatecollection", typeof(observablecollection<datatemplate>), typeof(customwizardcontrol), new propertymetadata(new observablecollection<datatemplate>())); and want this: <custom:customwizardcontrol> <custom:customwizardcontrol.wizardtemplatecollection> <datatemplate> <rectangle></rectangle> </datatemplate> <datatemplate> <rectangle></rectangle> </datatemplate>

node.js unzip modules extract only few files -

we've been experimenting various node unzip modules (adm-zip, unzip, extract-zip) unzip large zip files. in of these modules, notice zipping happens first time. node server running continuously, if there request leads unzipping given .zip file again, notice above modules extract of files , rest of files in zip missed. everytime node server killed , restarted, first unzipping happens correctly , subsequently not. reason this? have tried cleaning directory extracted files written once done processing them, every subsequent unzipping goes empty directory. i had similar problem, , in case, root cause process getting terminated before extraction finished. the key make sure perform code can result in garbage cleaning after have finished extraction. in case, calling window.location (electron framework) under erroneous assumption call extract() of unzip module synchronous). here successful code me: fs.createreadstream(fp).pipe(unzipper.extract({ "path": dirna

AsyncStorage with ListView react native -

hi want make screen list can show user saved favourite. use local json file keep orginal data. , there want save favourite data on asyncstorage. asyncstorage returns promise , can't add on state. how can it? const ds = new listview.datasource({ rowhaschanged: (r1, r2) => r1 !== r2 }); let export default class list extends react.component { constructor(props) { let resultdata = new array; super(props) const datapoem = asyncstorage.getitem('poemdb', (err, result) => { = json.parse(result) return result }); console.log this.state = { datasource: ds.clonewithrows(datapoem), counter: 1, fontloaded: false, }; } as said, asyncstorage.getitem returns promise , must deal promise. need rely on response asyncstorage.getitem() may sure handled. can deal using then . once promise returned, state set asynchronously: var datapoem = function(){ asyncstorage.getitem('poemdb').then((data

Where i should dowload libemoji (so file) full package and add it to android studio project -

when run application in device phone face error in logcat : e/emojifactory_jni: failed load `libemoji`: dlopen failed: library libemoji.so" not found what , download libemoji.so , how add project in android studio. android studio version 2.3 , install recently. please guide me. thanks.

python - Post data in djangon api and unable to get variable value -

i have created api sending request post didn't vairable in view def login_list(request): if request.method == 'post': data = json.dumps(request.post) print(data) serializer = loginserializer(data=request.data) #print(serializer) return jsonresponse({"message":'fdsafdsa'}) when print data print(data) out put coming this {"{\"login\":122122,\"abvc\":\"544545\"}": ""} and calling api in postman post http://localhost:8000/login/login/ {"login":122122,"abvc":"544545"} i not geting value this print(request.post['login']); how can value try request.data instead of request.post . json content sent in body, parsed django rest framework @ runtime. login_variable = request.data['login'] and ensure have added 'jsonparser' in rest_framework settings.

facebook - Open Graph can't play GIF from my website -

i can't undrestand why facebook can't play gifs website? example when debug page, facebook don't show gif: https://keepgif.com/gif/when-your-dad-live.html file not big , width greater 200px. problem please? there recomandations have know force open graphe play gif website?

xdebug - Configuration of php-debug plugin in Atom -

i trying integrate debugging feature( xdebug ) in atom editor. stuck @ php-debug configuration. want set local , remote path configure php-debug extension don't know mean local , remote path. i using xampp server on mac machine can please me configure it? updates here links tutorials:- https://atom.io/packages/php-debug https://luminfire.com/2016/08/19/configure-atoms-php-debug-package-work-xdebug-pressmatic-site/ from tutorials, found out below definition local , remote path the path site’s public directory perspective of local machine i.e. local path the path site’s public directory perspective of virtual machine i.e. remote path but new server side can't understand means. can please me configure it?

How to write Kafka Consumer Client in java to consume the messages from multiple brokers? -

i looking java client (kafka consumer) consume messages multiple brokers. please advice below code written publish messages multiple brokers using simple partitioner. topic created replication factor "2" , partition "3". public int partition(string topic, object key, byte[] keybytes, object value, byte[] valuebytes, cluster cluster) { list<partitioninfo> partitions = cluster.partitionsfortopic(topic); int numpartitions = partitions.size(); logger.info("number of partitions " + numpartitions); if (keybytes == null) { int nextvalue = counter.getandincrement(); list<partitioninfo> availablepartitions = cluster.availablepartitionsfortopic(topic); if (availablepartitions.size() > 0) { int part = topositive(nextvalue) % availablepartitions.size(); int selectedpartition = availablepartitions.get(part).partition(); logger.info("selected partition

c++ - Using fold expressions to print all variadic arguments with newlines inbetween -

the classic example c++17 fold expressions printing arguments: template<typename ... args> void print(args ... args) { (cout << ... << args); } example: print("hello", 12, 234.3, complex<float>{12.3f, 32.8f}); output: hello12234.3(12.3,32.8) i'd add newlines output. however, can't find way that, best i've found far: template<typename ... args> void print(args ... args) { (cout << ... << ((std::ostringstream{} << args << "\n").str())); } this isn't zero-overhead, constructs temporary ostringstream each argument. the following versions don't work either: (cout << ... << " " << args); error: expression not permitted operand of fold expression and (cout << ... << (" " << args)); error: invalid operands binary expression i understand why last 2 versions don't work. there more elegant solution probl

typo3 - Display field in TCA of pages based on the previous field value -

i achieve field in tca shown or hidden based on previous field value. how can that? can in javascript, possible include javascript in tca? here user choose value: $fields = array( 'question_field' => array( 'label' => 'user choose', 'config' => array( 'type' => 'select', 'items' => array( array('yes','1'), array('no','0'), ), ), ) ); if value yes, display second field: $fields = array( 'second_field' => array( 'label' => 'second question', 'config' => array( 'type' => 'select', 'items' => array( array('yes','1'), array('no','0'), ), ), ) ); so in case, adding line 'displaycond' => 'field:question_field:=:1', final solution looks this:

pointers - C++ member of class updated outside class -

i have question pointers , references in c++. programmer programs in c# , php. i have 2 classes (for now) following. x/y in controller continuously changing want them date in commands. have multiple commands forward, turn, backward etc. when make commands give them controller state (x, y) of controller updating every second. how can fix controller attribute in commands getting updated every second? class forward : icommand { controller ctrl; void execute() { int currentx = ctrl.x; int currenty = ctrl.y; //check here current location , calculate has go. } } class controller { int x; int y; void executecommand(icommand command) { command.execute(); } } main.cpp controller controller; forward cmd1 = new forward(1, controller); turn cmd2 = new turn(90, controller); forward cmd3 = new forward(2, controller); controller.execute(cmd1); controller.execute(cmd2); controller.execute(cmd3); i have read pointer

r - How to group a vector into a list of vectors? -

i have data looks (fake data example's sake): dressid color 6 yellow 9 red 10 green 10 purple 10 yellow 12 purple 12 red where color factor vector. not guaranteed possible levels of factor appear in data (e.g. color "blue" 1 of levels). i need list of vectors groups available colors of each dress: [[1]] yellow [[2]] red [[3]] green purple yellow [[4]] purple red preserving ids of dresses nice (e.g. dataframe list second column , ids first), not necessary. i wrote loop goes through dataframe row row, , while next id same, adds color vector. (i sure data sorted id). when id in first column changes, adds vector list: result <- null while(blah blah) { code creates vector called "colors" result[[dresscounter]] <- colors dresscounter <- dresscounter + 1 } after wrestling getting necessary counting variables co

xcode7 - Link External Library in Xcode C++ Project -

i've found answers question, don't work me. i'm trying build c++ project in xcode uses external libraries ffmpeg , opencv, , can't figure out how link them. recommended, go "build phases" screen, , there's place "link binary libraries." 1 of libraries need link @ /usr/local/lib/libavutil.a. when try add library, list box pops showing 2 folders: "os x 10.11" , "developer frameworks". library need not in either of these folders. tried clicking on "add other" , file chooser dialog comes up, if type "/usr/local/lib/libavutil.a" in search box, dialog doesn't accept it. i've found typing '-lswcale -lavcodec -lavdecice' etc. on "other linker flags" line in "build settings" works, it's not hoped for. hoping file chooser dialog, click on libraries want use. is there way accomplish want? if understand correctly asking, want "set" file chooser

jquery - Can this possible to unslick in desktop and slick slide in mobile? -

i want disable slider in desktop needed slide in mobile, guy's can me? $('.slider').slick({ slidestoshow: 5, slidestoscroll: 1, autoplay: false, autoplayspeed: 2000, responsive: [ { breakpoint: 767, settings: "unslick" } ] }); try this: screen width 9999px 768px not slider ('.slider').slick({ slidestoshow: 5, slidestoscroll: 1, autoplay: false, autoplayspeed: 2000, responsive: [ { breakpoint: 9999, settings: "unslick" }, { breakpoint: 767, settings: { slidestoshow: 3, slidestoscroll: 3, infinite: true, dots: true } } ] });

What is the algorithm used by sort() method on Array class in .NET? -

msdn description sort() method says : sorts elements in entire one-dimensional array using icomparable implementation of each element of array. i checked icomparable didn't find thing indicating sort algorithm being used. i need know how sort() method parallel processing friendly. does know algorithm sort() method on array class using? from msdn documentation : this method uses introspective sort (introsort) algorithm follows: if partition size fewer 16 elements, uses insertion sort algorithm. if number of partitions exceeds 2 * logn, n range of input array, uses heapsort algorithm. otherwise, uses quicksort algorithm.

amazon web services - Regex on picking S3 bucket name from S3 URI -

i have been trying regex pattern obtain s3 bucket name s3 uri have no luck. example: s3://example-bucket/file-name.filetype closest this: \/\/([^\/].*[^\/])\/ i'm not sure how negate slash result the part ([^/]+) looking sequence of of characters not slash. keeping close had write //([^/]+)/ same //([^/]+) optional use lookbehind (?<=//) and/or lookahead (?=/) (?<=//)([^/]+)(?=/) (depending on use cases couple of different lookahead expressions possible) 'lookaround' 'lookbehind' not supported in regexp dialects. e.g. not in javascript debuggex demo

salt - Saltstack updating and hash_type parameter -

i'm going update saltstack 2016.3.3 2016.11.3 , searching different problems might occur. i've watched changelog https://docs.saltstack.com/en/latest/topics/releases/2016.11.0.html#utils-module-deprecations , found this: the default hash_type sha256 instead of md5. need make sure both master , minion share same hash_type. and found confused things in saltstack's config installation: on master the hash_type hash use when discovering hash of file on master server. the default md5 sha1, sha224, sha256, sha384 , sha512 supported. on minions the hash_type hash use when discovering hash of file in local fileserver. the default sha256 , sha224, sha384 , sha512 supported. it seems both minions , master have different hash_type. satisfy curiosity happen set different hash_type, removed cache directory , restarted master , minions, run 1 state ( -l trace flag ) , found out there no exceptions or redownloading file happened. is knows why w

c++ - Invoke format log method of a static logger -

i have code in project, can't find why can't got format argument in log file. when invoke logger this: logger::get_logger().repare().log("log something"); but, log file still opened , content "log : " in log() method shown in log file indicate fact code works. : expected : ======== new log ======= repare.log : time : 19:05:17. log but : ======== new log ======= repare.log : i thought code work around vsprintf right, copied tutorial. here code. class logger : private noncopyable { public : logger(); ~logger(); static logger& get_logger(); logger& repare(); int log(const char* format, ...); private : string filename_; int fd_; }; int my_http::deploylogfile() { char filename[100]; int fd; sprintf(filename, "%s/stuff/log.txt", get_my_root_path); fd = open(filename, o_wronly | o_trunc | o_append); i

MS Word VBA to delete empty lines -

Image
i new vba macros have word 2016 template , has following sections: base amount: $ service fee: $ sales tax % $ other tax %: $ tax 2 %: $ my goal if amount missing of lines, delete line. tried recording macro , making changes no luck. updated: below modified version of code spin thru rows of table (in ms-word) , delete every row contains '$' in column 3 , column 4 empty. option explicit ' subroutine spin thru rows of data in table in ms-word (except first row, header). ' if column 3 contains '$' , column 4 empty, row deleted. ' rows '$' in column 3 , empty cell 4 deleted. sub test() dim long 'dim char string selection.tables(1) = .rows.count 1 step -1 'char = .cell(i, 3).range.text 'debug.print asc(mid(char, 1, 1)) & vbtab & asc(mid(char, 2, 1)) '& vbtab & asc(mid(char, 3, 1)) 'debug.print ">" & .cell(i, 2).range.te

Attempting to retrieve refresh token with OpenIddict gives Internal Server Error -

i'm trying obtain access , refresh tokens using openiddict library. everything seems fine when requesting access token. when adding scope = offline_access, 500 internal server error returned. using postman grant_type = password, , username , password set, valid access_token returned. but after appending scope = offline_access, status 500 internal server error. i register openiddict services services.addopeniddict(options => { options.addentityframeworkcorestores<dbcontext>(); options.addmvcbinders(); options.enabletokenendpoint("/connect/token"); options.allowpasswordflow(); options.allowrefreshtokenflow(); options.addephemeralsigningkey(); options.disablehttpsrequirement(); }); i register openiddict , validation middleware public void configure(iapplicationbuilder app, ihostingenvironment env, iloggerfactory loggerfactory) { app.useoauthvalidation(options => { options.automaticauthenticate = true;

4x4 Matrix in Python -

im trying code 4x4 matrix in python random integers 1-4. thats easy enough problem want each row , each column 1 time uses of each digit 1-4 example 1 2 3 4 2 3 4 1 3 4 1 2 4 1 2 3 my code 33% of time in loop there happens somthing this 2 1 4 3 3 4 2 1 1 3 x <-------- because of programm cant contiune , end in infinity loop helb how can out? code below """ programm playing game skyline """ random import randrange row1 = [] row2 = [] row3 = [] row4 = [] allrows = [row1, row2, row3, row4] column1 = [] column2 = [] column3 = [] column4 = [] allcolumns = [column1, column2, column3, column4] def board(): in range(4): j = 0 while len(allrows[i]) != 4: x = randrange(1,5) print(i, j) if x not in allrows[i] , x not in allcolumns[j]: allrows[i].append(x) allcolumns[j].append(x) j += 1 else: continue boa

android - How to store this list view? -

i have 2 activites updating list view (one adding item , 1 removing item , displaying list) want store list(named schedule) after app closes , resume list when app reopens. activity add items on list named schedule listview.setonitemlongclicklistener(new adapterview.onitemlongclicklistener() { @override public boolean onitemlongclick(final adapterview<?> parent, view view, final int position, long id) { new alertdialog.builder(cloudevents.this) .seticon(android.r.drawable.ic_dialog_alert) .settitle("save event") .setmessage("do want save event schedule?") .setpositivebutton("yes", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { toast.maketext(cloudevents.this, "saved", toast.length_short).sho

java - @OneToMany mapping and creating JOIN table with same type entities fails with JPA -

i have employee class. worker class extends employee , , leader class extends worker . every leader has list public list workersresponsiblefor = new arraylist<>(); . want create join table, illustrate if leader responsible 1 or many workers . @entity @inheritance @discriminatorcolumn(name="emp_type") @table(name="employees") public abstract class employee implements printable, serializable { @id @generatedvalue @column(name = "employee_id", unique = true) private int id; @column(name = "position") @enumerated(enumtype.string) private position position; @column(name = "name") private string name; @column(name = "salary") private double salary; @transient public list<project> projectsworkingon = new arraylist<>(); public employee() { } } worker : @entity public class worker extends employee { @id @generatedvalue @col

php - Issue with Books on MediaWiki -

i trying mediawiki export pdf format using books/collection, has issues rendering. i found useful article good, when to: $ mw-render --config http:/.localhost/ --username='user' --password='password' --output /path/file.pdf --writer rl i issue. stick user name , password in, change path, following error: /usr/local/lib/python2.7/dist-packages/mwlib/ext/reportlab/pdfbase/pdfmetrics.py:35: userwarning: pyfribidi not installed - rtl not supported warnings.warn('pyfribidi not installed - rtl not supported') /usr/local/lib/python2.7/dist-packages/mwlib/ext/reportlab/pdfgen/textobject.py:23: userwarning: pyfribidi not installed - rtl not supported warnings.warn('pyfribidi not installed - rtl not supported') missing fonts: 'ar pl uming hk','nazli','unbatang','arundina serif','lohit telugu','sarai','gujarati','lohit punjabi','lohit oriya','anjalioldlipi','ked

visual studio 2017 - Two almost identical project in VS2017. One has working nuget references the other doe not? -

Image
i have 2 identical project files in vs2017 https://gist.github.com/bradphelan/318b0241a46eeab81a8546bc1c28c1f8 however dotliquidextensions project seems load nuget packages but other not. the original differences greater have reduced them being identical. cannot figure out might problem. ideas?

How to convert MySQL data to JSON nested array using PHP -

i want convert mysql data using php in table called tbl_questions json , result of json : { "allrounddata": [{ "name": "animals", "timelimitinseconds": 20, "pointsaddedforcorrectanswer": 10, "questions": [{ "questiontext": "lions carnivores: true or false?", "answers": [{ "answertext": "true", "iscorrect": true }, { "answertext": "false", "iscorrect": false }] }, { "questiontext": "what frogs eat?", "answers": [{ "answertext": "pizza", "iscorrect": false }, { "answertext": "flies", "iscorrect": true }] }, { "questiontext": "where mice live?

java - Maximum number of IntelliJ Run Configurations before they roll off -

in intellij, if right-click on class , choose run 'xyz', adds them run configurations dialog. this fine, after adding 6 new run configs way, rolls off configs you've losed least recently. annoying if run 6 different junit tests individually, run configs want keep deleted. is there anyway increase limit 6? thanks you can open run | edit configurations , check share checkbox configurations want save. , no deleted. or, if don't want shared, can click save icon in same configuration window. configuration not deleted. you can find more information here

http - Docker HttpExceptionRequest Can't GET from inside container -

i'm having problem docker container runs on buildroot. executes request somehow can't through. mean should map port 443 host? can't seem connect on 443. httpexceptionrequest request { host = "www.ncbi.nlm.nih.gov" port = 443 secure = true requestheaders = [] path = "/" querystring = "" method = "get" proxy = nothing rawbody = false redirectcount = 10 responsetimeout = responsetimeoutdefault requestversion = http/1.1 } with docker ps showing: 7f4e69c0c0fc 48a5c6e00788 "/bin/bash" 7 minutes ago 7 minutes 0.0.0.0:443->443/tcp infallible_liskov so, started this: docker run -it -v /home/:/home -p 443:443 48a5c6e00788 /bin/bash or have certificates? mean can't share them? thanks

visual studio 2017 - MFC development in vs2017 -

when installed vs2017, did select windows development c++ option. after installation, however, don't see mfc has been added. sure enough, errors when compile application, fatal error c1083: cannot open include file: 'afxwin.h': no such file or directory i cannot find change/modify option vs2017 installation in control panel. how can add "microsoft foundation classes c++" package? if near top of vs installer window, you'll see workloads , individual components , language packs . at least far can see, none of "workloads" include mfc in installation. it, first have click on "individual components", scroll way bottom of (long) list of components shows. close bottom you'll find "mfc , atl support (x86 , x64)". select it, , you're on way. that's not end of story though: default, when install that, installs version unicode build of mfc. if want narrow-character version, have install separately. don't

mono - C# Serial Port BNO055 Sensor Communication -

i trying use c# , mono talk imu sensor (bno055) on raspberry pi. no matter do, cannot read , write sensor. can more experience let me know proper way is? thanks. initialization: private void connecttobno055() { gpio.write(resetpin, true); task.delay(650).wait(); port = new serialport(); port.portname = portname; port.baudrate = 115200; port.parity = parity.none; port.databits = 8; port.stopbits = stopbits.one; port.handshake = handshake.none; port.readtimeout = 5000; port.writetimeout = 5000; try { port.open(); while (!port.isopen) { task.delay(1).wait(); } setmode(operationmode.operation_mode_config); writeregister((byte)pageidregisterdefinition.bno055_page_id_addr, 0, false); byte chipid = readregister((byte)pageregisterdefinitionstart.bno055_ch

javascript - Createjs custom font not updating on load, updating after a few seconds -

i trying create html5 game using createjs, custom font not showing initially, after few seconds. code auto genrated animate cc, when publish javascript easeljs : this.txt = new cjs.text("coin 10", "30px 'calibri'", "#ffffff"); . have added font in stylesheet, included stylesheet in html, , tried load font using <link href="../fonts/calibri.ttf" rel="stylesheet" type="text/css"/> . when game loaded, default font displayed, after few seconds correct font shown. checked in network panel of browser, font downloaded before game assets, before initializing stage.

javascript - Changes to object made with Object.assign mutates source object -

i have following reducer code in react-redux app: case 'toggle_client_selection': const id = action.payload.id; let newstate = object.assign({}, state); newstate.list.foreach((client) => { if (client.id == id) client.selected = !client.selected; }); console.log(state.list[0].selected + ' - ' + newstate.list[0].selected) return newstate; if got right - object.assign creates brand new object, console.log displays "true - true" of "false - false". thoughts why behaves , how can avoid behavior? true, it's not deep copy. the new object contains reference old list. here's trick around (there's more "proper" ways might say): json.stringify original. json.parse string. new object "deep" copy (not sure if that's technically "deep copying"). works fine unless sub-types more complex standard plain old json-acceptable stuff.

Python: something faster than not in for large lists? -

i'm doing project word lists. want combine 2 word lists, store unique words. i'm reading words file , seems take long time read file , store list. intend copy same block of code , run using second (or subsequent) word files. slow part of code looks this: while inline!= "": inline = inline.strip() if inline not in inlist: inlist.append(inline) inline = infile.readline() please correct me if i'm wrong, think slow(est) part of program "not in" comparison. ways can rewrite make faster? judging line: if inline not in inlist: inlist.append(inline) it looks enforcing uniqueness in inlist container. should consider use more efficient data structure, such inset set. not in check can discarded redundant, because duplicates prevented container anyway. if insertion ordering must preserved, can achieve similar result using ordereddict null values.

display label next to icon in Google Maps KML -

Image
i using kml google maps api. kml used display mile markers on interstates (see screenshot): a snippet of kml: <?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <document> <style id="randomlabelcolor"> <labelstyle> <color>ff0000cc</color> <colormode>random</colormode> <scale>1.5</scale> </labelstyle> </style> <placemark> <name>17</name> <styleurl>#randomlabelcolor</styleurl> <description>i-684 mm northbound: 17</description> <style> <iconstyle> <icon> <href>http://www.xxxx.com/images/mapicons/milemarker.png</href> </icon> </iconstyle> </style>

iis - downloading large odata data from C# -

trying find solution our issue month now. we have odata service developed using web api c#. there method retrieves data table in database , it's arounds 1 million records (more 400mb in size). everytime invoke method using jquery ajax recieving error code 503 service unavailable. happens in server , in local machine there problem that. tried every time out settings in iis doesn't resolved issue. i hope can in issue. thanks

command line - What does "gcc -lm -o [executable_name] [file_name].c" mean? -

specifically, "-lm" mean, , required include that? there "dictionary" online explain of these command abbreviations "-lm"? this linking against m library... used math functions. the -l<libname> parameter gcc means ' link library '. the m library link (e.g: libm.so or libm.a ). see gcc man page (run man gcc ), , functions sin() , sqrt() , pow() , etc... note in these man pages, states: link -lm.

javascript - Not able to include calendar events, sorting table in a single page in angularjs -

there 2 html files calendar , sorting table running on different pages want integrate both calendar , sorting table in single angularjs page.each html file has seperate app.js , .css.but want combine both , show in single page. please advice how can make it? thanks, suni i have no idea mean there absolutely no code right now, think may want use iframe . here syntax: .iframe1 > iframe { width: 49%; height: 100vh; border: none; float: left; display: block; } .iframe2 > iframe { width: 49%; height: 100vh; float: right; display: block; } body { margin: 0px; padding: 0px; } <div class="iframe1"><iframe src="https://www.bing.com/"></iframe></div> <div class="iframe2"><iframe src="https://en.wikipedia.org/w