Posts

Showing posts from March, 2012

ios - How to customize GKGameSession message notifications? -

i can't figure out how customize gkgamesession message notifications, if it's possible. default notifications include snippet of text supply when sending message, result awkwardly worded, uses game center icon instead of app's icon, , plays annoying little jingle. ideally, i'd modify gkgamesession message notifications notification content extension, when created 1 in app, not invoked. any ideas? thanks.

javascript - Add a close icon in a panel -

i want add close icon on right of title of panel. cannot put inside panel: <!doctype html> <html> <head> <script src="https://code.jquery.com/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <title>js bin</title> <style> .panel { background: #ffffff; padding: 7px 10px; } .x_title { border-bottom:2px solid #e6e9ed; margin-bottom:10px; padding:1px 5px 6px; font-size:16px; } .x_title .actions { position: absolute; right: 0; top: 0; line-height: 3 } .x_title .list-inline { margin-left: -13px; padding-left: -5px; } .x_content { margin-top:5px; ...

python - Update values of a matrix variable in tensorflow, advanced indexing -

i create function every line of given data x, applying softmax function sampled classes, lets 2, out of k total classes. in simple python code seems that: def softy(x,w, num_samples): n = x.shape[0] k = w.shape[0] s = np.zeros((n,k)) ar_to_sof = np.zeros(num_samples) sampled_ind = np.zeros(num_samples, dtype = int) line in range(n): samp in range(num_samples): sampled_ind[samp] = randint(0,k-1) ar_to_sof[samp] = np.dot(x[line],np.transpose(w[sampled_ind[samp]])) ar_to_sof = softmax(ar_to_sof) s[line][sampled_ind] = ar_to_sof return s s contain zeros, , non_zero values in indexes defined every line array "samped_ind". implement using tensorflow. problem contains "advanced" indexing , cannot find way using library create that. i trying using code: s = tf.variable(tf.zeros((n,k))) tfx = tf.placeholder(tf.float32,shape=(none,d)) wsampled = tf.placeholder(tf.float32, shap...

linked list - Writing my own peek() method for my own LinkedList class in Java -

so i've been asked write peek() method linked list in java. thing object want "peek" private variable of type base exists in private class within linkedlist class. use peek() method return object , print out. know has accessing private variable can't quite make work have. here snippet of code: class linkedstack <base> { private class run { private base object; private run next; private run (base object, run next) { this.object = object; this.next = next; } } ... public base peek() { if(isempty()) { throw new illegalstateexception("list empty"); } return object; //this throws error } ... public void push(base object) { top = new run(object, top); } } class driver { public static void main(string []args) { linkedstack<string> s = new linkedstack<string>(); ...

c++ - Unable to compile simple Boost MPI example -

i trying use mpi c++ boost using following code: #include <boost/mpi/environment.hpp> #include <boost/mpi/communicator.hpp> #include <iostream> namespace mpi = boost::mpi; int main() { mpi::environment env; mpi::communicator world; std::cout << "i process " << world.rank() << "on " << world.size() << "." << std::endl; return 0; } and have boost mpi compiled , installed: ~ ls /usr/local/include/boost | grep mpi mpi mpi.hpp ~ ls /usr/local/lib | grep mpi libboost_mpi.a libboost_mpi.so libboost_mpi.so.1.62.0 ~ ls /usr/local/lib | grep serialization libboost_serialization.a libboost_serialization.so libboost_serialization.so.1.62.0 libboost_wserialization.a libboost_wserialization.so libboost_wserialization.so.1.62.0 compiling using mpic++ -l/usr/local/lib -i/usr/local/include/boost/mpi -lboost_mpi-...

vb.net error "startindex cannot be larger than length of string" I reversed text direction when typing in a textbox from ltr, to rtl -

i using visual studio 2010 , have been having error saying "startindex cannot larger length of string" reversed text direction when typing in textbox left right.. right left. backspace supposed delete texts on left of blinking cursor, since changed text direction, want backspace delete on left side of blinking cursor instead. example... when entered 4 numbers, 4321 moved cursor in middle of 3 , 2 press backspace 3 times, generates said error.here our code here our error , here our code private sub textbox3_keypress(sender object, e system.windows.forms.keypresseventargs) handles textbox3.keypress if e.keychar = chr(8) dim tb textbox = ctype(sender, textbox) dim stext string = tb.text dim isel_start_pos int64 if stext.length > 0 if tb.selectionstart = 0 stext = stext.substring(1) isel_start_pos = 0 else stext = stext.substring(0, tb.selectionstart) & _ ...

javascript - Changing ng-model value when using ng-repeat and $index -

i have set of divs, inside ng-repeat. when use ng-model these, updating when change value of model function in controller. i.e., if change model, divs reflecting same value. html: <tbody ng-repeat="aw in aws"> <div ng-model="currentvalue" ng-init="initializeselects(aw.id)">{{currentvalue}}</div> controller code: $scope.initializeselects = function(awid) { $scope.currentvalue = "read"; } i tried changing code to: <tbody ng-repeat="(i, aw) in aws track $index"> <div ng-model="currentvalue[i]" ng-init="initializeselects(aw.id, i)">{{currentvalue[i]}}</div> and $scope.initializeselects = function(awid, i) { $scope.currentvalue[i] = "read"; } in case, currentvalue undefined , model value can not changed. why undefined? any inputs helpful, in advance!

c - Why does realloc() crash my program? -

i trying resize array dynamically through use of realloc . array initialized outside of function using malloc . here's function: size_t verarbeite_anlagendatei(anlage *anlage_arr) { file *fp; anlage anlage; fp = fopen("anlagen.dat", "r"); if(fp == null) { printf("anlagedatei existiert nicht. bitte mit menuepunkt (0) weiter machen.\n"); return 0; } int index = 0; size_t size = 1; while(fscanf(fp, "%d %s %s %f %d %d", &anlage.inventarnr, anlage.anlagenbez, anlage.standort, &anlage.basiswert, &anlage.nutzdauer, &anlage.anschjahr) != eof) { if(index > 0) { size++; realloc(anlage_arr, size * sizeof(anlage)); } anlage_arr[index] = anlage; index++; } return size; } i know have initialize new point...

java - JAXB ClassCastException due to root element having the same tag as its child element -

i unmarshalling xml file taken world bank web service. root element , children elements have same tag, shown below. getting classcastexception when unmarshalling. error goes away when change root element tag not same children. is jaxb unable handle scenario or not using jaxb properly? <data> <data> </data> ...... <data> </data> </data> here java code reference: xml tag issue: http://api.worldbank.org/countries/all/indicators/sp.pop.totl?format=xml main class public class countrypopparse { public list<countrypop> parse() throws jaxbexception, malformedurlexception, ioexception{ jaxbcontext jc = jaxbcontext.newinstance(countrypops.class); unmarshaller u = jc.createunmarshaller(); url url = new url("http://api.worldbank.org/countries/all/indicators/sp.pop.totl?format=xml"); countrypops countrypops = (countrypops) u.unmarshal(url); return countrypops.getcountr...

popup - How to disable Outlook Pop Up Notification when sending Email Via Access 2016? -

i using windows 8.1 pro , on surface pro 2. trying send e-mail via access 2016 , getting pop-up message saying "microsoft outlook" on top , message "a program trying send e-mail message on behalf. if unexpected, click deny , verify antivirus software date. more information e-mail safety , how might able avoid getting warning, click help." things have tried resolve issues. 1. access settings in trust center: macro settings: enable macros (not recommended; potentially dangerous code can run) activex settings: enable control without restriction , without prompting (not recommended; potential dangerous controls can run) in access 2016 not see option programmatic access. my outlook settings: macro settings: enable macros (not recommended; potentially dangerous code can run) programmatic access: antivirus status:valid never warn me suspicious activity (not recommended) attempting download anti-virus software microsoft - stay date microsoft security ...

java - How to calculate average from command line? Homework excercize -

i have make program calculates average, modal value , median of numbers insert on command line. numbers have in range [1,10] can't understand why stops. wrong? code: import java.lang.integer; import java.util.arrays; class stat{ public static void main(string[] args){ int i,median,modalvalue = 0; float average, sum = 0; int repetition[] = new int[args.length]; integer allnumbers[] = new integer[args.length]; //check numbers range try{ //reading args command line for( = 0; < args.length; i++){ //if not in range --> exception if(integer.parseint(args[i]) < 1 || integer.parseint(args[i]) > 10) throw new exception("exception: insert number out of range. restart programm."); //put numbers in array allnumbers[i] = new integer(args[i]); } /...

Translate Perl Script to T-SQL -

ok - need perl guru on one. co-worker provided me code perl application support , how encodes values before writes data oracle. don't ask me why did encoding (appears special characters). values being written clob in oracle. need equivalent decode use in ssis package in sql server. basically reading data oracle database using ssis package , need decode values. "+" sign between words easy replace statement (not sure best way, seems work far). this 1 beyond skill set, because perl script skills limited (yes have done reading, not turning out easy thought since don't know perl well). interested in decoding string not encoding. btw hint this, know %29 equals ")" sign. looks using regex, not versed in using either (i know need learn it). sub decodevalue($) { $varref = shift; ${$varref} =~ tr/+/ /; ${$varref} =~ s/%([a-fa-f0-9]{2})/pack("c",hex($1))/eg; ${$varref} =~ tr/\cm//; ${$varref} =~ s/...

angularjs - Angular ng-repeat with ng-src -

my project in visual studio , im trying use ng-src bind "imagelocation" it. <body ng-app="travelapp" ng-controller="controller" class=""> <div class="centering-container"> <div class="material-container"> <div class="padding-25"> <form class="form" role="search" method="get"> <div class="input-group"> <input type="text" class="form-control" placeholder="search" ng-model="searchterm"> <div class="input-group-btn"> <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> <div ...

javascript - on change jquery only works once for db values -

i have 3 select boxes ids first-choice, second-choice , third choice. <select id="first-choice" style="border-radius: 0; width: 100%;" class="form-control" name="area"> <option value="">-select-</option> <option value="">all</option> <?php global $connection; $area_query = "select distinct area archivo length(area) > 1"; $result_area = mysqli_query($connection, $area_query ); while($row_a = mysqli_fetch_array($result_area)): ?> <option><?php echo $row_a['area'] ?></option> <?php endwh...

pandas - Creating dataframe boxplot from dataframe with row and column multiindex -

Image
i have following pandas data frame , i'm trying create boxplot of "dur" value both client , server organized qdepth (qdepth on x-axis, duration on y-axis, 2 variables client , server ). seems need client , server as columns. haven't been able figure out trying combinations of unstack and reset_index`. here's dummy data recreated since didn't post yours aside image: qdepth,mode,runid,dur 1,client,0x1b7bd6ef955979b6e4c109b47690c862,7.0 1,client,0x45654ba030787e511a7f0f0be2db21d1,30.0 1,server,0xb760550f302d824630f930e3487b4444,19.0 1,server,0x7a044242aec034c44e01f1f339610916,95.0 2,client,0x51c88822b28dfa006bf38603d74f9911,15.0 2,client,0xd5a9028fddf9a400fd8513edbdc58de0,49.0 2,server,0x3943710e587e3932adda1cad8eaf2aeb,30.0 2,server,0xd67650fd984a48f2070de426e0a942b0,93.0 load data: df = pd.read_clipboard(sep=',', index_col=[0,1,2]) option 1: df.unstack(level=1).boxplot() option 2: df.unstack(level=[0,1]).boxplot() opti...

swift3 - How can I call a class method without creating a new instance of the class? -

let me try explain situation. i attempting create basic tower defense game. have gamescene file , tower file. in tower file, specify tower , range. in gamescene file, create tower. when tap tower, range appears. want range disappear when touch outside of tower (which works) , when touch different tower (doesn't work). my problem is, touch on tower not recognized in gamescene, having hard time telling game scene dismiss old tower's range when touch new tower. here code displays range when tower tapped (if statement determines if tap lands on existing range, in case range should go away): tower.swift if (location.y > theight || location.y < -theight) || (location.x > twidth || location.x < -twidth) { dismissrange() } else { showrange() } now, handle taps outside of existing towers, use: gamescene.swift func deselecttowers() { self.enumeratechildnodes(withname: "placedtower1", using: { node, stop in let tower = ...

amazon web services - I don't understand how to get the realm server running on the AWS AMI -

Image
i got aws running instance of ami service using ami-80347097 realm website. have ec2 instance now, don't know next. sorry i'm new sort of thing. what server url aws instance? , admin access token object server still same? or have specific in ec2 instance? tt.tt edit: ok got object dashboard work , able log in. thank helping me that. last step getting connected object server. server url object server be? i tried using realm://public url:9080 server url , got error realm sync error server connection problem assuming have initiated ami-80347097 instance realm-object-server service running. @ point make sure have enabled 9080 port in inbound rules section. necessary because going access realm object dashboard port enabled. steps: goto ec2 dashboard select "securit group" under "network & security" click on security group have been using ami-80347097 instance once have clicked security group configuration tab "descripti...

mmap - Why doesn't iOS support dynamic machine code generation? -

why ios don't support dynamic machine code generation? should because ios don't allow mmap memory can executable? this simple jit code basic jit , it show mmap api key run machine code.

Python programming about list -

Image
this question has answer here: removing duplicates in lists 30 answers in program want remove duplicate values list. wrote: list = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] def loop(): in range(len(list)-1): b in range(a+1,len(list)): if list[a] == list[b]: del list[a] print(list) loop() but, it's giving me error: can me? if have numpy can (i renamed list l avoid ambiguity): import numpy np l = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] l_no_duplicates = list( np.unique(l) )

java - Change Floating Action Button Background -

i using floating action button , image changes when clicked. have flag , store in shared preferences. when true icon becomes like.png, when false icon becomes dislike.png. i want change icon according flag variable when app starts icon default true.png how can set icon via shared preferences? public class readactivity extends appcompatactivity { private floatingactionbutton fab; private boolean flag; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_read); fab = (floatingactionbutton) findviewbyid(r.id.fab); getrate(getwindow().getdecorview().getrootview()); if(flag==false){ fab.setimageresource(r.drawable.like); } else if(flag==true){ fab.setimageresource(r.drawable.dislike); } fab.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { getrate(v); if(flag==false...

Paypal API Transaction information -

i'm selling items through third party website. it's digital content , use xenforo, when perform payment automatically added buyers list , able download. know how can paypal send me transaction information when payment completed, since i'm trying xenforo user id. can ipn? or never complete payment since i'll sending information server , never confirm transaction paypal? thanks in advance help!

html - Website content -

i've tried many ways code none of them works. 3 products listed vertically in 1 column. have no idea on how separate the following <div> containing 6 others product different columns beside it. can me solve this? or, in other ways, can <div> aligned 3 products per row, not in column? <div class="products-right-grids-position1"> <h4>bun boy bakery</h4> <p>best bakery in town </p> <p>&nbsp;</p> </div> </div> </div> <div class="products-right-grids-bottom"> <div class="col-md-4 products-right-grids-bottom-grid"> <?php echo getpros(); ?> <?php echo getbreadpros(); ?> </div> <div class="clearfix"> </div> </div> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <div class="container-fluid"> <div c...

multithreading - How to get thread-ids and their jobs in Filebench? -

i doing simulation experiment filebench . need print thread-ids , filenames operations want perform. there file named threadflow.c has information threads don't understand how access it. presently passing workload model language(wml) file specific application , got following results: cd filebench-master/ /filebench-master$ filebench -f mywebserver.f filebench version 1.5-alpha3 warning: not open /proc/sys/kernel/shmmax file! means ran filebench not root. filebench not increase shared region limits in case, can lead failures on workloads. 0.000: allocated 173mb of shared memory 0.002: web-server version 3.1 personality loaded 0.002: populating , pre-allocating filesets 0.002: logfiles populated: 1 files, avg. dir. width = 20, avg. dir. depth = 0.0, 0 leafdirs, 0.002mb total size 0.002: removing logfiles tree (if exists) 0.238: pre-allocating directories in logfiles tree 0.238: pre-allocating files in logfiles tree 0.242: bigfileset populated: 1000 files, avg. dir. width = 20, ...

OpenStack Sahara image register error -

Image
i'm trying introduce sahara cloud using hadoop , , it's not going well. tried follow openstack documents, didn't me. i'm trying add sahara dashboard command "pip install sahara-dashboard". sahara dashboard located @ /usr/local/lib/python2.7/dist-packages/saharadashboard . original dashboard located @ /usr/share/openstack-dashboard/openstack-dashboard , , added installed_apps = [ 'openstack_dashboard', 'saharadashboard', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'django_pyscss', 'openstack_dashboard.django_pyscss_fix', 'compressor', 'horizon', 'openstack_auth', ] to /usr/share/openstack-dashboard/openstack-dashboard/setting.py . and in /usr/share/openstack-dashboard/opensta...

javascript - Angular Binding field to Dynamic model modifies all values in object -

Image
so have code in view: <div class="form-group" ng-repeat="columnheader in form.table[fakeform.currentformindex].columns track $index"> <label for="">column <%$index%></label> <div class="fg-line"> <input type="text" class="form-control" placeholder="column header <%index%>" ng-model="form['table'][fakeform.currentformindex]['columns'][$index].name"/> </div> </div> this targets 'current active' appended element. whenever uses this, modifies other appended elements same attributes each of elements has unique key assigned them. then i'm pushing data set new key. 'columns':[{name:'column 1'}, {name:'column 2'}, {name:'column 3'}], 'rows':[ ...

apache/php symlink 403 permission forbidden -

i have project sitting in: dev/php/project . system apache2 server folder is: /var/www/html/ . and goal reach address: localhost/project/file.php . so have created symlink in /var/www/html folder so: sudo ln -s dev/php/project /var/www/html/project and after if try open localhost/project url. 403 forbidden error. searched alot , saw others have had same issues. tried follow how fix guides , none of them helped. all of guides should chmod symlink, when try excecute command: sudo chmod 0755 -r /var/www/html/* or directly: sudo chmod 0755 -r /var/www/html/project i get: chmod: cannot operate on dangling symlink '/var/www/html/project' i have tried use other chmod modules ( dont know how call them correctly, sorry) 777, x+o, , came across . tried create symlink 1 php file outcome same. can please me understand problem is? cant move forward because of issue. ready respond answers, questions.

css3 - Layout change after screen resize CSS -

i have various errors design. first of all , here link example site have been doing learn html , css. http://ramroweb.com/mnml/style.css when screen size resized items container moves right. though used margin: 0 auto; the whole content within div id="container" still selects upto section tag excluding footer tag . the background image not fit whole size creating padding on top . great if these queries. thank you... to responsive design try using percentages or vw/vh measurements. way elements relative sizes user screen size. it's practice make website mobile accessible, nicely fit in page when open on narrower screen. more here -> https://snook.ca/archives/html_and_css/vm-vh-units . example, check out code (obviously might want adjust scaling fit needs): body { width: 100%; background: url(img/beach.png) center no-repeat; background-color: #f3f2de; font-family: courier, monospace; font-size: 15%; margin: 0 auto; } ...

c# - Resolve IEnumerable with Autofac -

i trying build mediator pipeline mediatr , autofac struggling resolve collection of validators autofac. public class mediatorpipeline<trequest, tresponse> : iasyncrequesthandler<trequest, tresponse> trequest : iasyncrequest<tresponse> { private readonly iasyncrequesthandler<trequest, tresponse> _inner; private readonly ienumerable<ivalidator<trequest>> _validators; public mediatorpipeline(iasyncrequesthandler<trequest, tresponse> inner, ienumerable<ivalidator<trequest>> validators) { _inner = inner; _validators = validators; } ... } when put ivalidator<trequest> in constructor resolves fine, when put ienumerable<ivalidator<trequest>> fails, exception: container or service locator not configured or handlers not registered container. ---> autofac.core.dependencyresolutionexception: error occurred during activation of particular registration. he...

php - Admin Panel of my Website in not working on ipage.com but works on localhost -

i have created website working fine on localhost when upload on ipage.com login page of admin panel not accepting username , password.i had created database same username , password code of login page <?php session_save_path("/home/users/web/b1704/ipg.bwpresentscom/cgi-bin/tmp"); session_start(); ?> <!doctype html> <html> <head> <title>admin login</title> <link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="bootstrap/css/bootstrap.css" type="text/css" /> </head> <body> <div class="adminform"> <form method="post" action="login.php"> <input type="submit" name="login" value="" class="" style="width:100%; background:black; border:2px solid black;"> <button ...

php - Cordova WhiteList does not allow access to my Server -

i can not connect database because url rejected. url want access this: http://192.168.0.16/checkuser.php?nombre=asi&clave=1234 i have urls same structure, , have tried in config.xml file did not worked. <access origin="*" /> <access origin="http://192.168.0.16" subdomains="true" /> or <access origin="http://192.168.0.16/*"/> this complete code create path , call functions connect database: function pulluser(username,apodo,secondname,lastname,pass1,usermail){ var method='get'; var url = appconstants.requestpulluserurl(); //alert('cogidaurl: '+ url); var path = url + "?nombre="+username+"&apodo="+apodo+"&apellido1="+secondname+ "&apellido2="+lastname+"&email="+usermail+"&clave="+pass1; console.log(path); //alert('el path es: '+ path); var xhr = new xmlhttprequest(); ...

jboss7.x - What is the difference between host controller and process controller in JBoss EAP? -

in jboss eap 2 separate jvm's included management purposes. what difference between hostcontroller , processcontroller ? why need separate management processes? the hostcontroller process server process manages exchanges between host , domain controller. process controller there manage managed server processes on host.

javascript - Why this code throw "callback was already called" error? -

i have method inside call apis async.map() why calling callback inside request callback throw callback called ? while works outside it? request_async (testcase, bodies, method, url, cb) { async.map(bodies, (item, request_cb) => { // request_cb(null, true) fine if(item.values !== undefined ) { const data = { method: method, uri: url, formdata: item.values, jar: this.jar } request(data, (err, response, body) => { this.tests_count-- if (err) throw(err) testcase.compare(response.statuscode, body, item, url, function(message) { console.log(message) // request_cb(null, message) throw "callback called }); }); } }, (err, result) => { console.log('after response', result) cb(null, true) }) }

XML in to a PHP does not display an array -

i need display array php of data file xml ( https://pogoda.yandex.ru/static/cities.xml ). want in array "id". me find error. thanks <?php $data_file_city="https://pogoda.yandex.ru/static/cities.xml"; $xml_city = simplexml_load_file($data_file_city); foreach($xml_city->country $key=>$value){ foreach ($value->city $key1=>$value1) { $id = array("$value1[country]"); echo $id; } } every $value1 in foreach simplexmlelement object attributes. to attributes of such object use attributes function: $ids = array(); $countries = array(); foreach($xml_city->country $key=>$value){ foreach ($value->city $key1=>$value1) { $attrs = $value1->attributes(); // use `strval` function cast attribute value `string` type // `id` attribute $id = strval($attrs['id']); // `country` attribute $country = strval($attrs['country']); ...

node.js - Webpack hot reloading ENOENT no such file or directory -

i'm working ubuntu on windows. cloned fresh react-redux-starter-kit . there same problem react-redux-universal-hot-example , own implementations. after npm install started server npm start , page worked perfectly. as edit file following error: unhandled rejection error: module build failed: error: enoent: no such file or directory, open '/mnt/c/users/xxx/webstormprojects/react-redux-starter-kit/src/main.js' @ error (native) @ compiler.<anonymous> (/mnt/c/users/xxx/webstormprojects/react-redux-starter-kit/build/webpack.config.js:69:15) @ compiler.applyplugins (/mnt/c/users/xxx/webstormprojects/react-redux-starter-kit/node_modules/tapable/lib/tapable.js:26:37) @ watching._done (/mnt/c/users/xxx/webstormprojects/react-redux-starter-kit/node_modules/webpack/lib/compiler.js:78:17) @ watching.<anonymous> (/mnt/c/users/xxx/webstormprojects/react-redux-starter-kit/node_modules/webpack/lib/compiler.js:51:17) @ /mnt/c/users/xxx/webstormprojects/re...

java - Is there something wrong with my activity_main.xml? -

Image
i have noticed activity_main different others have seen on youtube. there wrong mine? mine blue while others have more realistic , different layout. the videos in youtube had blank activity (as far have seen).the newer version of android studio (2.2.2 case) has empty , basic activity. in empty activity. hence beautiful blue ui instead of old look.

php - validation value having two possible types -

how validate request value when should string or array both valid? 'val' => 'bail|required|string' 'val' => 'bail|required|array' what the validation expression? i don't think there way achieve using validation rules out of box. need use custom validation rules achieve this: in appserviceprovider 's boot method, add in public function boot() { validator::extend('string_or_array', function ($attribute, $value, $parameters, $validator) { return is_string($value) || is_array($value); }); } then can start using it: 'val' => 'bail|required|string_or_array' optionally can set custom validation error messages, or using custom validation class achieve it. check out doc link above more information.

android equalizer crashes if library not loaded -

i trying work android equalizer works if app has been started , fails when app uses equalizer the app crash whenever app tries access equalizer library is there way know if equalizer available other wise not start activity here code trying equalizer eq = null; if (eq != null) { eq.release(); } try { eq = new equalizer(0, 0); } catch (illegalstateexception e) { fail("equalizer not initialized"); } catch (illegalargumentexception e) { } catch (unsupportedoperationexception e) { } but still keep getting error java.lang.runtimeexception: java.lang.unsupportedoperationexception: effect library not loaded you should call release() on equalizer object when you're finished it. can't have many instance of equalizer object. == update == in catch block, 1 causing issue, display toast , finish current activity : catch (unsupporte...

javascript - Angular Material chain combine via md-select from arrays, form inputs array -

i have little problem chain combine in angular material. want "replace" solution link jsfiddle material using md-select , md-option. how must works? simple. scenario: first md-select: select e.g. manufacturer. second md-select: select e.g. model place price array text input value. array struct: manufacturer -models --model (model name , price) one more thing want array these form inputs this: master = [ { "product": { "name": "1936 harley davidson el knucklehead", "price": 24.23 } } ] could me? show or tell me how can it. i'll appreciate help. regards please have @ code snippet below angular material var app = angular.module('app', ['ngmaterial']); app.controller('selectcontroller', function ($scope) { // data taken knockoutjs cart example $scope.sampleproductcategories = [ { "name": ...

java - SplashScreen Activity onClick to open MainActivity and replace fragment in that Activity's fragment container -

hi struggling one, hence first post after day of searching solution no luck. i have splash screen has imageview onclicklistener when clicked opens mainactivity fine: splashactivity.java bookmain.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { intent intent = new intent(splashactivity.this, mainactivity.class); startactivity(intent); } however i'm trying achieve is, when button clicked, opens mainactivity, replace's fragment_container in mainactivity have fragment (this how bottombar navigation works). this code in mainactivity handles replacing of fragments when navigation buttons clicked , want splash screen's click open "bookfragment" rather go straight "roomsfragment": mainactivity.java public class mainactivity extends appcompatactivity { //standard on create open load initial layout @override protected void oncreate(bundle save...

java - Allow user to set part of multiline textbox bold -

i have multi line textview in app , want make bar user can click in bold/italic buttons , either selected area in multiline become bold/italic or text user types bold until user deselects bold/italic. is possible? if can gives sample code. new programming in android difficult. edit: changing font size , font if possible. edit: forgot using android 5.0, not makes of difference. yes ,you can set text style , font using method use if else statement in method , pass integer if(i==0){ textview.settypeface(null, typeface.bold); } else if(i==1){ textview.settypeface(null, typeface.italic);} you can thing it's not complete write mind. hope ,and in similar way can set text size also.

queue - How to create a Complete Binary Tree in Java -

what easy implementation of complete binary tree. values wouldn't influence order on set tree. listed below ideal. / \ b c / \ / \ d e f g how 1 code way queue? your bst should following. i'll skip method bodies ofc. can either have 2 different classes - root , nodes or not. i'll show pattern 1 class implementation. public class binarysearchtreenode<t extends comparable<t>>{ private t value; private binarysearchtreenode<t> left; private binarysearchtreenode<t> right; public binarysearchtreenode<t> insert(t t) { //your implementation here } public binarysearchtreenode<t> find(t t) { //your implementation here } public binarysearchtreenode<t> delete(t t) { //your implementation here } public void display(){ //your implementation here } //getters, setters } you need: some knowledge java generi...

python - Implementation of methods in Tensorflow -

i'm trying activate neural network using tensorflow tools. of way there 1 method trying implement (so can use on data) many problems. method is from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets(...) ... x, y = mnist.train.next_batch(batch_size) there nice explanation using tensorflow can't find how method implemented. every iteration need take different part data (and think method return data + y). attached code case: file = open('stub.csv') reader = csv.reader(file) temp = list(reader) del temp[0] ... temp in range(int(len(data) / batchsize)): ex, ey = takenextbatch(i) # takes 500 examples += 1 temp, cos = sess.run([optimizer, cost], feed_dict= {x:ex, y:ey}) # start session optimize cost function epochloss += cos when "takenextbatch(i)" method tried write.

java - Slide background color in Apache POI -

i'm having problem using apache poi while generating .pptx file. i'm setting background color each slide this: xmlslideshow ppt = new xmlslideshow(); for(int = 0; i<10; i++) { color currentcolor = colors.get(random.nextint(colors.size())) xslfslide currentslide = ppt.createslide(); currentslide.getbackground().setfillcolor(currentcolor); } but in every single slide background color 1 of last slide. if random colors each slide (blue, black, ...., yellow) slides have background color yellow. what i'm doing wrong? hope can me, thank you

hibernate - Inheriting in domain GORM classes -

domain classes: class carnet extends purchasable{ payment payment } class training extends purchasable{ static hasmany = [payments:payment] } class payment { static belongsto = [purchase:purchasable] } class purchasable { float price static constraints = { } static mapwith = "none" static mapping = { tableperhierarchy false } } unfortunatelly when try grails run-app i've got: error org.hibernate.tool.hbm2ddl.schemaupdate - hhh000388: unsuccessful: alter table payment add constraint fk_6ohgqce5txqxe8l8wkkkgjlc0 foreign key (purchase_id) references training (id) error org.hibernate.tool.hbm2ddl.schemaupdate - can't write; duplicate key in table '#sql-690_99' application starting carnet table in db not created later receive mysql exceptions. purchasable table created (and not need @ all). tried move purchasable interface src/groovy i'm not sure how properly. know how fix it?

Set variables in parallel in bash -

here's example program: #!/bin/bash x in {1..5} output[$x]=$(echo $x) & done wait x in {1..5} echo ${output[$x]} done i expect run , print out values assigned each member of output array, prints nothing. removing & correctly assigns variables. must use different syntax achieve in parallel? this output[$x]=$(echo $x) & puts whole assignment in background task (sub-process) , that's why you're not seeing result, since it's not propogated parent process. you can use wait wait subprocesses , returning results (other status codes) going difficult. perhaps can write intermediate results file, , collect results after processes have finished ? (not nice, appreciate)