Posts

Showing posts from January, 2015

html - How to wrap comma separated string onto new line in td cell? -

i've 1 column in table contains comma separated emails in each cell of column. so example cell may contain following , cell displays email inline. instead of breaking second email onto newline: jdoe@gmail.com,bgates@outlook.com question: how can wrap comma separated strings onto new line in td cell? what i've tried: i can't statically set <br/> between emails being read database dynamically. i did try adding span within td , applying custom css style wrap-emails . style doesn't display emails stacked expected in cell: css style: span.wrap-emails { word-wrap:break-word } cell definition: <td><span class="wrap-emails">@row.contact_emails</span></td> you should able replace commas br s using following in razor: @html.raw(row.contact_emails.replace(",","<br>")) the html.raw bit renders br instead of encoding it

The following Python program for prime factorization does not work -

i relatively new python. now, know there tons of better programs prime factorization out there tried writing code without , got stuck. here code: def is_prime(n): =2 while i<n: if n%i==0: return false i+=1 return true def prime_factor(n): b = n factor=[] = 2 while i<b , is_prime(i): while n%i ==0: factor.append(i) n/=i continue i+=1 return factor print (prime_factor(28)) the code works numbers (27, 24, 12, 18 etc) fails 28. output [2,2] value 28. fault lie? problem in while condition: while i<b : while is_prime(i) , n%i ==0: factor.append(i) n/=i continue i+=1

asp.net - IIS URL redirect directory -

i having issue using iis url redirect module. trying redirect www.site.com/directory1/default.aspx www.site.com/directory2/default.aspx so request directory1 needs go directory 2. going disabling application @ directory 1 ideas? have below, not work. <rewrite> <rules> <remove name="portal test redirect" /> <rule name="portal test redirect" patternsyntax="wildcard"> <match url="*directory1/*" ignorecase="false" /> <conditions /> <servervariables /> <action type="rewrite" url="{r:1}/directory2/{r:2}" appendquerystring="true" /> </rule> </rules> </rewrite> you need change rule below <rewrite> <rules> <rule name="portal

codeblocks - Cannot seem to get GLFW/OpenGL Depth Testing working -

i cannot depth testing working glfw using codeblocks in project, using default template provided codeblocks when start new project, below. any appreciated know must doing wrong haven't been able find it. #include <gl/glfw.h> int main() { int width, height; int frame = 0; bool running = true; glfwinit(); if( !glfwopenwindow( 512, 512, 0, 0, 0, 0, 0, 0, glfw_window ) ) { glfwterminate(); return 0; } glfwsetwindowtitle("glfw application"); glenable(gl_depth_test); while(running) { frame++; glfwgetwindowsize( &width, &height ); height = height > 0 ? height : 1; glviewport( 0, 0, width, height ); glclearcolor( 0.0f, 0.0f, 0.0f, 0.0f ); glclear( gl_color_buffer_bit | gl_depth_buffer_bit); glmatrixmode( gl_projection ); glloadidentity(); gluperspective( 65.0f, (glfloat)width/(glfloat)height, 1.0f, 100.0f ); // draw rotating garbage glmatrixmode( gl_modelview ); glloadidentity()

django - Error while confirm by the mail -

templateresponsemixin requires either definition of 'template_name' or implementation of 'get_template_names()' url: from allauth.account.views import confirm_email allauthemailconfirmation url(r'^rest-auth/', include('rest_auth.urls')), url(r'^rest-auth/registration/account-confirm-email/(?p<key>\w+)/$', allauthemailconfirmation, name="account_confirm_email"), url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), i read this , don't understand how modify code traceback: improperlyconfigured: templateresponsemixin requires either definition of 'template_name' or implementation of 'get_template_names()' internal server error: /rest-auth/registration/account-confirm-email/mtu:1bn1od:dq_mcyi6zpr8h2aks9j9bvnddja/ traceback (most recent call last): file "/home/k/klimaku9/justforfree.ru/public_html/venv/lib/python2.7/site-packages/django/core/handl

