Posts

Showing posts from July, 2013

r - incorrect grouping in plotting longitudinal data with ggplot -

Image
i trying plot longitudinal dataset ggplot. here example data illustrate problem. library(mass) library(ggplot2) library(dplyr) # create data dat.tx.a <- mvrnorm(n=250, mu=c(30, 20, 28), sigma=matrix(c(25.0, 17.5, 12.3, 17.5, 25.0, 17.5, 12.3, 17.5, 25.0), nrow=3, byrow=true)) dat.tx.b <- mvrnorm(n=250, mu=c(30, 20, 22), sigma=matrix(c(25.0, 17.5, 12.3, 17.5, 25.0, 17.5, 12.3, 17.5, 25.0), nrow=3, byrow=true)) dat <- data.frame(rbind(dat.tx.a, dat.tx.b)) names(dat) = c("measure.1", "measure.2", "measure.3") dat <- data.frame(subject.id=factor(1:500), tx=rep(c("a", "b"), each=250), dat) rm(dat.tx.a, dat.tx.b) dat <- reshape(dat, varying=c("measure.1", "measure.2...

dataframe - Choosing different amount of elements from each group in R -

i working on kaggle instacart competition, quite new r , have run can not figure out. i have dataset 4 columns. first column order id (id1). second column product id (id2). third column probability want select product id2 order id1 can consider ranking, higher probability selected on smaller probability. finally, fourth column amount of products want select given order (a feature of order). example, have here first 12 rows of dataframe df: id1 id2 prob num 1 17 13107 0.4756982 3 2 17 21463 0.3724126 3 3 17 38777 0.3534422 3 4 17 21709 0.3364623 3 5 17 47766 0.3364623 3 6 17 39275 0.3165896 3 7 34 16083 0.4093785 4 8 34 39475 0.3892882 4 9 34 47766 0.3892882 4 10 34 2596 0.3837562 4 11 34 21137 0.3762758 4 12 34 477...

Laravel Dusk: The correct localhost port for APP_URL on a remote server? -

i trying install dusk on laravel @ remote host , @ point need change .env file this app_url=http://localhost:8000 another tutorial suggested app_url=http://localhost:9515 for remote host, need put " http://localhost :????" , if need how find port number? not leave "/"? by way, have tested several options , non have worked far not sure causes trying pint point problem. set app_url same url using in browser local development environment. can http://localhost custom url: app_url=http://dusk.local for laravel homestead can manage sites within homestead.yaml file. the app_url somehow important commands terminal require information pointed out in detail in this answer . the port 9515 default port number of selenium server url provided in dusktestcase.php . there's no need change @ beginning should work out of box . by default, ports forwarded homestead environment.

c# - Sine wave clicking with Beep.BeepBeep -

originally, project make song in windows console using c# used console.beep(freq,time); , unreliability of caused desyncs. i changed using beep beep class. problem when playing baseline, there audible click @ end of every note. here's example . single note it's not bad, many consecutive notes it's unbearable. even when opened in wave editor, no matter cropped it clicked. how can rid of clicking, without installing bulky libraries c# console project? have tried ramping amplitude @ start of sound , down again @ end. so, modify inner loop of beep beep class, reads... (int t = 0; t < samples; t++) { short sample = system.convert.toint16(a * math.sin(deltaft * t)); bw.write(sample); bw.write(sample); } could modified this (int t=0; t < samples; t++) { double ampramp = 1.0d; if (t<1000) { ampramp = ((double) t) / 1000.0d; } else if (t > samples - 1000) { ampramp = ((double) (sa...

jquery - JS checkbox enable/disable groups of inputs NOT working when inputs wrapped in DIVs -

