Posts

Showing posts from February, 2011

mysql - Why shouldn't I use mysql_* functions in PHP? -

what technical reasons why 1 shouldn't use mysql_* functions? (e.g. mysql_query() , mysql_connect() or mysql_real_escape_string() )? why should use else if work on site? if don't work on site, why errors like warning: mysql_connect(): no such file or directory ? the mysql extension: is not under active development is officially deprecated of php 5.5 (released june 2013). has been removed entirely of php 7.0 (released december 2015) this means of 31 dec 2018 not exist in supported version of php. gets security updates. lacks oo interface doesn't support: non-blocking, asynchronous queries prepared statements or parameterized queries stored procedures multiple statements transactions the "new" password authentication method (on default in mysql 5.6; required in 5.7) all of functionality in mysql 5.1 since deprecated, using makes code less future proof. lack of support prepared statements particularly important provide

android - Build APK - ERROR - app:transformClassesWithDexForDebug -

i watched many threads here , still didnt find working solution. when want build apk, main error: error:execution failed task ':app:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: com.android.ide.common.process.processexception: error while executing java process main class com.android.dx.command.main arguments {--dex --num-threads=4 --multi-dex --main-dex-list c:\users\ratik\desktop\buildbox\volunteer\studio\app\build\intermediates\multi-dex\debug\maindexlist.txt --output c:\users\ratik\desktop\buildbox\volunteer\studio\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main c:\users\ratik\desktop\buildbox\volunteer\studio\app\build\intermediates\transforms\jarmerging\debug\jars\1\1f\combined.jar} there few more errors, apear sometimes, of them: error: @ com.android.dx.cf.direct.classpathopener.proce

angular - Injecting into existing constructor -