c# - Entity Framework Populating Child Objects using Foreign Key -

i hope isn't duplicate have been looking looking more @ reasoning behind this. i have set user object. public class user { public user() { } [key] [databasegenerated(databasegeneratedoption.identity)] public int userid { get; set; } public guid userguid { get; set; } public string email { get; set; } public string name { get; set; } public int companyid { get; set; } public int statusid { get; set; } [foreignkey("statusid")] public status status { get; set; } public int roleid { get; set; } [foreignkey("roleid")] public userrole userrole { get; set; } } and child objects public class userrole { [key] [databasegenerated(databasegeneratedoption.identity)] public int roleid { get; set; } public string role { get; set; } } public class status { [key] public int statusid { get; set; } public string description { get; set; } } when call var testuser = dbconte

html - outside javascript not work with onsen framewowrk -

i use onsen.ui framework when include script not working how accept include javascript in framework window.console = window.console || function(t) {}; span{ color:red; } <html><head> <meta charset="utf-8"> <title>codepen - navigator</title> <link rel='stylesheet prefetch' href='https://cdn.rawgit.com/onsenui/onsenui/1.3.11/build/css/onsenui.css'> <link rel='stylesheet prefetch' href='https://cdn.rawgit.com/onsenui/onsenui/1.3.11/build/css/onsen-css-components.css'> <script> window.console = window.console || function(t) {}; </script> </head> <body translate="no" > <ons-navigator title="navigator" var="mynavigator"> <ons-page> <ons-toolbar> <div class="center">simple navigation</div> <

audio - iOS. OpenGL. Several views simultaneously -

