Posts

Showing posts from January, 2010

c++ - Declaring an array inside typedef struct -

i'm trying declare array inside typedef struct this: typedef struct node { node[] arr = new node[25]; }; but getting error saying "expected identifier" , arr "expected ';'. doing wrong? thank you you can act this struct node { static const int arr_size = 25; node* arr; node() { arr = new node[arr_size]; } ~node() { delete[] arr; } }; you re not allowed initialzie non const int varizbles inside class; and understand, creating node variable call stack overflow ? each node contains 25 nodes each node contains 25 nodes ... etc i think wanted this struct node { static const int arr_size = 25; node* arr[arr_size]; };

android - The Popup window cannot function on Marker -

good morning at here try add popup window function on marker click when launching app, popup not function. , try solve still cannot solve problem. this java code package com.everstudio.nadejenew; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.framelayout; import android.widget.popupwindow; import android.widget.relativelayout; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.marker; import com.google.android.gms.maps.model.markeroptions; import static android.content.context.layout_inflater_service; public class locationfragment extends fragment implements onmapr

php - My request with GuzzleHttp stagnates -

hi trying consume api guzzlehttp stagnates.(loading infinite in browser) technologies: laravel 5.2 guzzlehttp 6.0 usercontroller.php <?php namespace app\http\controllers; use app\user; use illuminate\http\request; use app\http\requests; use illuminate\support\facades\input; use guzzlehttp\client guzzlehttpclient; use guzzlehttp\exception\requestexception; public function index() { try { $client = new guzzlehttpclient(); $apirequest = $client->request('get', 'localhost:8000/api'); $content = json_decode($apirequest->getbody()->getcontents()); dd($content); } catch (requestexception $re) { dd($re); } } } note: when test postman, ok. image postman ok what think i sure problem is: $apirequest = $client->request('get', 'localhost:8000/api'); but don't know why. maybe data important web running in localhost(be

validation - NetSuite / Suitescript - Why does this Validate Field script enter an infinite loop? -