i've been looking way enable/disable groups of inputs corresponding checkbox. found 1 answer works me here . however, works when inputs not wrapped in divs. when add bootstrap-classes divs, script stops working. here script: $('input[type="checkbox"]').change(function(){ $(this).nextuntil(':not(input:text)').prop('disabled', !this.checked) }).change() not acquainted jquery, i've found out nextuntil() method include until next element not "input:text". so, tried expanding follows: $(this).nextuntil(':not(input:text, div)').prop('disabled', !this.checked) or $(this).nextuntil(':not(input:text), :not(div)').prop('disabled', !this.checked) or $(this).nextuntil(':not(input:text)', ':not(input:text)').prop('disabled', !this.checked) nothing works. did read listing multiple selectors apparently don't understand how correctly it. here html (dynamically gener...

python - Select a specific object from a queryset django -

is there way select specific object found in results of queryset selecting item in array. in arrays, can select specific item based on position: arrayname = {55, 33, 34, 23} arrayname[2] result = 34 i want accomplish same thing queryset results users in database = {steve, chris, jame, cole, casper, courtney} query filter names start c result = {chris, cole, casper, courtney} after results, want select casper results... there way array. something results[2] update so have part of view working specify specific record. my other question see if possible same thing in html tempalte file... here have in view , html file. there way same thing ht ehtml file... view.py i=0 form in formset: cd = form.cleaned_data currentamount = cd['amount'] currentdescription = cd['description'] print(currentamount) ...

c - Glut object's moving without telling -

i'm working glut , c, purpose screen 3d lego , 2 kaplas dynamic width, height , depth. there's few keyboard listeners move camera, , rotate kaplas. my problem : when press touch of keyboard or mouse (wich not dealed in code) lego x , z positions increased ! here's code , details : int main(int argc, char **argv) { // init glut , create window glutinit(&argc, argv); glutinitdisplaymode(glut_depth | glut_double | glut_rgba); glutinitwindowposition(100,100); glutinitwindowsize(800,800); glutcreatewindow("lighthouse3d- glut tutorial"); glclearcolor(0.5f, 0.5f, 0.5f, 0.5f); glutdisplayfunc(renderscene); //my display function glutreshapefunc(resize); //my reshape function glutkeyboardfunc(key); //basic keyboard listener function glutspecialfunc(specialkey); //special keyboard listener function glenable(gl_depth_test); glenable(gl_normalize); glenable(gl_color_material); glenable(gl_lighting); glenable(g...

c# - WPF Create a kind of "variable" in xaml code in order to use in the rest of xaml code -

i wonder whether in xaml there possibility create "kind" of variable , use rest of xaml code. example, suppose many controls share same width can declare width once in xaml , use in xaml code? you can define "variables" in resources, prefer use styles, set properties same value: xmlns:sys="clr-namespace:system;assembly=mscorlib" <window.resources> <sys:double x:key="yourvar">30.0</sys:double> </window.resources> <combobox> <combobox.items> <comboboxitem fontsize="{binding source={staticresource yourvar}}">1</comboboxitem> <comboboxitem>2</comboboxitem> <comboboxitem>3</comboboxitem> </combobox.items> </combobox>

apache - Not able to save from Word to WebDAV folder (LOCK on files) -

i setup webdav on ubuntu using apache2 , mods dav , dav_fs , dav_lock . connecting webdav folders works fine, both windows , linux clients. creating (writing) , modifying documents possible. then problem when try save documents word. word first creates file on server, following error appears: there has been network or file permission error. network connection may lost https://support.microsoft.com/en-us/help/291156/you-receive-a-there-has-been-a-network-or-file-permission-error--the-n (solutions there don't help) apache error.log : could not delete /pinakos/admin/66aee86c.tmp due failed precondition (e.g. locks). [423, #0] resource locked , "if:" header not supplied allow access resource. [423, #0] not move /pinakos/admin/6a71e678.tmp due failed precondition on source (e.g. locks). [424, #0] error occurred on resource, preventing requested operation on resource. [424, #0] not delete /pinakos/admin/6a71e678.tmp due failed precondition (e.g. locks). [...

My android app icon has a coloured background instead of transparent: -

my android app icon png image transparent background . in image asset configuration in android studio, set shape none . still, whenever app installed on device, purple square background present. on version of android, app icon background transparent. how remove it? can please shed light?

Sum values based on first occurrence of other column using excel formula -