i'm having difficulties trying inject service in angular. i'm trying create service extending class existing constructor, follows: @injectable() export class authhttpservice extends authhttp { constructor(options: authconfig, http: http, defopts?: requestoptions) { super(options, http, defopts); } } my issue is: need inject service , can't seem put argument in constructor (can't put required argument after optional 1 , if put optional ? doesn't work). i've tried injector.get , works reasonably injects different instance of service other components , breaking app (i rely on service properties show information). any solution? thanks! to inject service, add constructor before optional parameter. fine. @injectable() export class authhttpservice extends authhttp { constructor(options: authconfig, http: http, otherservice: otherservice, defopts?: requestoptions) { super(options, http

android - How to call a method of another class from onAuthenticationSucceeded method? -

i have used fingerprint login in android app. if authentication success,it call onauthenticationsucceeded method. after success authentication of fingerprint want verify username within onauthenticationsucceeded. couldn't call method(for verifying username) of class within onauthenticationsucceeded method. app seems stopped. how acheive it? please me. thank you this in fingerprinthandler.java public void onauthenticationsucceeded(fingerprintmanager.authenticationresult result{ login log=new login(); log.unamecheck(); } this method in login.java public void unamecheck(){ string uname=edit_username.gettext().tostring(); string storedpassword=mydb.getsingleentry(uname); if(storedpassword!=0){ toast.maketext(login.this,"login successfull",toast.length_long).show(); intent intent =new intent("michel.maan.login1"); startactivity(intent); } else{ toast.maketext(login.this,"login failed",toast.length_long).show(); } }

windows - Can't run Karma tests on TeamCity -

can't run tests karma on teamcity. locally works ok. os windows karma.config.js: frameworks: ['jasmine'], browsers: ['chrome'], reporters: ['coverage', 'progress'], plugins: [ 'karma-chrome-launcher', 'karma-jasmine', 'karma-teamcity-reporter', 'karma-coverage' ] in team city (command line): npm install karma-cli@1.0.0 karma start ./app/tests/karma.conf.js --reporters teamcity --single-run karma run result: [12:22:32]step 1: run tests (command line) (3s) [12:22:32]starting: d:\temp\agenttmp\custom_script7407887356682451667.cmd [12:22:32]in directory: d:\p4\c653be47039b7ced [12:22:35]karma-cli@1.0.0 node_modules\karma-cli [12:22:35]└── resolve@1.3.2 (path-parse@1.0.5) [12:22:35]process exited code 0 no tests running

javascript - The 3 different equals -

what difference between = , == , , === ? i think using 1 equal sign declare variable while 2 equal signs comparison condition , lastly 3 equal signs comparing values of declared variables. you have = assignment operator , == 'equal' comparison operator , === 'identical' comparison operator . $a = $b assign sets $a equal $b. $a == $b equal true if $a equal $b. $a === $b identical true if $a equal $b, , of same type. (introduced in php 4) for more info on need == , === , , situations use each, @ the docs .

scala - Case class value not found -

why accessing case class king in "figures match" informs me case class not found? "not found: value king" class field { val size: int = stdin.readint() var matrix: list[list[boolean]] = list.fill(size, size)(true) val figures: list[list[figure]] = list() def inrange(figures: list[list[figure]]) = { figures match { case king() => field.foreach(matrix) { if (matrix == true) { if (math.abs(m1-m2) <= 1 || math.abs(n1-n2) <= 1) matrix = false } } } } abstract class figure { case class rook() case class knight() case class bishop() case class queen() case class king() } king inside abstract class figure , not visible outside it. i guess, trying below trait figure case class rook() extends figure case class knight() extends figure case class bishop() extends figure case class queen() ex

how to know that the message is a reply in Microsoft Graph -

since there no possibility email header ms graph api want manage references/in-reply-to in different way. how can know mail got reply? trying using conversationid every reply had new conversationid. at moment information isn't exposed. there feature request in uservoice exposing headers .

javascript - Change background-image on li hover; how to change back when I get of the li? -

this question has answer here: removing class mouse exit 7 answers i want change background image of div when hover on li element. have figured out, can see in https://jsfiddle.net/7zpt7g6b/ ! :) thing want change pic original css when hover of li element (hope i'm being clear). div of background-image keeps having image of last li have hovered on. want change back my html <section class="content"> <div class="projects"> <ul> <li data-background="https://static.pexels.com/photos/7045/pexels-photo.jpeg"><a href="#">case i</a></li> <li data-background="https://static.pexels.com/photos/132037/pexels-photo-132037.jpeg"><a href="#">case ii</a></li> <li data-background="https://iso.500p

javascript - Adding div when clicking on anchor and removing div when clicking either outside of it or on a different anchor -

i have 2 anchor tags both display 2 different divs when clicked on want display 1 div @ time. want hide div displayed when clicking outside of it. done when click on first anchor , on second both divs displayed (i want 1 @ time). here code: //display , hide div number 1 $("a.number_1").on("click", function(event) { event.preventdefault(); $(".display_div_1").toggle(); event.stoppropagation(); }); $(".display_div_1").on("click", function(event) { event.preventdefault(); event.stoppropagation(); }); $(".body").on("click", function(event) { event.preventdefault(); $(".display_div_1").hide(); }); //display , hide div number 2 $("a.number_2").on("click", function(event) { event.preventdefault(); $(".display_div_2").toggle(); event.stoppropagation(); }); $(".display_div_2").on("click", function(event)

Binding data in my DatagridView in C# using Nhibernate -

i want add data datagridview. dniveau , dcycle are: class dniveau : idniveau { dparams dparams; itransaction tx; isession mysession; public niveau oncreate(niveau niveau) { niveau nivo = null; dparams = new dparams(); mysession = dparams.isession(); tx = mysession.begintransaction(); mysession.save(niveau); nivo = mysession.get<niveau>(niveau._idniveau); tx.commit(); mysession.close(); return null; } public list<niveau> getall() { list<niveau> lniveau; dparams = new dparams(); mysession = dparams.isession(); tx = mysession.begintransaction(); tx.commit(); lniveau = (list<niveau>)mysession.createcriteria<niveau>().list<niveau>(); mysession.close(); return lniveau; } } dcycle.cs class dcycle : idcycle { protected static re

android - How to color polyline/GeoJSON line by speed/altitude in MapBox? -

i want draw gps track on map (mapbox) , color points speed or altitude. need custom drawer track. mapbox android sdk provides example of drawing polyline customized style: https://www.mapbox.com/android-sdk/examples/add-a-geojson-line/ still static style, not driven data. this part of example point of interest: linelayer.setproperties( propertyfactory.linedasharray(new float[]{0.01f, 2f}), propertyfactory.linecap(property.line_cap_round), propertyfactory.linejoin(property.line_join_round), propertyfactory.linewidth(5f), propertyfactory.linecolor(color.parsecolor("#e55e5e")) ); propertyfactory methods have implementations function parameter. suspect search for. no manual or example of using implementations found. any ideas custom drawer? i develop xamarin.android app in c# using mapbox android sdk ported java. upd: function type definition seen in assembly metadata following: [javatypeparameters(new[] { "t" })

hibernate - SQL String or binary data would be truncated Error -

i trying execute insert statement through hibernate hibernate.save(entity) table.it gives error: sql error: 8152, sqlstate: 22001 string or binary data truncated. when try execute query on sql editor works fine through hibernate.save(entity) its gives me above error.can please me out whats issue is? usually issue related columns' type , length, check length big enough or data type compatible. binary string overflow when being populated int (int32), etc.

javascript - Semantic UI React item image as link -

i using item (semantic ui react) , set image link. how reference link url? <item> <item.image src={this.props.fileurl} size='tiny' as='a' /> <item.content> </item.content> </item> if wrap item.image in a -container, padding gets messed up... you're on right way, need use suir's augmentation, non item.image props by-passed: <item.image as='a' href='http://example.com' src={this.props.fileurl} size='tiny' />

node.js - NodeJS: Rapidly converting image with Data URI causes caching, memory leak -

i working on software reads high amount of images , processing on images reading height, width etc. came see difficult situation memory used during converting image url data uri. request.get(imageurl, function (error, my_data, body) { var imagebase64data = new buffer(body).tostring('base64'); var imagedata = "data:" + my_data.headers["content-type"] + ";base64," + imagebase64data; // using imagedata in image processing using graphicsmagick module }); now problem facing when node process starts run , process these images, memory used upto 1.7gb. , system starts giving error of memory. i checked , learned buffer used convert image url data uri not deletes memory once out of scope. please suggest or how should go further resolve issue. not sure how translates using buffer base64 encoding. how translate buffer works. when create new buffer increased heaptotal , heapused. though not translate number of blocks being used.

swift - Get starting position of a substring not counting emoji as one character ios -

i'm trying find starting positions of substring within string. it's returning correct index if it's characters without emoji. however, when special characters emojis used, returned index not correct. want count each emoji or character 1 character. here code: extension string { func index(of string: string, options: compareoptions = .literal) -> index? { return range(of: string, options: options)?.lowerbound } func indexes(of string: string, options: compareoptions = .literal) -> [index] { var result: [index] = [] var start = startindex while let range = range(of: string, options: options, range: start..<endindex) { result.append(range.lowerbound) start = range.upperbound } return result } } any suggestions? thanks!

python - Forward slash in json file from pandas dataframe -

i'm complete newbie json, appreciated. i'm trying convert dataframe json file. import pandas pd df = pd.dataframe({ 'a' : [1., 2.5], 'b' : ['img/blue.png', 'img/red.png']}) print df output is b 0 1.0 img/blue.png 1 2.5 img/red.png i make json file looks this: '[1.0,"img/blue.png"],[2.5,"img/red.png"]' however, when use following out = df.to_json(orient='values')[1:-1] print out i instead '[1.0,"img\\/blue.png"],[2.5,"img\\/red.png"]' how can forward slash print correctly in json file? i'm not believe want those. think forward slash break json , needs escaped. have verified added slashes issue?

javascript - How I change a value of hidden file in the file HTML.Twig -

this question has answer here: how change value of hidden file according radio selected 3 answers i have in file html.twig : 1: one hidden filed should take 3 values according radio selected, 1 database , 2 others value 10. <input type="hidden" name="lt_filed" value="{{ price.getlt }}" or "10" or "10"> 2: 3 radio box <input id="spa-price" name="price" class="w3-radio" onchange='valuelt();' value="spare {{ price.getspareprice }}" type="radio"> <input id="rep-price" name="price" class="w3-radio" onchange='valuelt();' value="repair{{ price.getrepairprice }}" type="radio"> <input id="tes-price" name="price" class="w3-radio" onchange='valuelt();&

c - Signed long integer becomes negative as it grows? -

i'm doing math, printing signed long integer so: file1.c #include <stdio.h> int main (int argc, char *argv[]) { long my_signed_integer = 9999l * 9999l * 9999l * 9999l; printf("this signed integer %ld.\n", my_signed_integer); return 0; } makefile cflags=-wall -g all: file1 clean: rm -f file1 i trying see how far go without compiler throwing me error, adding 1 more 9999l multiplication each time, running: make ./file1.c to see happens. 4 times when using 9999l 4 times (like in example above), get: this signed integer 9996000599960001. without warning. 5 times using 9999l 5 times, 1 warning: warning: overflow in expression; result 7716289630452291919 type 'long' [-winteger-overflow] but file still compiles, , eventual result is: this signed integer 7716289630452291919. 6 times using 9999l 6 times, 2 warnings - 1 negative number: warning: overflow in expression; result 771628963045229

google api v3 C# cant read file permissions details (filePermissions.Permissions[i].EmailAddress) -

my issue can't read email or user name each file permission i need read have permission on each files in google drive api v3   var service = new driveservice(new baseclientservice.initializer() { httpclientinitializer = credential, applicationname = applicationname, }); // define parameters of request filesresource.listrequest listrequest = service.files.list(); //*///////////////// getdataitem share file me listrequest.q = "(sharedwithme = true)"; listrequest.fields = "*"; var results = listrequest.execute(); //*////////////end getdataitem share file me listrequest.pagesize = 10; listrequest.fields = "nextpagetoken, files(id,name,viewedbyme)"; // list files. ilist<google.apis.drive.v3.data.file> files = listrequest.execute() .files; console.writeline("files:"); if (file

inheritance - Prevent call to base assignment operator in C++ -

i have these 2 classes in library: class base { int _handler; protected: base() = default; base& operator=(int h) { this->_handler = h; return *this; } }; class derived : public base { protected: derived() = default; void initialize() { this->base::operator=(12345); // internal stuff } }; derived class available inherited user. should this: class user_class : public derived { void foo() { this->initialize(); } }; but instead, this: class user_class : public derived { void foo() { this->base::operator=(999); // no, broke it! } }; how can prevent call base assignment operator? when change header this class derived : private base the compiler blocks call operator= "cannot access inaccessible member declared in class 'base'", code calls initialize works normally, because accessible. however, should override operator= in derived, , have ch

theory - How to add a 2D texture to an Equirectangular image -

Image
i have 2d texture text , want add equirectangular image without being distorted if paste on top. to clarify: i have 2d texture: i have equirectangular image ( source ): if put 2d texture on top in 360 degree viewer distorted how around , convert equirectangular texture? appreciated :)

java - How to inherit OAuth2AuthenticationProcessingFilter or add custom filter -

i using oauth2 token in rest based api. wanted override oauth2authenticationprocessingfilter can extract token if not provider in header attribute authorization(this provided accesstoken attribute in header long story don't ask why). or if not can tell me how add filter after oauth2authenticationprocessingfilter ? basically, in xml, use defaults, add resource-server <oauth:resource-server id="resourceserverfilter" token-services-ref="tokenservices" resource-id="myid" /> which adds oauth2authenticationmanager , oauth2authenticationprocessingfilter (see https://github.com/spring-projects/spring-security-oauth/blob/ec215f79f4f73f8bb5d4b8a3ff9abe15b3335866/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/xml/resourceserverbeandefinitionparser.java details) then add filter <sec:http> element: <sec:custom-filter ref="resourceserverfilter" position="pre_auth

mysql - TabIncorrect syntax near '–' -

Image
select * yogatimetable; delete yogatimetable yogaid in (select ytt.yogaid, yr.roomcapacity * yt.classprice grossprofit, ytt.duration / 60 durationinhours yogarooms yr, yogatypes yt, yogatimetable ytt ytt.roomnum = yr.roomnum , grossprofit – (yr.costperhour * durationinhours) < 200); select * yogatimetable; i don't know wrong code whenever try run it says incorrect syntax near -. goal delete classes make less 200$ profit. tables included. you have other character called en dash(u+2013) – need hyphen-minus(u+002d) - .

graph - Update the DFS algorithm so it can detect cycles -

Image
given g = (v,e) , vertices colored blue/green, path in g called infinite if looks v1,v2,v3,.. , between every v(i), v(i+1), there line between them. g called infinite blue if has blue vertices in path. update dfs algorithm can called infinite blue. well, in other words, path infinite need detect if there cycles, means if reach vertex in recursion stack, there cycle in tree. so, based on algorithm here: before checking infinite blue, how believe can check cycle in general: in dfs-visit: between 7. , 8. i'll add: else if color[v] = green //detected cycle. now want upgrade blue vertices included. so in dfs(g) edit line 2. "do colorsecond[u] <- white" now every vertex have color field green/blue , colorsecond white - meaning still undetected. line 6. replaced accordingly. in dfs-visit(u) line 1. replaced "colorsecond[u] <- grey" line 5. if color[v] = blue , colorsecond[v] = white between 7. , 8. write "else if color[v

Concatenate each row of a matrix with each element of another matrix R -

i want concatenate each row of matrix (say m1) each element of matrix (m2). here follows exmple: m1 <- t(combn(4,2)) m2 <- matrix(na,nrow(m1),2) for(i in 1:nrow(m1)){ m2[i,] <- seq(1,4,1)[-c(m1[i,])] } > m1 [,1] [,2] [1,] 1 2 [2,] 1 3 [3,] 1 4 [4,] 2 3 [5,] 2 4 [6,] 3 4 > m2 [,1] [,2] [1,] 3 4 [2,] 2 4 [3,] 2 3 [4,] 1 4 [5,] 1 3 [6,] 1 2 the matrix want should this: > m3 [,1] [,2] [,3] [1,] 1 2 3 [2,] 1 2 4 [3,] 1 3 2 [4,] 1 3 4 [5,] 1 4 2 [6,] 1 4 3 [7,] 2 3 1 [8,] 2 3 4 [9,] 2 4 1 [10,] 2 4 3 [11,] 3 4 1 [12,] 3 4 2 what best practice in case? as per expected output, logic seems expanding rows of first dataset includng second dataset, number of rows should double of first. in current approach, used rep expand rows , cbind vector cr

PHP Accessing cookie value in html page using jquery+ajax -

i'm trying access cookie value html using jquery or ajax ,i'm new ajax don't know how access json values. tried $.getjson() not working. when execute same code localhost , showing john . test.php <?php $cookie_name = "user"; $cookie_value = "john"; setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); echo json_encode($_cookie[$cookie_name]); ?> not sure how planning on using value on client side, issue why not getting output fourth parameter option have in setcookie() function. i'm not sure why have documentation found not list fourth option. function accepts name, value, , time live. also, if want return name of user value, don't need use json_encode(). can echo name response: <?php $cookie_name = "user"; $cookie_value = "john"; setcookie($cookie_name, $cookie_value, time() + (86400 * 30)); echo $_cookie[$cookie_name]; ?>

java - How do I subclass ArrayList, and require that <E> must extend Comparable -

i think i'm trying clear, i'm no generics expert. import java.util.arraylist; public class minheap<e extends comparable> extends arraylist<e> { /* simple wrapper around list make binary min-heap. */ public minheap() { super(); } @override public boolean add(e e) { super.add(e); int = this.size() - 1; int parent; while (i > 0) { parent = this.getparentindex(i); if (this.get(i).compareto(this.get(parent)) < 0) { this.swap(i, parent); } else { break; } } return true; } public int getparentindex(int i) { if (i % 2 == 1) { return (i - 1) / 2; } else { return (i - 2) / 2; } } private void swap(int i, int j) { e temp = this.get(i); this.set(i, this.get(j)); this.set(j, temp); } } i warning @ compile-time: mi

Handling large files with Azure search blob extractor -

receiving errors blob extractor files large current tier, basic. upgrading higher tier, notice max size 256mb. when have pptx files video , audio, have text i'm interested in, there way index those? blob extractor max file size mean? can tell extractor take first x mb or chars , stop? there 2 related limits in blob indexer: max file size limit hitting. if file size exceeds limit, indexer doesn't attempt download , produces error make sure aware of issue. reason don't take first n bytes because parsing many formats correctly, entire file needed. can mark blobs skipable or configure indexer ignore number of errors if want make forward progress when encountering blobs large. the max size of extracted text. in case file contains more text that, indexer takes n characters limit , includes warning can aware of issue. content doesn't extracted (such video, @ least today) doesn't contribute limit, of course. how large pptx need indexed? i'll a

Java regex does not match as expected -

i'm starting regex in java recently, , cant wrap head around problem. pattern p = pattern.compile("[^a-z]+"); matcher matcher = p.matcher("gets"); if (matcher.matches()) { system.out.println("matched."); } else { system.out.println("did not match."); } result: did not match(unexpected result) explain this i output "did not match." strange me, while reading https://docs.oracle.com/javase/7/docs/api/java/util/regex/pattern.html , i'm using x+, matches "one, or more times". i thought code in words go this: "check if there 1 or more characters in string "gets" not belong in z." so i'm expecting following result: "yes, there 1 character not belong a-z in "gets", regex match." however not case, i'm confused why is. tried following: pattern p = pattern.compile("[a-z]+");

python - GDB command for indexing the members of a structure -

i have structure several members , see them indexed in order. struct ant { int type; char name[100]; long long int food; } now, when execute command in gdb (gdb) ptype struct ant $1 = struct { int type; char name[100]; long long int food; } i see output like { 0, int type; 1, char name[100]; 2, long long int food; } is there way index of each structure field in order in gdb ? there no built-in way this. if need can write in couple of ways. one way use gdb cli: use set logging , friends dump ptype output file, use shell run other command on file format way like. another way use gdb's python scripting capability inspect type , display how like. if search pahole command (maybe on system, try locate pahole.py -- linux distros ship this) can see example of how done.

java - Gradient color for oval from center to border -

Image
is there way o draw radial gradient oval or arc? need on picture below? all can find circles or linear gradients. can done simple graphics2d?

x86 Assembly Heap Memory Allocation -

i trying run code written professor. unfortunately, when compile , run code, results: include irvine32.inc .data array_size = 1000 fill_val equ 0ffh hheap handle ? ;handle process heap parray dword ? ;pointer block of memory newheap dword ? ;handle new heap str1 byte "heap size is: ",0 getprocessheap proto .code main proc invoke getprocessheap ;get handle prog's heap .if eax = null ;if failed, display message call writewindowsmsg jmp quit .else mov hheap, eax ;success .endif call allocate_array jnc arrayok ;failed (cf = 1)? call writewindowsmsg call crlf jmp quit arrayok: call fill_array call display_array call crlf ;free array invoke heapfree, hheap, 0, parray quit: exit main endp ;--------------

javascript - Using generic types in constructor call without using types in the parameters -

is possible use generics in constructor call without using types in parameters that, or there way of doing this? type personprops = { name: string, } class model<p> { label: string; constructor(label: string) { this.label = label; } create(props: p): promise<any> { ... } } const person = new model<personprops>('person'); edit: i following flow errors in visual studio code , no autocomplete results @ all: test.js:11 11: const person = new model<personprops>('person'); ^^^^^^^^^^^^^^^^^^^^^ boolean. type cannot compared 11: const person = new model<personprops>('person'); ^^^^^^^^ string test.js:11 11: const person = new model<personprops>('person'); ^^^^^^^^^^^ personprops. type referenced value position 5: type personprops = { ^^^^^^^^^^^ type personprops you don't need (an

javascript - web app link to view any files within drive -

i have written script search drive files owned specific user- works great except function, returns results , links set open doc. pdf's , other files getting error opening because url wrong. there generic ways open files, or need write if statements? possible ideas on how around this? thanks function handleresults(results){ console.log('handle results called! '); document.writeln('<a href="https://script.google.com/a/macros/35634534534534534534534534534">back</a><br/><br/>'); var length=results.length; // total elements of results for(var i=0;i<length;i++) { var item=results[i]; item=item.split("|~|"); // split line |~|, position 0 has filename , 1 file id document.writeln("<b><a href='https://docs.google.com/document/d/"+item[1]+"' target='_blank'>"+item[0]+"</b

Fail to install software during Debian installation on Virtualbox -

Image
i'm trying install debian jessie (8.7.1) on virtualbox vm. during debian software installation, correspond step after choice of software i'm want install (see screen bellow) the installation getting lock around 27% , shows fail screen (see screen bellow) when i'm looking @ /var/log/syslog after having aborted installation, can see apparently, vm unable connect hosts. is normal ? should ignore step ? have ways explore? or ideas? thanks in advance! you don't need internet connection install base system. can install , troubleshoot connection debian terminal. can install packages need once fixed. try selecting different repository http://httpredir.debian.org/ . check vm settings make sure necessary ports open , network settings correct. disable firewalls.

Generating combinations with repetetions in python -

i generated combination of numbers, example 123 , using code from itertools import combinations in set(combinations('123',2)): print(''.join(i)) i desired output here 13 12 23 but when use 133 , get 13 33 but want ignore repetition, want output 13 13 33 is there alternate approach? set() s nature, don't allow duplicate elements. each element in a set() must unique . python documentation makes note of this: python includes data type sets. set unordered collection with no duplicate elements . emphasis mine. why not getting expected output. when call set() , removes duplicate 13 combinations. instead, iterate through combination object is: from itertools import combinations in combinations('133', 2): # no call set() print(''.join(i)) which outputs: 13 13 33

php - How can I create a CRUD with Codeigniter using SQLite? -

i'm starting new project want use codeigniter sqlite. searched information , managed conect , data sqlite database have no idea of how can create crud table this, i'm trying same way did in past mysql buy not working. here did: config/database.php $db['default'] = array( 'dsn' => '', 'hostname' => '', 'username' => '', 'password' => '', 'database' => apppath.'/database/pasapalabra.sqlite', 'dbdriver' => 'sqlite3', 'dbprefix' => '', 'pconnect' => false, 'db_debug' => (environment !== 'production'), 'cache_on' => false, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => false, 'compres

java - Display image on JSP page using mySql -

this question has answer here: how retrieve , display images database in jsp page? 4 answers please me in displaying image in particular section on jsp page stored in mysql database , tell me can store image in datatype? web pages display images urls. you can either encode image in data: uri, or write server-side code serve in response url.

sql - Join two tables by column -

so have 2 table, comment_table , post_table, comment_table: link_id body t3_100 people on stackoverflow smart t3_100 stackoverflow place raise questions t3_101 can learn sql t3_102 happy eastern t3_102 did bunny go? post_table id title 100 thought on stackoverflow 101 sql beginner 102 eastern 105 title has no comments "link_id" concatenated 't3_' + id post_table. want 2 join 2 tables "id". expected output id title link_id body 100 thought on stackoverflow t3_100 people on stackoverflow smart 100 thought on stackoverflow t3_100 stackoverflow place raise questions 101 sql beginner t3_101 can learn sql 102 eastern t3_102 happy eastern 102 eastern t3_102 did bunny go? 105 title has no comments t3_105 null here script have, select pt.id, pt.title, ct.link_id, ct

How to put icon in placeholder in Angular Material? -

i'm trying put icon in placeholder. tried code: <md-input name="name"> <md-placeholder> <i class="material-icons app-input-icon">face</i> name </md-placeholder> </md-input> it working (was showing icon placeholder) before reinstalled angular material , updated angular cli. code browser giving error now: "'md-input' not known element". then tried code: <md-input-container> <input mdinput placeholder="name" name="name2"> </md-input-container> it working how can put 'face' icon in placeholder ? your problem not md-placeholder tag. error said, md-input deprecated. angular material changed md-input tag mdinput directive. but md-placeholder still working (not sure if last though). the following code should work : <md-input-container> <md-placeholder> <md-icon>face</md-icon> name </

c - Figuring out flags for the 'open' function -

the man 2 open shows lot of flags (for instance, o_append , o_async etc) without disclosing numeric values. set of possible flags can differ os os, , version version. are there library functions, can translate integer, containing combination of these flags, textual representation? similar strerror , strsignal ? (i can write such function myself, i'm asking more or less standard function that)

javascript - Select node and highlight its connections by feature ID in D3.js -

i have create d3.js network graph. want select node id , highlight , neighbors. have following code var linkedbyindex = {}; (i = 0; < graph.nodes.length; i++) { linkedbyindex[i + "," + i] = 1; }; graph.links.foreach(function (d) { linkedbyindex[d.source.index + "," + d.target.index] = 1; }); //this function looks whether pair neighbours function neighboring(a, b) { return linkedbyindex[a.index + "," + b.index]; } but how use 1 selected node selected feature id? i worked out answer: d3.select("#nodeid") .transition().duration(500) .each(function(d){ //#nodeid selected node.style("stroke-opacity", function(o) { thisopacity = isconnected(d, o) ? 1 : opacity; this.setattribute('fill-opacity', thisopacity); return thisopacity; }); link.style("stroke-opacity", function(o) { return o.so

How to set scrollbar height on ScrollView in android -

Image
how set scrollbar height on scrollview in android. have set custom color scrollbar of scrollview using android:scrollbarthumbvertical="@drawable/scrollbar" below scrollbar.xml <?xml version="1.0" encoding="utf-8"?> <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android" > <gradient android:angle="45" android:centercolor="#65ff8215" android:endcolor="#87fd2125" android:startcolor="#65ff8215" /> <corners android:radius="20dp" /> </shape> how can change height of scrollbar ? want set height of scrollbar per image

python - Sorting an imported list not working -

i trying sort imported list display have tried sorts of things , didnt work. here exemple of list: pommes : 54 bananes : 18 oranges : 30 ananas :12 clémentines :77 cerises de terre: 43 the output should ordered alphabeticaly this getting ['\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0', '1', '1', '2', '3', '3', '4', '4', '5', '7', '7', '8', ':', ':', ':', ':', ':', ':', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'c', 'c', 'd', 'e', 'e', &

PHP unable to receive Javascript variable via Ajax -

solved: didn't realize ajax sent data in instance , redirecting created new instance. i looked through stackoverflow results none of works. i trying send variable mmm php via post , reason php doesnt retrieve it. don't know doing wrong. here javascript code (in file checks.js): $.ajax({ type: "post", url: 'https://www.example.com/panel/app.php', data: {mmm: 145}, success: function(data) { alert("success"); } }); document.getelementbyid("adminloginform").submit(); here php code in file (app.php): <?php $output = (isset($_post['mmm'])) ? $_post['mmm'] : 0; echo "<script>console.log( 'debug objects: " . $output . "' );</script>"; ?> google console log prints: "debug objects: 0" the file directory follows: main folder base registration login base js checks.js panel app.php

javascript - Mediawiki API which doesn't match title -

if want article, match page query (e.g. if it's "dog"), there's no problem, however, if doesn't match (e.g. "red dog"), see: "red dog or red dog may refer to:" , nothing after sentence. there's no article references. i'm not sure where's problem, or how fix it. $.ajax({ url: urls, data: { format: "json", action: "parse", page: match[1], prop:"text", section:0, }, datatype: 'jsonp', headers: { 'api-user-agent': 'example/1.1 (https://www.example.tech/; admin@example.tech) basedonunisoftdevscipt/1.0' }, success: function (data) { console.log(data) var markup = data.parse.text["*"]; var = $('<div></div>').html(markup); i.find(

python - Linear Regression: Extending line past data and adding a legend -

Image
i have code: import math import numpy np import pylab plt1 matplotlib import pyplot plt uh2 = 1.90866638 uhe = 3.60187307 eh2 = 213.38 ehe = 31.96 r = float(uh2*eh2)/(uhe*ehe) c_values = [] delta = [] khest = [] j_f21 = [] data = np.genfromtxt("lamda_hehcl.txt", unpack=true); j_i1=data[1]; j_f1=data[2]; khe=data[7] data = np.genfromtxt("basecol_basic_new_1.txt", unpack=true); j_i2=data[0]; j_f2=data[1]; kh2=data[5] print khe print kh2 khe = map(float, khe) kh2 = map(float, kh2) khe = np.array(khe) kh2= np.array(kh2) g = len(kh2) n in range(0,g): if j_f2[n] == 1: jf21 = j_f2[n] j_f21.append(jf21) ratio = khe[n]/kh2[n] c = (((math.log(float(kh2[n]),10)))-(math.log(float(khe[n]),10)))/math.log(r,10) c_values.append(c) st = abs(j_f1[n] - j_i1[n]) delta.append(st) print c_values print delta print j_f21 fig, ax = plt.subplots() ax.scatter(delta,c_values) i, txt in enumerate(j_f21):

excel - finding a column header, copying the data, and pasting values in another workbook -

i trying copy range of data 1 worksheet "a" "b" code have copying cells copying data "a" , pasting in "a".... i'm not sure issue is... sub findazuredataandcopyit() dim wbb excel.workbook dim wba excel.workbook dim ed excel.worksheet set wbb = workbooks("source.xlsx") set wba = workbooks("model.xlsb") dim col long, lastrow long dim rngm range dim rngsku range dim rngpo range if application.countif(wbb.sheets("b").rows(1), "plan_tamaward*") > 0 col = application.match("plan_tamaward*", wbb.sheets("b").rows(1), 0) lastrow = wbb.sheets("b").cells.find(what:="*", searchdirection:=xlprevious, searchorder:=xlbyrows).row set rngm = range(cells(2, col), cells(lastrow, col)) else msgbox "the column named plan_tamaward* not found in row1.", vbexclamation, "column not found!" exit sub end if 'set range sku if ap