Image
a couple of days before asked filling space between 2 curve lines gradient . since i've changed lots of in code - i'm using shaders. result need. but! again have problem using several opengl views simultaneously in 1 controller must absolutely independent between each other. so, unbelievable tutorial raywenderlich.com , code example bradley have next situation: two custom objects of class soundwaveview.swift (improved openglview.swift bradley); vertex/fragment shaders openglview object; controller create , add 2 soundwaveview objects (with same context!!!!!): c override func viewdidload() { super.viewdidload() let context = eaglcontext(api: eaglrenderingapi.opengles2) let viewpos1: cgrect = cgrectmake(0, 150, uiscreen.mainscreen().bounds.size.width, 150); let view1 = soundwaveview(frame: viewpos1, filename: "personal jesus", fileextention: "mp3", c: context) view1.backgroundcolor = uicolor.graycolor() self.view.adds

Loop over XML stored in MySQL with Coldfusion -

client uploads images , system pulls meta info them , stores xml in database. looks this: <wddxpacket version='1.0'><header/><data><struct> <var name='exif'><struct><var name='orientation'><string> top, left side (horizontal / normal)</string></var>... i looping on images , need loop on string pull vars out (artist, title, description). i've tried can think of getting errors "cant cast string type array". if can suggest solution, i'm in debt! as others in comments have suggested, wddx way store structured data - bit json typically used. you'll want pass column/string wddx tag. <cfwddx action="wddx2cfml" input="#queryname.colmname#" output="imgdata"> <cfdump var="#imgdata#"> that should moving along right path. there have along lines of: #imgdata.exif.orientation# ...per example above var contain s

office365 - How to access a document library in a sharepoint online site using MS graph -

i able access documents on 1 drive requests one: https://graph.microsoft.com/v1.0/me/drive/root/children i able access document library of root sharepoint site of company request this: https://graph.microsoft.com/v1.0/drive/root/children it gives me contents of "root" library: https://<my company>.sharepoint.com/shared%20documents i not able access document library of sp subsite created. e.g. one: https://<my company>.sharepoint.com/samplesp/shared%20documents how can access such document library ms graph? for accessing sharepoint sites , lists check out beta reference documentation. update: for have problems accessing default drive (formerly "documents" library) on specific sharepoint site using ms graph api: you should documentation accessing files on onedrive (not beta reference). as said in question, endpoint gives list of files on private onedrive: .../v1.0/me/drive/root/children drive on sharepoint's s

apache pig - combine multiple columns in pig? -

i entirely new pig. want combine multiple columns 2 relation , b using iid field. seems simple, cannot figure out how correctly, i've tried join since there no column in common givs nothing. so here data: a fullname age cin b evaluation productivty and want output this: fullname age cin evaluation productivty .. .. .. .. .. thanks load 2 relations , create new relation columns.assuming both files have same number of rows , fields tab delimited.you can use right datatype based on data. a = load 'data1.txt' using pigstorage('\t') (fullname:chararray,age:int,cin:int); b = load 'data2.txt' using pigstorage('\t') (evaluation:chararray,productivity:chararray); c = foreach generate a.fullname,a.age,a.cin,b.evaluation,b.productivity; dump c;

java - Bottom Navigation Icon color change -

i using bottomnavigation this when try change bottom navigation icon colors black background not change color. bottomnavigation.setaccentcolor(color.parsecolor("#ffe4770a")); bottomnavigation.setinactivecolor(color.white); bottomnavigation.setbackgroundcolor(color.black); but when tried background changes icon color. bottomnavigation.setaccentcolor(color.parsecolor("#ffe4770a")); bottomnavigation.setinactivecolor(color.white); how fix it? changes icon color color background. according documentation of ahbottomnavigation repo, setbackgroundcolor() override accent colors icons. replace setbackgroundcolor() setdefaultbackgroundcolor() : bottomnavigation.setdefaultbackgroundcolor(color.black);

asp.net mvc - Google Middlewire Authentication in MVC Core -

i trying add google authentication in mvc application. followed steps , registered middlewire in configure method in startup.cs app.usegoogleauthentication(new googleoptions { clientid = configuration["google:clientid"], clientsecret = configuration["google:clientsecret"], scope = { "email", "openid" } }); i saving clientid , clientsecret in appsettings.json. in developers.google.com using g+ api signin purposes. using https://localhost:44386 authorized javascript origins and https://localhost:44386/signin-google authorized redirect uris the issue page shows allow , deny access page , upon clicking on allow ,the page stays in loading state , never redirects externalloginconfirmation.cshtml page. using default single user authorization mvc core template this. doing wrong. this output stream mvc core app. microsoft.aspnetcore.hosting.internal.webhost:information: re

rest - Attempt to invoke virtual method 'void com.newflame.pro.app.AppController.addToRequestQueue(com.android.volley.Request)' on a null object reference -

i trying use volley multipart requester, , i'm getting following error. java.lang.nullpointerexception: attempt invoke virtual method 'void com.newflame.pro.app.appcontroller.addtorequestqueue(com.android.volley.request)' on null object reference @ com.newflame.pro.networking.multipartrequester.multipart_volley_requester(multipartrequester.java:64) @ com.newflame.pro.networking.multipartrequester.<init>(multipartrequester.java:35) @ com.newflame.pro.flame.loginnew.senddatatoserver(loginnew.java:313) @ com.newflame.pro.flame.loginnew.access$100(loginnew.java:75) @ com.newflame.pro.flame.loginnew$2$1$1.callback(loginnew.java:197) @ com.androidquery.callback.bitmapajaxcallback.checkcb(bitmapajaxcallback.java:502) @ com.androidquery.callback.bitmapajaxcallback.callback(bitmapajaxcallback.java:472) @ com.androidquery.callback.bitmapajaxcallback.callback(bitmapajaxcallback.java:65) @ com.androidquery.callback.abstractajaxcallback.callback(abstractaja

php - Pass Json data in ajax request -

i want send whole json array on link have send whole json array on right move ? because in it's format give json_array format. below json array of rightmove, json array , { "network":{ "network_id": 5 }, "branch":{ "branch_id": 1566, "channel": 1, "overseas": false }, "property":{ "agent_ref": "02072013_0406", "published": true, "property_type": 2, "status": 1, "new_home": false, "student_property": false, "create_date": "02-07-2013 00:00:00", "update_date": "02-07-2013 00:00:00", "date_available": "02-07-2013 00:00:00", "contract_months": 12, "minimum_term": 12, "let_type": 1, "address&quo

javascript - Disable inputs if checkbox is checked -

i have ticket purchase form. have fill peronal information there. possible buy empty ticket, without name on it. requires clicking on checkbox, makes input fields disabled. var inputsdisabled = 0; $("#three").change(function(){ if(inputsdisabled == 0){ $("input[name=fname]").attr("disabled", true); $("input[name=lname]").attr("disabled", true); $("input[name=email]").attr("disabled", true); $("input[name=sponsor]").attr("disabled", true); $("input[name=phone]").attr("disabled", true); inputsdisabled = 1; } else{ $("input[name=fname]").attr("disabled", false); $("input[name=lname]").attr("disabled", false); $("input[name=email]").attr("disabled", false); $("input[n

java - How to efficiently share functions between classes without violating the Liskov Substitution Principle -

i have codebase created number of different options allow code perform same process in different way, this: public class mainfunction { public void main(string option){ if (option.equals("vanilla mode")){ this.firstfunction(); }else{ this.differentversionoffirstfunction(); } this.secondfunction(); } public void firstfunction(){ //first functions code } public void secondfunction(){ //second functions code } public void differentversionoffirstfunction(){ // different code first functions code produces same type of end result using different method } } this has gotten gradually more , more complex various different options added , code becomes increasingly convoluted. to resolve had planned create parent object, have children subtlety different variations on parents methods when needed. problem understand violate liskov substitution principle , indeed may have children should sharing same method may

c# - How to Add Dynamic Text Box inside child gridview in nested gridview? -

Image
how add dynamic text box inside child gridview ?below screen shot give clear picture of question.i unable add on second row shown in screen shot. screen shot thank in advance adding dynamic rows in gridview textboxes <asp:gridview id="gridview1" runat="server" showfooter="true" autogeneratecolumns="false"> <columns> <asp:boundfield datafield="rownumber" headertext="row number" /> <asp:templatefield headertext="header 1"> <itemtemplate> <asp:textbox id="textbox1" runat="server"></asp:textbox> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="header 2"> <itemtemplate> <asp:textbox id="textbox2" runat="server"><

delphi - Dim Screen Android Firemonkey -

does know how dim screen on delphi firemonkey android? i've been googling around , searching find how remove auto dim android acquiring wakelock ( delphi xe5 android. how use powermanager.wakelock? ). at best i'd achieve 2 states: evening = 20% brightness daytime = 100% brightness i using delphi 10.1 berlin. thank help. taking this stack overflow question , has java solution, guide rustled helper unit should work in delphi versions around xe8 10.1 berlin, seems trick: unit screenbrightnessu; interface function getscreenbrightness: byte; procedure setscreenbrightness(brightness: byte); implementation uses miscu, fmx.helpers.android, {$if rtlversion >= 31} fmx.dialogservice, {$else} fmx.dialogs, {$endif} system.uitypes, system.sysutils, androidapi.helpers, androidapi.jni.app, androidapi.jni.provider, androidapi.jni.graphicscontentviewtext; function getscreenbrightness: byte; var resolver: jcontentresolver; begin resolver := {$if

excel - vlookup with wildcard not working -

i'm working few large spreadsheets , can't seem vlookup work. here i'm trying - in spreadsheet i'm working on need excel @ column b item code (09-k1450v/xxxl example). @ different sheet in column similar item code , spit color. vlookup(b4539&"*",marketing!am3:am5428,71,false) now issue (but wildcard should taking care of this) on marketing sheet item codes "09-k1450" without size or else. scott craner had answer: =vlookup(left(b4539,find("v",b4539&"v")-1) & "*",marketing!c3:dx5429,69,false)

What will the bundle identifiers of the targets become when distributed via Mac App Store? -

i trying submit mac app app store. it includes multiple targets communicating via xpc. therefore need hardwire bundle identifiers in code. i found apple add prefix app's bundle identifier. my question whether should hardwire prefix bundle identifiers in code too, in order make them work on users' computers? thanks in advance. so, turned out misunderstanding. the prefix team identifier apple assigns every registered developer. won't have effect on bundle identifiers of apps. rather, 1 of places impacted group identifier if have deployed app group in project.

c# - WebClient - DownloadFileAsync not working when called second time -

Image
i've build simple method downloads single file. when call method first time works fine, when called second time file isn't downloaded. below code: public void downloadfile(string fileurl, string path) { using (var webclient = new webclient()) { webclient.downloadfilecompleted += (sender, e) => { if (e.error == null & !e.cancelled) { debug.writeline(@"download completed!"); } }; var url = new uri(fileurl); try { webclient.openread(url); string headercontentdisposition = webclient.responseheaders["content-disposition"]; string filename = new contentdisposition(headercontentdisposition).filename; debug.writeline(filename); path = path.combine(path, filename); webclient.downloadfileasync(url, path); } catch (exception ex) { messageb

javascript - Jquery math less than 0 show 0 -

how stop below returning value less 0. want less 0 show 0. appreciated. $("#spanrpower_co2").text (math.round(-data[0] * 16.8) * 100 / 100); data[0] > 0 ? 0 : -math.round(16.8 * data[0]); clearer. note unless you're approaching floating point infinity, * 100 / 100 no-op.

powershell - How do I pull the time until sleep of the active power plan? -

Image
i'm looking either powershell script or command allows me active power plan's time until sleep. in below example, know previous screen "balanced" active power plan. selecting that, gets screen can see info. i've tried places in both wmi , registry, set guids , have pull active powerplan first. have tried powercfg , various commands. do have query active powerplan powercfg, parse response, guid, , query using result in registry or wmi? looking guidance or code. use powershell command find out current , active power plan. gwmi -namespace root\cimv2\power -class win32_powerplan -filter isactive=’true’ | select elementname , description, instanceid and use instanceid query powercfg powercfg /query <instanceid>

php - 403 Forbidden in Local after modification of apache2.conf -

i modified file etc/apache2/apache2.conf wordpress permalink problems, can't access on localhost . i changed <directory /var/www/> options indexes followsymlinks allowoverride none require denied </directory> to options indexes followsymlinks allowoverride fileinfo require granted after a2enwrite , reload apache2 server doesn't work. i work on ubuntu 16.04 lts. can me?

R creates a list, instead of a data frame -

i want write data frame file using write function, doesnt work, because data.frame() creates list. reproductive example: data <- data.frame(cbind(1:2,3:4)) typeof(data) data # x1 x2 #1 1 3 #2 2 4 #> typeof(data) #[1] "list" now when want write file using write(data,"data.txt") i error saying error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'list') cannot handled 'cat' which happens because data list, dont understand why list. im running r 3.1.3 actually, data is data.frame : class(data) # [1] "data.frame" the problem write not cope data frames, work matrices: write(as.matrix(data), "test.txt") if want write data frame file use write.table : write.table(data, "test.txt") the error message comes underlying cat function , fact data.frame conceptually list of vectors of same length.

php - How to make a pdf document unique? -

Image
i developping web app generates questions of trial. security important in project. when draw of question trial done app creates pdf document of it. , write encrypted string @ footer of document : public function footer() { if ($this->logo != null) { $this->image($this->logo, 20, 278, 10, 10, 'png', '', 'c', false, 200, '', false, false, 0, false, false, false); } $this->sety(-20); $this->setfont('helvetica', 'i', 8); $this->cell(0, 20, 'page '.$this->getaliasnumpage().'/'.$this->getaliasnbpages(), 0, false, 'c', 0, '', 0, false, 't', 'm'); $this->cell(0, 20, date("d/m/y"), 0, 0, 'r', 0, '', 0, false, 't', 'm'); if ( $this->text_crypter != null ) { // encrypted string $this->sety(-7); $this->setfont('helvetica', '', 6);

javascript - IE ajax parsing / .includes() & .indexOf -

how can write , make work in ie? var tevents = eventsjson.response.events.filter(function (val, index, array) { return val.participating_region.includes(varregion); }); totalevents = tevents.length; i know issue .includes() , not sure how write using .indexof() full code: var varregion = $('body').data('region'); var eventsjson = null; var totalevents; var virtualevents; $.ajax({ 'url': '/services/getallevents', 'datatype': 'json', 'success': function (data) { eventsjson = data; parsejsonevents(); } }); function parsejsonevents() { var tevents = eventsjson.response.events.filter(function (val, index, array) { return val.participating_region.includes(varregion); }); totalevents = tevents.length; $('.in-person-events').text(totalevents); return eventsjson; }; return val.participating_region.indexof(varregion) > -1; tho

c++ - Arduino not taking multiple commands -

i'm trying basics done arduino, , i'm starting off small. that said, want arduino listen simple, multiple commands being sent raspberry pi (i'm emulating through serial monitor now, however) this code i'm working with: #include "softwareserial.h" void setup() { serial.begin(9600); delay(100); } void loop() { if (serial.find("test1")) { delay(100); serial.println("test1 command received"); } if (serial.find("test2")) { delay(100); serial.println("test2 command received"); } } } sadly, test1 command triggers serial print response, test2 no. can here point me in right direction? thank you! from reading documentation, don't think can use find() function that. consider happens if test2 input, when find("test1") call running. consume characters , including 2 , , return false , @ point characters lost. i think should design actual protoc

javascript - How to change Google Map location by clicking a button -

i'm trying make button changes location of map, i've seen many answers can't seem make scripts work on map or on website, i'm confuse, don't understand why won't work. this code: html: <div class="info-map"> <ul class="loks"> <li class="active"> <a id="link1" href="#office" data-toggle="tab"> office </a></li> <li> <a id="link2" href="#showroom" data-toggle="tab"> showroom </a></li> </ul></div> <div id="map"></div> css: #map { height: 400px; } .info-map { position: absolute; z-index: 1; background: white; top: 30px; left: 8%; } script: var map; function initmap() { var office = { info: '<strong>architectural art crete - office</strong><br>5815 dewey st, hollywood, fl 33023, usa', lat:

Android implementation service and launch in background also if the application is died -

i trying find how enable application perform background task. use example seen here " http://saigeethamn.blogspot.fr/2009/09/android-developer-tutorial-part-9.html " , not know if how have proceed execute script permanently? how reactivated when starting mobile? how should , if can service works if force stopping application? a big thank help no service can work if user force stops application. force stopping puts entire app state no services, receivers, or activities can run unless user explicitly so. if want start service when phone starts, need broadcast receiver boot_complete broadcast.

ios - OpenGL ES 3.0 Transform Feedback glDrawArrays with GL_LINE_STRIP output is all zeros -

recently confused opengl es 3.0 transform feedback using gldrawarrays gl_line_strip output zeros, meanwhile, adapting coordinates of points gl_lines called gldrawarrays , works. what want using transform feedback gpgpu off-screen calculation such image process through gldrawarrays called 1 time parameter gl_line_strip , gl_trangle_fan etc. speed performance , compare benchmarks of these draw modes. code used gl_lines works correctly lists below: typedef struct { glfloat x, y; } gpupoint; - (gpupoint *)generatepointsfromimagesize:(cgsize)imagesize { pointssize = sizeof(gpupoint) * imagesize.width * imagesize.height; pointscount = imagesize.width * imagesize.height; gpupoint *points = calloc(1, pointssize); gpupoint *currentpointer = points; (int line = 0; line < imagesize.height; ++line) { (int col = 0; col < imagesize.width; ++col) { currentpointer->x = col; currentpointer->y = line; ++cur

Ken Burns zoom in effect using CSS -

i looking @ website- http://melaniedaveid.com/ and has nice zoom in (ken burns effect) on of images. smoothness of animation. this css divs use- .project .project__header .header__image { background-position: center center; background-size: cover; height: 100%; left: 0; position: absolute; top: 0; transform: scale(1); transition: transform 15s linear 0s; width: 100%; } i tried doing similar not work me. missing? you need have transition happen on hover. this: https://jsfiddle.net/kzam3lo7/ img { background-position: center center; background-size: cover; height: 100%; left: 0; position: absolute; top: 0; transform: scale(1); width: 100%; } img:hover { transform: scale(2); transition: transform 15s linear 0s; }

mvvm - How the unity container will resolve the registered service -

in code trying log viewmodel name on entry/exit of viewmodel. my logger is public interface iloggerservice : iloggerfacade { void logmessage(string message ); void logentry(); void logexit(); } public class loggerservice : iloggerservice { public void logentry() { var trace = new stacktrace(); if (trace.framecount > 1) { string ns = trace.getframe(1).getmethod().declaringtype.namespace; string typename = trace.getframe(1).getmethod().declaringtype.name; string message = string.format("{0}.{1}.{2} entry", ns, typename, trace.getframe(1).getmethod().name); logdebug(message, defaultpriority); } } // same logexit } my bootstrapper public class bootstrapper : unitybootstrapper { protected override void configurecontainer() { base.configurecontainer(); container.registerinstance<

javascript - Angular router is not working but there is no errors aswell -

i new angularjs. have 2 router files auth_router.js , teacher_router.js . auth_router.js working fine teacher_router.js not working. code below: app.js file angular.module("learn_mart", ['ngroute', 'ngcookies']) .run(function($rootscope, $cookies) { $rootscope.baseurl = "http://localhost/lm/auth.html#"; $rootscope.userrole = $cookies.get('userrolecookie'); $rootscope.activetab = $cookies.get('activetabcookie'); $rootscope.redirectologin = function(role) { $cookies.put('activetabcookie', 1); $cookies.put('userrolecookie', role); window.location = $rootscope.baseurl + '/' + role + "_login"; }; }); auth_router.js file angular.module("learn_mart") .config(function($routeprovider) { $routeprovider .when("/sub_login", { controller: "subscribe

bash: get content between a pair of HTML tags -

i need html contents between pair of given tags using bash script. example, having html code below: <html> <head> </head> <body> text <div> text2 <div> text3 </div> </div> </body> </html> using bash command/script, given body tag, get: text <div> text2 <div> text3 </div> </div> thanks in advance. plain text processing not html/xml parsing. hope give idea: kent$ xmllint --xpath "//body" f.html <body> text <div> text2 <div> text3 </div> </div> </body>

python - TypeError: argument of type 'float' is not iterable-Tensorflow wide_n_deep_tutorial -

i facing issue while running wide_n_deep_tutorial program of tensorflow https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/learn/wide_n_deep_tutorial.py on personal data set variation parameters. loading data s3. my target variable "impression_flag" takes value of either "true" or "false". below code snippet of train_and_eval method: def train_and_eval(): """train , evaluate model.""" train_file_name, test_file_name = maybe_download() df_train = pd.read_csv( tf.gfile.open(train_file_name), names=columns, skipinitialspace=true) df_test = pd.read_csv( tf.gfile.open(test_file_name), names=columns, skipinitialspace=true, skiprows=1) df_train[label_column] = ( df_train["impression_flag"].apply(lambda x: "true" in x)).astype(int) df_test[label_column] = ( df_test["impression_flag"].apply(lambda x: "

visual studio - How can I restore what I have done in PowerShell? -

i did in powershell: checked out current restrictions typing get-executionpolicy enable powershell typing set-executionpolicy remotesigned when run get-executionpolicy -list in powershell this: scope executionpolicy ----- --------------- machinepolicy undefined userpolicy undefined process undefined currentuser undefined localmachine remotesigned when run project in visual studio @scripts.render("~/bundles/modernizr") throws exception: filenotfoundexception unhandled user code. how solve problem or can restore changes have made in powershell?