Image
let's have following 2 columns in excel spreadsheet a b 1 10 1 10 1 10 2 20 3 5 3 5 and sum values b-column represents first occurrence of value in a-column using formula. expect following result: result = b1+b4+b5 = 35 i.e., sum column b unique value exists in same row column a. in case if ai = aj , bi=bj , i,j represents row positions. means if 2 rows a-column have same value, corresponding values b-column same. can have value sorted column values, prefer have formula works regardless of sorting. i found post refers same problem, proposed solution not able understand. use sumproduct , countif: =sumproduct(b1:b6/countif(a1:a6,a1:a6)) to make dynamic, grows , shrinks data set use this: =sumproduct($b$1:index(b:b,match(1e+99,b:b))/countif($a$1:index(a:a,match(1e+99,b:b)),$a$1:index(a:a,match(1e+99,b:b))))

qt - SDDM fonts not loading -

i have issue sddm. when use sddm-greeter in test-mode works fine. after rebooting, can see theme fonts not displayed. whatever theme used have same issue. i'm using qt-5.9.0 , latest version (0.14.0) of sddm. do know how solve this? ­­­­­­­­­­­­­­­­­­­­­­­­­

java - IBM JDBC DB2 Back-End Connection behind Firewall -

i'm creating java liberty web application on dedicated bluemix server. i'm trying create connection db2 on ibm's zos , trying use jdbc connection. can connect locally on machine, when attempts connection on application, it's throwing error: [err] error message: [jcc][t4][10380][11951][3.65.97] required property "fpd1dbv.bhprod.ibm.com" unknown host. errorcode=-4222 , sqlstate=08001 [err] sqlstate: 08001 [err] error code: -4222 [err] com.ibm.db2.jcc.am.sqlnontransientconnectionexception: [jcc][t4][10380][11951][3.65.97] required property "fpd1dbv.bhprod.ibm.com" unknown host. errorcode=-4222, sqlstate=08001 i have entered server.xml file within web application structure: <library id="db2jcc4lib"> <fileset dir="/src/main/webapp/web-inf/lib" includes="db2jcc4.jar db2jcc_license_cisuz.jar db2jcc_license_cu.jar db2jcc.jar"/> </library> <datasource id="db2" jn...

How to pull string value in url using scala regex? -

i have below urls in applications, want take 1 of value in urls. example: rapidvie value 416 input url: http://localhost:8080/bladdey/shop/?rapidview=416&projectkey=dsci&view=detail& output should be: 416 i've written code in scala using import java.util.regex.{matcher, pattern} val p: pattern = pattern.compile("[?&]rapidview=(\\d+)[?&]")**strong text** val m:matcher = p.matcher(url) if(m.find()) println(m.group(1)) i getting output, want migrate scala using scala.util.matching library. how implement in simply? this code working java utils. in scala, may use unanchored regex within match block captured part: val s = "http://localhost:8080/bladdey/shop/?rapidview=416&projectkey=dsci&view=detail&" val pattern ="""[?&]rapidview=(\d+)""".r.unanchored val res = s match { case pattern(rapidview) => rapidview case _ => "...

Is there a way to return a custom value for min and max in Python? -

i have custom class, class a: def __init__(self, a, b): self.a = self.b = b the class not iterable or indexable or that. if @ possible, keep way. possible have following work? >>> x = a(1, 2) >>> min(x) 1 >>> max(x) 2 what got me thinking min , max listed "common sequence operations" in docs . since range considered sequence type same docs, thinking there must sort of optimization possible range , , perhaps take advantage of it. perhaps there magic method not aware of enable this? yes. when min takes 1 arguments assumes iterable, iterates on , takes minimum value. so, class a: def __init__(self, a, b): self.a = self.b = b def __iter__(self): yield self.a yield self.b should work. additional note: if don't want use __iter__ , don't know of way that. want create own min function, calls __min__ method if there 1 in argument passed , calls old min el...

json - Where does Apache Qpid GUI make changes on disk? -