my script entering infinite loop , have no idea why. running on validate field , preventing change field if vendor bill exists same reference number, forcing user change "reference number" unique. here code: function validatefield(type, name) { if (uniquereferencenum(type, name) === false) { return false; } return true; } function uniquereferencenum(type, name) { if (name !== 'tranid') { return true; } var tranid = nlapigetfieldvalue('tranid'); var vendor = nlapigetfieldvalue('entity'); var vendorname = nlapigetfieldtext('entity'); var filters = new array(); var columns = new array(); filters[0] = new nlobjsearchfilter('entity', null, 'is', vendor); filters[1] = new nlobjsearchfilter('tranid', null, 'is', tranid); filters[2] = new nlobjsearchfilter('mainline', null, 'is', 't'); columns[0] = new nlobjsearchcolumn('internalid'); results = nlapise

hibernate - WARN: No mapping found for HTTP request with URI [/SpringMVCHibernate/] in DispatcherServlet with name 'appServlet' -

this question has answer here: why spring mvc respond 404 , report “no mapping found http request uri […] in dispatcherservlet”? 3 answers hello guys i'm getting below error after starting server. can please me out how handle error ? i'm using eclipse luna , spring 4.0.3. there particular spring version eclipse luna need use? warn : org.springframework.web.servlet.pagenotfound - no mapping found http request uri [/springmvchibernate/] in dispatcherservlet name 'appservlet' pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <gro

python - Can someone point out the errors in this code? -

i'm beginner python programmer trying execute code don't quite know def function yet... can point out errors in code , how fix them? import math def main(): radius = get_radius() calculate = cal_volume() dis = display() def get_radius(): rad = float(input("enter radius :")) return rad def cal_volume(radius): return 4/3*math.pi*radius**3 def display(cal_volume): print("the volume :",cal_volume) main() you didn't provide parameters cal_volume() , display() in def main() . it should be: import math def main(): radius = get_radius() calculate = cal_volume(radius) dis = display(calculate) # print out result? def get_radius(): rad = float(input("enter radius :")) return rad def cal_volume(radius): return 4/3*math.pi*radius**3 def display(cal_volume): print("the volume :",cal_volume) main()

qml - Add property from string to dynamically created ListElement through ListModel.append() -

what correct approach insert dynamic properties dynamically created listelements in listmodel using js? it's seems can't enter variable reference between { } supplying properties, works values. model lismodel , function should create listelements both these properties. function getreadings(model) { var timestr = "hour_0"; var temp = 11.9; model.append({day: 1, timestr: 11.9}); //error model.append({day: 1, hour_0: 11.9}); //ok! } i'll appreciate advice. keep in mind you're working javascript. { } json object, parameter append( ) method. this worked me: mousearea { anchors {top: parent.top; right: parent.right} width: 100 height: 100 onclicked: { var mykey = "day" var myvalue = "saturday" var json = { }; json[mykey] = myvalue; listmodel.append(json) } }

php - nested if-else statement with same else code -

i have following code , want know if there better way use if-else same result other using same else 3 times? if($condition1) { // code condition 2 if($condition2) { // code condition 3 if($condition3) { $dt = $something; } else { $dt = ""; } } else { $dt = ""; } } else { $dt = ""; } you rid of of else statements. $dt = ""; // assign $dt in beginning if ($condition1) { // code condition 2 if ($condition2 && $condition3) { // code condition 3 $dt = $something; } }

c# - Display Error Message when dataGridView Row match textbox -

i'm trying display error message, if rows in datagridview match new value entered in . problem after add new datagridview with: product c = new product(); tableproducts.products.add(c); productbindingsource.add(c); productbindingsource.movelast(); a new row created, , when want save it, compares row code of textbox , causes error message displayed. should compared stored in table, not 1 add new: here code: private void btnsave_click(object sender, eventargs e) { if (datagridview.currentrow.cells[0].value.tostring() == txtcode.text && txtcode.enabled == true) { messagebox.show("code exist! try one!", "message", messageboxbuttons.ok, messageboxicon.error); panel.enabled = false; defaultviewbuttons(); } else { productobindingsource.endedit(); tablaproductos.savechangesasync();

powershell - Add a CSV content to another CSV -

i have 2 csv files, both have same header: id,relation,first name,last name,email address,office,phone,photos i'm trying make powershell scrip copy 2nd csv file @ end of first, without header. is there way eliminate duplicate records based on column, after added 2 together? you can use group-object cmdlet group records on specific (or multiple) column. iterate on list using foreach-object , select first entry in each group give distinct list. can export csv using export-csv cmdlet: import-csv "your-csv.path" | group -property 'id' | foreach-object { $_.group | select -first 1} | export-csv -path 'your_csv.path'

while running console from SBT getting error "Couldn't retrieve source module: org.scala-sbt:compiler-interface:0.13.13:component" -

on window command install scala , sbt . while running console command sbt getting below error . can 1 me resolve issue ? getting below error >sbt java hotspot(tm) client vm warning: ignoring option maxpermsize=256m; support removed in 8.0 [info] set current project sujitd (in build file:/c:/users/sujitd/) > console [info] compiling 1 scala source c:\users\sujitd\target\scala-2.10\classes... [info] resolving org.scala-sbt#interface;0.13.13 ... [warn] host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/0.13.13/compiler-interface-0.13.13-sources.jar [info] access destination server through proxy server not configured. [warn] host repo.typesafe.com not found. url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.13/srcs/compiler-interface-sources.jar [info] access destination server through proxy server not configured. [warn] host repo.scala-sbt.org not found

android - Category for Receipt OCR -

i trying create receipt ocr app using tesseract. after recognition process, want determine category receipt belongs to, e.g food & drinks, transportation, phone bills etc. current approach is: create dictionary of categories alongside common stores. after recognition, use approximate string matching try , find store name inside dictionary , if exists, allocate receipt category. if not found, allocate receipt default category , wait user select 1 list. save pair in dictionary future. the problem apart limitations of store category pairs, extremely slow if try use approximate string recognition each line dictionary. there way can improve process?

webpack - To configure karma with angular universal -

i trying set universal angular karma, have problems in it, have seen several implementations of angular2 , karma, have had problems integrating universal angular. the universal repository follow following https://github.com/angular/universal-starter and of karma + angular 2 this https://github.com/rangle/angular2-redux-example https://angular-2-training-book.rangle.io/handout/testing/intro-to-tdd/setup/karma-config.html output error > universal-starter@2.0.0 test g:\universal2 > karma start hash: e8f2349ece4cdebf209b version: webpack 2.1.0-beta.27 time: 8565ms asset size chunks chunk names main 5.69 mb 0, 1 main src/tests.entry.ts 14.5 mb 1, 0 src/tests.entry.ts chunk {0} main (main) 5.04 mb [entry] [rendered] [0] ./~/@angular/core/index.js 355 bytes {0} {1} [built] [1] ./~/core-js/modules/_export.js 1.6 kb {0} {1} [built] [2] ./~/buffer/index.js 48.6 kb {0} {1} [built] [3] ./~/@angular/

How to template inline attributes in svelte? -

in repl example, how set style attribute inline, without needing duplicate anchor tag? https://svelte.technology/repl?version=1.13.6&gist=0a2bd4376b2fe742fb0d233755c44796 to add zac's answer, add helper function returned style so: export default { helpers: { getstyle ( page ) { if ( page === 'about' ) return 'color: blue'; return ''; } } };

Javascript: Why are my numbers not being raised to the nth power and being pushed to my array? -

i trying write function takes in number , sums range of digits nth power, seems function not "n-thing" each number in array. here's code: function sumdigpow(a, b) { var premarray = []; var squaredarray = []; for(var = a; <= b; i++){ premarray.push(i); } for(var j = 0; j < premarray.length; j++){ var squared = ('' + premarray[j]).split('').map(function(v, i){ return math.pow(parseint(v), + 1); }).reduce(function(a , v){ return + v; }, 0); squaredarray.push(squared); } } sumdigpow(5,22); you pretty on complicated entire thing. function digpow(n, p){ var total = 0; var digits = (""+n).split(""); (var = 0; i< digits.length; i++) { total += math.pow(digits[i], p+i); } if(total/n % 1 === 0){ return total/n; } return -1; } here split first number array. mind string times number can produce number if string of number example:

angularjs - calling two different functions using ng-click -

i trying call 2 different functions using ng-click="reset();search()" isn't working. correct way of using ng-click multiple functions? your html should (vm 'controller'): <a ng-click="vm.multiplemethodcalls()">link text</a> your controller should have method (es5 code style) calls 2 other (or more if want) methods: function multiplemethodcalls() { this.reset(); this.search(); } what not want litter templates more , more code , logic. remember saying 'kiss', keep simple stupid, simpler better. moving logic controller easy understand , allows little more control.

woocommerce auto restore stock quanitiy hook when order refund -

i need woocommerce auto restore stock quanitiy hook when order refund please 1 regarding tried 2 hooks add_action( 'woocommerce_product_set_stock','action_woocommerce_variation_set_stock', 10, 1 ); add_action( 'woocommerce_variation_set_stock', 'action_woocommerce_variation_set_stock', 10, 1 ); but these hook work on frontend when product stock quantity decrease on order please solve issue

php - Where does Magento 1.1.2 store the orders in DB? -

i had cousins magento-db , wonder, magento store user-ordersi searched tables can't find order(?) orders saved in tables: (prefix)_sales_flat_order , (prefix)_sales_flat_order_item

wordpress - Search + Meta Query does not work with AND condition -

search meta query not work "and" condition using custom query. please check code: select distinct sql_calc_found_rows wp_users.* wp_users inner join wp_usermeta on ( wp_users.id = wp_usermeta.user_id ) 1=1 , ( ( wp_usermeta.meta_key = 'user_mobile1' , cast(wp_usermeta.meta_value char) '%98%' ) or ( wp_usermeta.meta_key = 'user_mobile2' , cast(wp_usermeta.meta_value char) '%98%' ) , ( wp_usermeta.meta_key = '_entry_status' , cast(wp_usermeta.meta_value char) '%female%' ) ) order display_name desc issue: when search user mobile number works. , search meta_value "female" working fine. but need both filtering if search mobile number , female records. query not work , disp

Oracle Forms 11g ORA-12154 at runtime -

i have installed oracle forms 11g. forms builder, connects database, when run servlet default.env config, shows "oracle forms installed successfully" page. when define simple form , try run (with no config parameter) in browser, shows me ora-12154: tns:could not resolve connect identifier specified. happens in runtime. suggestions? thanks.

r - Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘overlay’ -

i trying use overlay function , code following: usa <- map('state',boundary = false, lty=2,plot=false,fill=true) usa_sp <- map2spatialpolygons(usa, ids=usa$names, proj4string = crs("+proj=longlat")) comb.dat <- read.csv("agbregion.csv",header=true) names(comb.dat) <- c("lon","lat","harvdb") names(agbyr)<- c("lon","lat","harvdb") names(agbdiff) <- c("lon","lat","harvdb") pts <- spatialpoints(cbind(comb.dat$lon,comb.dat$lat)) ptsyr <- spatialpoints(cbind(agbyr$lon,agbyr$lat)) ptsdiff <- spatialpoints(cbind(agbdiff$lon,agbdiff$lat)) o <- overlay(pts, usa_sp) but got following error: error in (function (classes, fdef, mtable) : unable find inherited method function ‘overlay’ signature ‘"spatialpoints", "spatialpolygons"’ i don't know what's going on. explain me? lot. see of ?raster::overlay . n

ssms - How to use a alias name instead of the server name in sql management console -

i want login in mssms different name instead of local server name. can test applications acceptance without changing app.config , web.config . now can log in localhost\sqlexpress want login f.i.:algsql08-acc\sqlexpress . i've changed local host file: 127.0.0.1 algsql08-acc i've made alias in sql configuration manager (alias name: algsql08-acc , server: localhost ) but i'm still getting same error: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) (microsoft sql server, error: -1) i installed dns server , can nslookup of server. how can this?

github - Hibernate test case failures -

while building hibernate version 5.2.8, facing issues related mockito exception. similar failures observed on x86. idea can create issues hibernate(maybe on github or defect tracking system). details of error log java.lang.illegalstateexception @ reflecthelpertest.java:51 caused by: java.lang.illegalstateexception caused by: org.mockito.exceptions.base.mockitoinitializationexception caused by: java.lang.illegalstateexception hibernate has jira server, seek ? https://hibernate.atlassian.net/secure/dashboard.jspa

Setting up Stackdriver Error Reporting to show detailed information -

i have basic setup working sent logs gke , format them according rules stackdriver error reporting. i can see stacktraces additional information user, version, ... missing. see: error reporting detail view when click on show logs can see formated log entry , seems me in right format... log entry in stackdriver logging example looks this: { insertid: "vd0zy9g5mw3iof" jsonpayload: { message: { context: { reportlocation: { functionname: "error_router" filepath: "/usr/local/lib/python2.7/site-packages/flask_restplus/api.py" linenumber: 554 } httprequest: { method: "post" remoteip: "213.47.170.171" referrer: "https://api-staging.smaxtec.com/api/v1/" useragent: "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/57.0.2987.133 safari/537.36"

java - Handle nested hibernate objects in a Foreign key relationship in REST -

i have 2 tables employee , address , below hibernate class, public class employee { private long id; private address address; } public class address { private long id; private employee employee; private string street; } as see have forign key mapping in address class employee class. if query employee object , expose employee class @xmlrootelement public class employee { as rest service json response, face issue of nested object in json response. i tried @jsonignore doesn't help. is there way can differently? use jax-rs. cheers!!

Android: Customizing recent apps thumbnail (screenshot by default) -

the app i'm working on shows sensitive information must not shown on "recent tasks" screen when stopping app pressing home button. i'd blur sensitive data in screenshot or show app logo instead. i aware of following approaches don't fit requirements: setting actvitie's android:excludefromrecents true in manifiest prevents app being shown @ in recent tasks. disrupt user experience. using flag_secure results in blank card on recents tasks screen. ( how prevent android taking screenshot when app goes background? ) don't blank screen. however, i'll stick solution if there no workaround. overriding oncreatethumbnail seems ideal solution but, unfortunately, doesn't work it's not invoked os :( ( https://code.google.com/p/android/issues/detail?id=29370 ) and there workarounds tried out didn't work hoped: start new activity shows app logo in onpause it's screenshot shown instead of actual activitie's one. new activity

ios - AVCaptureDevice.setExposureTargetBias() doesn't affect exposure as expected -

the documentation isn't clear on this, kind of implies value send function measured in stops. results not expected, in bright scenes. exposure not increase same number of stops value send setexposuretargetbias(). larger number bigger discrepancy. calculating exposure using following let shutter = float(avcapturedevice.exposureduration.value)/float(avcapturedevice.exposureduration.timescale) let aperture = avcapturedevice.lensaperture let iso = avcapturedevice.iso let exposure = log2f(aperture*aperture/(shutter*iso/100)) in theory if exposure increases 1 stop value of variable exposure increase 1. not seeing when increase exposure bias 1 though

google api - java.lang.IllegalStateException: GoogleApiClient is not connected yet -

error message fatal exception: main java.lang.illegalstateexception: googleapiclient not connected yet. @ com.google.android.gms.internal.zzlg.zzb(unknown source) @ com.google.android.gms.internal.zzli.zzb(unknown source) @ com.google.android.gms.location.internal.zzd.requestlocationupdates(unknown source) @ com.example.argede06.argede.konumservis_konumcek.konum_googleapi.startlocationupdate(konum_googleapi.java:82) @ com.example.argede06.argede.konumservis_konumcek.konum_googleapi$1.run(konum_googleapi.java:62) @ android.os.handler.handlecallback(handler.java:725) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:153) @ android.app.activitythread.main(activitythread.java:5336) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.

How Java provides implementation of Array internally? -

i have gone through java tutorials confusion arrays still there in mind. how array works internally ? data member length comes?(when have length of dynamic array , use array.length ) there no "member function" length() . there's (final) property length tells size of array. arrays objects, they're native implemented. they're pointers bounds checking. you don't need worry internal implementation of arrays, work fine.

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -

i have think simple question, might more complex.. i have spent few days looking answer on google , various questions on site cannot seem come right. what trying bind gridview on user control ascx page default.aspx.cs on page load event. user control markup follows: <%@ control language="c#" autoeventwireup="true" codebehind="vulnerabilityexternalip.ascx.cs" inherits="vulnerabilityassesment.controls.vulnerabilityexternalip" %> <asp:table runat="server" cellpadding="1" cellspacing="2"> <asp:tablerow> <asp:tablecell> <asp:label id="lblvulnerabilityname" runat="server" text="vulnerability name:" cssclass="itemname"></asp:label> </asp:tablecell> <asp:tablecell> <asp:label id="lblvulnerabilitynametext" runat="server" text='<%# eval("mainvulnerabilityname")

List of events possible in OpenAI Gym/Universe -

Image
i using openai universe, want agent click in keys "a" "enter" etc. , click mouse in (x,y) position. any documentation awesome. update found link list of keyevents defined : https://github.com/openai/universe/blob/a7944e65446a5484e5011f048558f312e907da61/universe/vncdriver/constants.py#l85-l170 for letters pass : ('keyevent', "a", true) for mouse (found in comment somewhere in universe code): ("pointerevent", x, y, buttonmask)

authentication - An account failed to log on by C:\Windows\System32\inetsrv\appcmd.exe -

my domain account got locked many times each day. account team told me locked on server managed. after check security event log(windows server). got below detail information. still don't know program , when called. cannot remove appcmd.exe directly used iis , website host on it. i've searched , got many similar topics through internet. there no solution me. can me on question? thank in advance! log detail: an account failed log on. subject: security id: system account name: server1$ account domain: domain1 logon id: 0x3e7 logon type: 8 account logon failed: security id: null sid account name: ntaccount1 account domain: domain1 failure information: failure reason: unknown user name or bad password. status: 0xc000006d sub status: 0xc000006a process information: caller process id: 0x1ff0 caller process name: c:\windows\system32\inets

java - Find relationship between gps data -

10 million user gps data, structure like: userid startgps endgps one user has 2 gps, start point , end point. if distance of 2 points different user larger 1km. we'll defined there users potentially close relation. usera startgpsa endgpsa userb startgpsb endgpsb function relation(usergpsa a, usergpsb b) if(distance(a.startgps , b.startgps) > 1km || distance(a.startgps , b.endgps) > 1km || distance(a.endgps , b.endgps) > 1km) return a,b return null how find these relation fast? one possible algorithm use spacial 'buckets' reduce computation time. not special threading tricks, reduce lot amount of user compare (depending of size of bucket). the idea put in same 'buckets' every user not far each other, , create index on 'buckets' allow adjacent 'buckets' @ low cost. let assume have class user{ long userid; gps start; gps stop; } class gps{ long x; long y; } first create class ind

go - Passing arguments from GOLANG to CROSSTAB WHERE CLAUSE of Postgresql -

hi iam facing difficulty in passing arguments postgresql's crosstab function golang. below code: row, err := db.query("select * crosstab( 'select student, subject, evaluation_result evaluations evaluation_result > $1 order 1,2') final_result(student text, geography numeric,history numeric,language numeric,maths numeric,music numeric)", pass_mark) if err != nil { fmt.println("error", err) return } defer sql.close(row) _, data1, err := sql.scan(row) if err != nil { fmt.println("error", err) return } if len(data1) <= 0 { } else if len(data1) <= 0 { fmt.println("error", "no data found") return } fmt.println("data", data1) iam getting following error: pq: bind message supplies 1 parameters, prepared statement "" requires 0 it giving error because $1 not identified variable argument since present inside '' (the single quotes of crosstab function) how can

css - drop-down list is hidden -

html code using bootstrap: <div class="col-md-2"> <div class="form-group"> <label id="lbl_dataset">select number</label> <select class="selectpicker"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option selected="selected">5</option> <option>6</option> </select> </div> </div> the issue here drop-down hidden, , becomes visible after refreshing page more once. while debugging, found drop-down disappeared because of css code select.bs-select-hidden, select.selectpicker { display: none !important; } tried many times override bootstrap css didn't work. any idea on how override bootstrap css ? if not using bootstrap through cdn: in chrome dev

php - Multiple Domains in Yii2 -

i have project yii2. i have more domain project. i need login user other domain. the main domain: domain.com login in domain worked other domain saved in db: domain1.com , domain2.com , domain3.com ,... problem list domain list saved in database , park in directadmin params file: return [ //todo: change line when upload application on domain 'domain' => 'domain.com', ]; web file: $params = require(__dir__ . '/params.php'); $config = [ 'id' => 'projectname', 'name'=>'projectname', 'basepath' => dirname(__dir__), 'bootstrap' => ['log', 'app\components\aliases'], 'language' => 'en_us', 'components' => [ 'request' => [ 'baseurl'=> '', // !!! insert secret key in following (if empty) - required cookie validation 'cookievalidatio

excel - Group columns into new columns -

i have table: id|cola1|cola2|colb1|colb2 01|aaaaa|bbbbb|ccccc|ddddd 02|eeeee|fffff|ggggg|hhhhh or column order like: id|cola1|colb1|colb2|cola2 01|aaaaa|ccccc|ddddd|bbbbb 02|eeeee|ggggg|hhhhh|fffff i want rearrange this: id| |cola |colb 01|cola1|aaaaa|ccccc 01|cola2|bbbbb|ddddd 02|cola1|eeeee|ggggg 02|cola2|fffff|hhhhh yes know id not unique. can see, cola's grouped new column, , colb's grouped column. is possible powerpivot?

angular - __webpack_require__(...) is not a function after adding a CSS to Webpack -

i have working angular 2 website, using webpack pack resources. pack pretty much(for now) generated dotnet new angular command. i added ressources packed, , worked fine. but added css file of icon library in entry-vendor list of webpack.config.vendor.js : entry: { vendor: [ //[...all others...] 'icon-sets/icons/solid-icons/premium-solid-icons.min.css', ] }, i ran webpack: webpack --config webpack.config.vendor.js (no errors), build , start website, directly error: exception: call node module failed error: prerendering failed because of error: typeerror: __webpack_require__(...) not function @ object.<anonymous> (e:\my\project\clientapp\dist\main-server.js:380:50) @ __webpack_require__ (e:\my\project\clientapp\dist\main-server.js:20:30) @ object.<anonymous> (e:\my\project\clientapp\dist\main-server.js:1636:22) @ __webpack_require__ (e:\my\project\clientapp\dist\main-server.js:20:30) @ object.c (e:\my\project\clientapp\dist\m

ios - Swift: calling failable initializer from throwing initializer? -

i have need extend struct having failable initializer throwing initializer calling failable initializer. , see no elegant or clear way in swift 3.1. something this: extension product: jsondecodable { public enum error: swift.error { case unabletoparsejson } init(decodefromjson json: json) throws { guard let jsonobject = json as? jsonobject else { throw error.unabletoparsejson } // meta-code self.init(dictionary: jsonobject) ?? throw error.unabletoparsejson } } is there elegant , clean way that? found semi-clean way while writing question: extension product: jsondecodable { public enum error: swift.error { case unabletoparsejson } init(decodefromjson json: json) throws { guard let jsonobject = json as? jsonobject, let initialized = type(of: self).init(dictionary: jsonobject) else { throw error.unabletoparsejson } self

html - Randomised content from PHP script not refreshing on reload -

this question has answer here: disable cache images 12 answers i trying implement site displays random image every time page refreshed. currently, images in directory "/pngs/", , have mysql database indexed rows: <img src="pngs/000.png"> <img src="pngs/001.png"> <img src="pngs/002.png"> <img src="pngs/003.png"> ... then, in html: <div class='img'><?php include('pngs.php');?></div> referring php script, selects random row database: <?php require_once 'login.php'; $conn = new mysqli($hn, $un, $pw, $db); if ($conn->connect_error) die($conn->connect_error); $query = "select * pngs"; $result = $conn->query($query); if (!$result) die($conn->error); $rows = $result->num_rows; $r = rand(1,$rows); $resul