i'm trying delete port interface on qpid without using broker management gui. making change manually (using gui) reveals config.json modified when port deleted (from using diff ). my code solution uses sed delete necessary lines config.json . this not working intended however, , think file needs modified. i have diffed entire qpid-broker directory, seeing config.json changed using gui. is there database, or other change i'm missing delete port? cannot use gui. thanks the recommended approach use rest api customise broker's configuration. there couple of examples in documentation started, including couple of command line examples using curl. web management console uses rest api itself, can use tools such firebug watch rest interactions makes additional inspiration. https://qpid.apache.org/releases/qpid-java-6.1.4/java-broker/book/java-broker-management-channel-rest-api.html

Beginner R: Script for a Friedman Test -

i looking friedman test on data, attached below. sure solution simple (i know there friedman.test command), complete beginner r , stats overall , can't figure out how make work. in section gives example , says command friedman.test(yourdata) , when try turns error: error in friedman.test.default(q) : argument "groups" missing, no default i think difference between data , example example matrix , data apparently isn't. can make data matrix? if not, need include after freidman.test() make calculation data? any appreciated! > dput(q) structure(list(rt1 = c(4l, 5l, 4l, 4l, 5l, 4l, 4l, 5l, 2l, 4l, 3l, 3l, 3l, 4l, 4l, 3l, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, 4l, 4l, 4l, na, 3l, na, 5l, na, na, 4l, 1l, 4l, na), rt2 = c(4l, 4l, 3l, 4l, 5l, 3l, 4l, 5l, 4l, 4l, na, 4l, 3l, 4l, 4l, 1l, 3l, 5l, 4l, 4l, 5l, 4l, 3l, 5l, 3l, 4l, 4l, 4l, 4l, 5l, 3l, 5l, 5l, 5l, 4l, 4l, 4l, 5l, 5l, 4l, na, na, na, 4l), rt3 = c(4l, 4l, 3l, 4l, 5l, 3l, 4...

Creating an Object implementing a Typescript Interface -

i'm providing public interface data, performance , memory reasons want use object , not class. there's no code on interface, purely data structure. i want able declare object using interface if change interface it'll show error , doesn't missed. interface datastructure { key1: string; key2: number; key3: boolean; key4: null; } const defaultdata: {[key: string]: propertydescriptor} = { key1: {writable: true, enumerable: true}, key2: {writable: true, enumerable: true}, key3: {writable: true, enumerable: true} }; var mydata = object.create(null, defaultdata); i want report error missing key4 in defaultdata object, can't quite figure out how right now. (this needed due potentially tens of thousands of objects needing same structure, , not wanting waste gc on them when it's easier re-use them - wanting map stores, no need object prototype chain.) i think you're looking for: const defaultdata: {[k in keyof datastruct...

sharepoint 2013 - Totals Column MDX Query -

i'm new mdx , have small problem, can me. i have analytic chart following query: with member [articulo].[art_linea].[ aggregation] aggregate({[articulo].[art_linea].&[3m],[articulo].[art_linea].&[bendix]}) ,solve_order = 0 select hierarchize ( { [almacen].[alm_nombre].&[matriz] ,[almacen].[alm_nombre].&[toluca] } ) * { [measures].[val] ,[measures].[disponible] } on columns ,hierarchize ( { [articulo].[lcd].[art_linea].&[3m] ,[articulo].[lcd].[art_linea].&[bendix] } ) on rows [inventario] [articulo].[art_linea].[ aggregation] cell properties value ,formatted_value ,cell_ordinal ,font_flags ,fore_color ,back_color; which returns following grid: analytic chart i add "totals" column sum of "val" , "disponible" measures of columns "matriz" , "toluca" each "articulo lcd". could gui...

ruby on rails 5 - Heroku integration with Rubymine fails with error "Please specify a version along with Heroku's API MIME type." I -

encountered problem fresh install of rubymine mac, ruby , rails , following roku integration steps in https://www.jetbrains.com/help/ruby/heroku-getting-started.html i tried deleting directory .local/share/heroku , heroku update, not fix issue, occurs both when, trying upload public key file, , when trying deploy application heroku run configuration.

apache - apache2.conf need allow to acces just one file -

here current apache2.conf <directory /var/www/> order deny,allow deny allow 127.0.0.1 ::1 allow localhost allow 10 satisfy but want allow access 1 file http://my_server_ip/handl.php should do?

r - How do I count total items in a column based off of both ID and date without using a for loop? -

i have column of dates [6-13 6-13 7-13 ...], ids, [1 27 34 555 ...] , column of 1's , 2's represent event on day. trying count, each date given , each id given, total number of 1 , twos (or total number of days match day , id). in language might write similar below psuedo-code: for id in ids date in dates *count number of days id == id , date == date* how can without loop? we can dplyr library(dplyr) df1 %>% count(date, id, anothercol)

Delete extra rows in an excel file with powershell? -

i have been tasked automate part of logging process on spla server owned company. task date, archive, , remove old files, move onto generating report emailed department. task supposed ran @ end of every week. i figured powershell best option complete task. first time working powershell had bit of learning do. my question: is possible loop through excel worksheet , delete unused rows using script? my condition if there 2 empty rows -> delete 1 row , keep going i taking info log , splitting csv converting csv excel formatting. sample of excel spreadsheet, others vary in excess rows between information get-childitem c:\scriptsdirectory1\*.log | foreach{ $input = get-content $_.fullname #initialize input $a = get-date #save current date (for if/else wrapper) #=============================================# # file name changer # #===...

jquery - Add dynamic sr.no to table row -

i want add dynamic sr.nos dynamically added row. have completed dynamically row adding functinality, stuck in dynamically add sr.no pls me sort out this. suggest me if updation require in row adding code. my code follows $(document).ready(function() { $('.del').live('click', function() { $(this).parent().parent().remove(); }); $('.add').live('click', function() { $(this).val('delete'); $(this).attr('class', 'del'); var appendtxt = "<tr> <td>1</td> <td> <select id='additems' name='additems' class='form-control' required='required'> <option selected>-- select --</option> <option><a href='' id='addnewpo'>add new</a></option> <option value='1'> abc </option> <option valu...

mysql - HIbernate batch insert or update not working in spring boot -

i need update bulk inserts(nearly 10000) in mysql database. using jpa/hibernate , spring boot. read performing bulk insert/update in hibernate hibernate documentation ,i think code not working sequentially inserting hibernate queries instead performing in group. below code. am missing something? here datasource configuration. @component public class datasource `enter code here`{ @autowired envconfiguration configuration; private static final logger logger = loggerfactory.getlogger(datasource.class); @bean public datasource datasource(){ logger.info("datasource bean creation..."); drivermanagerdatasource datasource = new drivermanagerdatasource(); datasource.setdriverclassname(configuration.getdbdriver()); datasource.seturl("jdbc:mysql://"+configuration.getdbip()+":"+configuration.getdbport()+"/"+configuration.getdbname()+"?autoreconnect=true&usessl=false"); data...

Upgrade from Visual Studio 2010 to Visual Studio 2015 - Virtual directory issues -

i using visual studio 2015, update 3 professional edition , upgrading vs 2010 project vs 2015. published project in vs 2015 works fine, issues running locally. when run project locally, get- http error 500.19 - internal server error requested page cannot accessed because related configuration data page invalid. detailed error information: module iis web core notification beginrequest handler not yet determined error code 0x80070021 config error configuration section not allowed set below application config file \\?\c:\my directory\web.config config source: 104: <system.webserver> 105: <modules runallmanagedmodulesforallrequests="true"/> 106: <validation validateintegratedmodeconfiguration="false"/> (i dont see in web.config file. not sure coming from) used dev tools in chrome , gave number of 404 errors bunch of js files. seems issue virt...

r - Unlist a data.frame column -

i have data.frame contains data of facebook page 167 objects i take "message" column , separate hashtags stringr. produces list called "hashes" of 67. msg <- page$message hashes <- str_extract_all(msg,"#\\s+") i append hashes empty column created, called hashtags. page$hashtags <- na page$hashtags <- hashes however column "hashtags" list. if unlist(page$hashtags) turns na . conversely, if unlist "hashes", can't find way re-append data.frame because have different numbers of objects. i feel i'm missing simple , need apply family or dplyr ? any appreciated. for unlisting list-columns, need call unnest tidyr package. unnest(dataframe, nameofcolumns) best, colin

python - Only Search the Exact Match -

so, have long list (example truncated) values this: derp = [[('interface_name', 'interface-1'), ('ip_address', '10.1.1.1'), ('mac_address', 'xx:xx:xx:xx:xx:xx')], [('interface_name', 'interface 2'), ('ip_address', '10.1.1.2'), ('mac_address', 'xx:xx:xx:xx:xx:xx')], [('interface_name', 'interface 3'), ('ip_address', '10.1.1.11'), ('mac_address', 'xx:xx:xx:xx:xx:xx')]] i have function goes through massive list , pulls out match based on ip problem is, seems match on in last octet , not exact match. findip = sys.argv[1] def arpint(arp_info): val in arp_info: if re.search(findip, str(val)): interface = val.pop(0) string = val print string, interface[1] arpint(derp) so in above case, if findip = '10.1.1.1' come 10.1.1.1 , 10.1.1.11. i'd imagine there has way force input is... ...

c# - Entity Framework 6 specific column mapping -

in sql, tell database foreign key constraint is. but fluent ef6 apparently not have way me specify column use when binding collections. is not possible tell dbmodelbuilder column bind relationships on? or demand primary key @ times? table_person id int // pkey. multiple people records uniqueid int // unique person sometext varchar(256) // database therefore tracks changes this, since unique person can have many records (pkeys). table_address id int //pkey fk_unique int // should map uniqueid of person, not pkey. line1 varchar(512) state varchar(64) etc 1 unique person has many records, , uniqueid (not pkey) has many associated addresses. actual structure far more complex that. looking way fundamentally... would have icollection<address> addresses within persons model. enable such thing code-first migrations... seems impossible? yes add-migration , modify generated code/sql manually. doesn't defeat point? or common ...

ngrx store - angular 2 losing data on page reload -

i list of reservations ngrx/store this, data comes in disappears when page reloads. have change routes back. ngoninit() { this.store.select(state => state.authstate.profile).subscribe(profile => { this.profile = profile; if (this.profile) { this.userid = this.profile.$key; } }); if (this.userid) { this.reservations$ = this.reservationservice.loaduserreservations(this.userid); } } ngonchanges() { if (this.userid) { this.reservations$ = this.reservationservice.loaduserreservations(this.userid); } } not sure if enough code illustrate problem. in auth service this.auth$.authstate.subscribe(user => { if (user) { const userdata = user; const userref = db.object("users/" + userdata.uid); const datatoset = { displayname: userdata.providerdata[0].displayname, email: userdata.providerdata[0].email, photourl: userdata.providerdata[0].photourl, providerid: userdata.provider...

angular - What is ng-template and why do I bind *ngIf then else to it? -

when use *ngif and/or else statement, why have bind template variable attached ng-template element? example: this works: <div *ngif="show; else elseblock">text show</div> <ng-template #elseblock>alternate text while primary text hidden</ng-template> but not work: <div *ngif="show; else elseblock">text show</div> <div #elseblock>alternate text while primary text hidden</div> i noticed adding class not work either: <ng-template #elseblock class="my-class"> alternate text while primary text hidden </ng-template> what's special ng-template ? how different? this because structural directives in angular create embedded views. embedded view created using both templateref , viewcontainerref . can read more them in exploring angular dom manipulation techniques using viewcontainerref . an embedded view similar host views created components. view contains nodes see in com...

Using local package for Docker's requirements file -

i have cloned open-source project called flasgger ( https://github.com/rochacbruno/flasgger ) local folder. , added changes it. now run docker using requirments.txt : docker run \ ... -r requirements.txt \ .... before clone requirements.txt looked like: flasgger==0.6.5 and download , use flasgger internet. question: how modify requirements.txt use local copy of flasgger ? ideally run python setup.py bdist_wheel in custom flasgger source , upload generated .whl -file private python package repository can install pip in dockerfile ( devpi easy set up ) to install python package private package repo: run pip install --index-url <url repo> <package name==version> or run pip install --index-url <url repo> -r custom-requirements.txt the advantage package repo can build , tag versions of packages ability roll or delay upgrades. a cheaper alternative copy in .whl file in image , install pip . it's possible insta...

rest - Microsoft bot framework broke on its own -

i getting token request: { "error": "invalid_request", "error_description": "aadsts90002: no service namespace named 'botframework.com' found in data store.\r\ntrace id: d164a5d4-2c28-4491-bd88-1f8b31b52800\r\ncorrelation id: 3ab5127e-690e-40b6-a433-2986bd711541\r\ntimestamp: 2017-07-25 18:38:00z", "error_codes": [90002], "timestamp": "2017-07-25 18:38:00z", "trace_id": "d164a5d4-2c28-4491-bd88-1f8b31b52800", "correlation_id": "3ab5127e-690e-40b6-a433-2986bd711541" } has namespace changed? can't figure out anywhere. it's v3.1 don't see why not working? i sending request https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token its issue bot framework authentication portal.ms have acknowledged , working fixed. see issue report , comment . https://github.com/microsoft/botbuilder/issues/3197

python - Difficulty converting string to JSON object in order to urlencode it -

i'm having trouble converting string built on script json object (i'm trying build post data make post request api endpoint). i'm getting following error: bos-mpqpu:config_parse rabdelaz$ python3 lexparse.py {"__class__":"httptestclient","description":"cp codes","url":"://","serverip":"","method":"get","enabled":true,"headers":[],"tests":[],"purge":false,"procs":[]} traceback (most recent call last): file "lexparse.py", line 448, in <module> print(ast.literal_eval(test_case_act_template.substitute({'protocol': "",'host': "", 'path' : "", 'query' : "", 'serverip' : "", 'tests' : ""}))) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/ast.py", line 85, in literal_e...

How to use firebase auth, storage and push notifications in android app which represents a webview for the webapp using Firebase as backend -

i have setup firebase auth , storage backend responsive web app hosted on private servers (and not firebase deploy). , plan use same web app inside webview in android app. do need setup firebase auth , storage again android plan have separate login activity screen? , in case, in authenticated state webview launches activity screen, activity need have separate handling firebase auth? i couldn't find in firebase auth documentation explains how handle webview enabled web apps on android in case of cross platform development. i don't intend use cordova/ ionic or other 3rd party tool development.

codeigniter - Upload Multiple Image when code moved to another laptop it shows error -

i did best debug code in first laptop , worked out when move laptop began show errors again cannot understand reason why. controller public function uploadcollateralimage_front() { $config['upload_path'] = './uploads/files'; $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = '2408'; $config['max_width'] = '2408'; $config['max_height'] = '2408'; $this->load->library('upload', $config); if ( !$this->upload->do_upload('userfile1')){ $error = array('error'.'hey' => $this->upload->display_errors()); var_dump( $error); die; }else{ $filename = $this->upload->data(); $post_image = $filename['file_name']; // var_dump($post_image); die; return $post_image; } } view <?php $attributes = array('name' => 'applicationfo...

xCode crash when i run app on my iPhone -

hi guys have strange problem. trying run app on iphone, xcode has sudden crash. happens if use university account develop. if sign application personal account (the 1 signature expires after 7 days) xcode not crash. why ?! if start app on emulator university account, not crash. :o this crash log: system integrity protection: enabled crashed thread: 0 dispatch queue: com.apple.main-thread exception type: exc_crash (sigabrt) exception codes: 0x0000000000000000, 0x0000000000000000 exception note: exc_corpse_notify application specific information: mainqueue: -[ideprovisioningmanager setdelegate:callbackqueue:]_block_invoke productbuildversion: 8e3004b assertion failure in /library/caches/com.apple.xbs/sources/ideframeworks/ideframeworks-12175.1/idefoundation/provisioning/mechanic/useractions/ideprovisioninguseraction.m:125 details: method -[ideprovisioninguseraction useractionname] responsibility of subclasses of ideprovisioningpermissionsfa...

Is it possible to parse Vue.js data with jQuery? -

i have line of jquery code: $("#shownames").text("{{ $t('hide_labels') }}"); i'd set text of #shownames element value taken vue-i18n instance, dependent on user localization. when it's written way, literal moustache syntax contents. there way values displayed? you can this: $("#shownames").text(this.$t('hide_labels')); if choose. it's best use vue methods update dom, available if need it.

swift - How to get some parameter in the child class through the base class -

i'm stuck. try make right code's architect can not solve following case: have base class , inherited class like: class baseclass { var name: string init(name: string) { self.name = name } } class childclass: baseclass { var othername: string init(othername: string) { self.othername = othername } } and following function: func somefunc() -> baseclass { let = childclass.init(othername: "name") return } how can parameter "othername"? available parameter 1 - "name", want "othername": let b = somefunc() b.parameters you can use: (b as! childclass).othername your function returns object baseclass object, can't access of childclass methods. in order access childclass methods, need cast object childclass using as! , know childclass object. after you'll able access parameters of childclass .

pattern matching - F# Match with complex type -

i'm new f# , i'm trying simple pattern matching complex type cannot find way of doing it. see pseudo code below explain pattern matching want do. type vector= {x:int; y:int} let calculatedirection vector = match vector | vector.x=0 && vector.y>0 -> "n" // pseudo code | vector.x>0 && vector.y>0 -> "ne" // pseudo code | vector.x>0 && vector.y=0 -> "e" // pseudo code | vector.x>0 && vector.y<0 -> "se" // pseudo code | vector.x=0 && vector.y<0 -> "s" // pseudo code | vector.x<0 && vector.y<0 -> "sw" // pseudo code | vector.x<0 && vector.y=0 -> "w" // pseudo code | vector.x<0 && vector.y>0 -> "nw" // pseudo code | _ -> "error" i read few tutorials ( https://fsharpforfunandprofit.com/posts/match-expression/ ) it's simple scenario...

Resize a table automatically in Excel -

i have excel register results of particles in cleanrooms. excel consist in table 3 columns , 39 rows (the big cleanroom have quantity of points). first columns contains correlative number (1 2 3 4 5...). so, want find method automatically resize table based in value of cell in same sheet. for example, if put 10 in cell, table, automatically, have 3 columns , 10 rows (if possible, first column having correlative numeration) that help. can't put example because i'm writing on phone.

c# - Where to put the business logic for updating tables? -

where put createorder () business logic? class order // entity model dbcontext { public int id { set; get; } public string name { set; get; } } public void createorder(details details) { // set order fields database_name.order.add(order); } controller call obj.createorder(details); would go in different class in app_code folder? the answer question has been debated quite bit. depends on how want structure application. can see multiple viewpoints question here: mvc: put business logic? i have seen applications createorder method part of model (in case order class). i have seen lot of applications keep model clean possbile (poco classes, have) , put createorder method in business layer handles business specific rules, , createorder method in data layer handle commiting database. some designs work better small applicaitons, while others work better more complex applicaitons.

mysql - MySQLI SELECT with multiple clauses for epoch timestamps selection -

i have epoch timestamps "part_epoch" column, table name "crud_mysqli" i select associated "part_id" value next future timestamps. (avoid research past timestamps) the following mysqli query should select min (next) value within future : > now. but not return anything. return expected return if state clauses seperately, combining clauses below returns no result. would please tell me wrong here : // find next event part_id name : // select lowest (next) part_id value in future (do not select winthin past part_epoch values) $query = "select part_id crud_mysqli (part_epoch = (select min(part_epoch) crud_mysqli)) , (part_epoch > unix_timestamp(now())) "; where (part_epoch = (select min(part_epoch) crud_mysqli)) here take entry lowest timestamp, somthing in past. and (part_epoch > unix_timestamp(now())) and here say, should in future. 2 conditions excluding each other, if have entr...