Posts

Showing posts from February, 2013

swift - Random Number Generator (Command Line) -

Image
when user enters number have guess random number. these errors getting line of code in code twice. "value of type "string has no number "stringbyreplacingoccruencesofstring" input = input.stringbyreplacingoccurrencesofstring("\n", withsring:"", here full code import foundation var randomnumber = 1 var userguess:int? = 1 var continueguessing = true var keepplaying = true var input = "" while (keepplaying) { randomnumber = int(arc4random_uniform(101)) // gets random number between 0- 1000 print("the random number guess is:\(randomnumber)"); while (continueguessing) { print ("print number between 0 , 100") input = nsstring(data: filehandle.standardinput.availabledata, encoding:string.encoding.utf8.rawvalue) as! string // gets keyboard input input = input.stringbyreplacingoccurrencesofstring("\n", withsring:"", options: nsstring.compareoptions.literalsearch, range

java - Implementing a Callback for DialogFragment -

from recylerview adapter , there multiple buttons in every items, want show dialogfragment confirmation when clicked , execute different methods/actions when positivebutton clicked. the problem don't know how can have or how can implement callback when positivebutton clicked , can execute different methods or actions according button clicked on every items. e.g. on adapter class @override public void onbindviewholder(final pageonlineadapter.theviewholder holder, final int position) { holder.btn_start.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { dialogfragment newfragment = confirmationdialog.newinstance(title,content); //initialize dialogfragment specific title , content newfragment.show(((appcompatactivity)contextview).getsupportfragmentmanager(), tag); /* if positivebutton clicked =>execute method/action here */

Directory Structure for i18next translation files for embedded library? -

i produce widget library our company, multiple apps use. widgets need localized, , idea of having 1 locales/ directory @ top level of library, , 1 @ top level of app itself. can i18next load 2 bundles? can package i18next files system.js build pipeline? thanks

ruby return inner loop value to outer loop -

how return value inner loop .map of outer loop, example: class letternumber def initialize(letter, number) @letter = letter @number = number end end do_stuff letter_numbers = // array of letternumber objects numbers = [1, 2, 3] letter_numbers.map |letter_number| numbers.each |number| letter_number.number = letter_number.number + number end end end i want do_stuff method return array of updated letternumber objects. want inner loop return letter_number object on each of iterations outer loop. possible sort of iterator instead of breaking loops out separate methods or something? you can use inject method calculate sum directly: class letternumber def initialize(letter, number) @letter = letter @number = number end end def do_stuff letter_numbers = // array of letternumber objects numbers = [1, 2, 3] letter_numbers.map |letter_number| letter.number += numbers.inject(:+) letter_number end end or use e

html - Javascript Freecodecamp "Do not use a Boolean as a Constructor" -

i have small problem when started "falsy bouncer" challenge on free code camp. when try create new boolean object below: var bool = new boolean(); a yellow triangle appears , says "do not use boolean constructor". i go around , not use object, or use different methods says in boolean object documentation , challenge not difficult don't know why cannot create new object inside freecodecamp code window? outside or inside function , or whithout parameters. does 1 know why happens? from mdn ~ do not use boolean object convert non-boolean value boolean value. instead, use boolean function perform task: var x = boolean(expression); // preferred var x = new boolean(expression); // don't use

vba - Quit error Internet Explorer Window -

Image
issue : encountering issues closing "premature" internet window has no content yet. basically if "premature" window open, macro doesn't manage select window i'm interested in, close "premature" window manually, can run code properly. source comes minor error somehow opens except diplaying window doesn't affect rest of code. tests done : dim widow object, page_foireuse shdocvw.internetexplorer dim objshell object set objshell = createobject("shell.application") msgbox objshell.windows.count ' msgbox objshell.windows(0).document.title ' msgbox objshell.windows(1).document.title ' msgbox objshell.windows(2).document.title ' msgbox objshell.windows(3).document.title ' msgbox objshell.windows(4).document.title ' msgbox objshell.windows(5).document.title ' msgbox objshell.windows(6).document.title 'for each widow in objshell.windows ' if widow.document.title n

Android - Firebase; on signing in, retrieve data (layered) and redirect that user based on that data -

so have simple firebase android application, i'm aiming cater number of different users. user registers, , on creation, uid stored in user table, along userinformation entry under uid values 'usertype' , 'iscurrentlytracking'. user signs in, brought profile activity can press button continue on through app. here table structure: on pressing continue, userinformation data retrieved. based on data, redirected activity. instead of doing aforementioned, application stops/crashes. here code/method redirects user: public void userredirect(){ firebaseauth = firebaseauth.getinstance(); user = firebaseauth.getcurrentuser(); final firebasedatabase database = firebasedatabase.getinstance(); query q = database.getreference("users/" + user.getuid() + "/userinformation"); q.addvalueeventlistener(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { (datasnapsho

shell - Moving files older than 1 hour from one directory to another - AIX -

i trying move files older 1 hour, being populated every minute rapidly folder name specifies particular hour, in aix. the script trying run is: find /log/traces/ -type f -mmin +59 -exec mv '{}' /directory \; the above script gives me error: find: bad starting directory i newbie shell scripting. any highly appreciated. ------------------edited----------------------- i have been able move files older 1 hour, if specified folder not exist, creates file name specified in command , dumps files in it. script running is: find /log/traces -type f -mmin +59 -exec mv '{}' /directory/abc-$(date +%y%m%d_%h) \; it creates file named abc-[current hour]. want create directory , move files it. if not running root user may getting problem because of read permissions on /log/traces/ . to see permission level of directory run ls -l /log/traces/ left column display drwxr-xr-x explanation of permission settings directory has. understand more read thi

how to get the index of current selected node from treeview in c# -

Image
i'm working on form application in c# includes treeview in it. want attach panel each node whenever user clicks on node panel updated according node selected. problem i'm facing when select node, application nothing when select node application shows content related selected node. means app getting content related last selected node not current one. example if i'll select "text" node, label show nothing , after if i'll select other node "appearance" label show "text" last selected node. following here image of form contains treeview. testing purpose i'm storing selected node's value in label's text here's code. public partial class texteditor_preferences : form { public texteditor_preferences() { initializecomponent(); } list<panel> mypanels = new list<panel>(); //ignore line of code ! private void sidebar_mouseclick(object sender, mouseeventargs e) { label1.t

jquery - How can I cancelBubble for a drop down panel with a scroll bar? -

is possible use cancelbubble function dropdownpanel scroll bars? have issue when clicking on scroll bar scroll threw rows once mouse released results close. reading think need sort of cancelbubble event or stop propagation.. can done panel? have tried following still has not changed behavior. ideas appreciated tia <script type="text/javascript"> function cancelbubble(e) { var evt = e ? e : window.event; if (evt.stoppropagation) evt.stoppropagation(); if (evt.cancelbubble != null) evt.cancelbubble = true; } </script> <tr> <td class="style7" colspan="2" align="left"> <asp:textbox id="npitextbox" runat="server" bordercolor="white" borderstyle="none" forecolor="white" style="color: #ffffff; background-color: #ffffff"></asp:textbox> </td>

android - Create lots of apps with most of the same code -

i have searched internet answer can't find looking for. im looking have master code base can use across lots of apps. differences app icon, background image, app name , url server information. have master copy of app both on ios , android, , im copying (so creating new project same code), changing little bits need changing. in doing if updated master app new feature have add new bit of code every project update them. there way can update master code , update of projects apart url, name , images. edit - have looked @ question ( android-flavors-with-different-base-themes im not taking making 10 or apps 1 code base. have 170+ apps , growing. accpetable have many android flavours or xcode targets in 1 project , easy add new ones. as elrain has said below creating library can import each project proberly going best solution situation can manage library , update in projects. im wondering if has encountered problem before. thanks (for ios) given limited changes 1 app a

r - Function for every row in one column in data frame -

how deal for-loops calculating function each row in data frame this: for (i in 1:nrow(stemmed2)){ stemmed2$stem[i] <- gsub('in ', 'in_', stemmed2$stem[i]) } i tried this apply(stemmed2[1], 2, function(x) gsub('in ', 'in_', x)) i believe more efficient way exist (like apply or smth). please, me. upd. ok, see, thank you! have example: corr <- function(x){ df <- wd3[wd3$word==as.character(x),] if (nrow(df) < 3) {return('0')} else { cor <- cor.test(df$star, df$count) cor$estimate } } and for (i in 1:nrow(wd3)) { wd3$corr[i] <- corr(wd3$word[i]) } in case wd3$corr <- corr(wd3$word) not working... i think should want: corr <- function(x){ df <- iris[iris$species == as.character(x), ] if (nrow(df) < 3) { return('0') } else { cor <- cor.test(df$sepal.length, df$sepal.width) cor$estimate } } corr("virginica") corr("setos

Firebase AfterSave function like Parse.com -

so using parse.com aftersave cloud code function keep list of recent posts relating specific location. reason recent post location without having search , order entire list of posts locations. this nicely done in parse aftersave because didnt have worry clients exectuing command, made sense run in cloud. parse shutting down, i've decided migrate on firebase. there equivilant functionality in firebase or clients need maintaining list of recent posts? thanks original question re parse get latest record per field in parse.com js query there no way run code on firebase's servers. have come less-direct mapping of cloud code new solution. running functionality on each client 1 option, running on cheap "bot"/server one. i'll find few questions has been covered before , link them here: firebase , backend logic (recent question covers using nodejs server) how run server-side code in firebase? how use firebase handle automatic server-side calculat

javascript - Mozilla/JPM: executing a trusted script in an addon HTML page -

i'm learning jpm . here structure of project: ./lib/utils.js ./index.js ./data/frame.html ./data/icon-64.png ./data/icon-32.png ./data/icon-16.png ./package.json i want call trusted function test() defined in lib/utils.js ./data/frame.html when addon loaded, creates button opens new tab ./data/frame.html . so far index.js is: var self = require("sdk/self"); var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "my-link", label: "my plugin", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open({ url: self.data.url("frame.html"), inbackground: false, onready:function(tab) { contentscriptfile: [self.data.url("../lib/utils.js")] }

python - Invalid 'figure_or_data' argument when plotting a chart with traces appended through loops - plotly -

i put code can inserted loop, in order plot line chart, appending trace values of each column in dataframe. have been struggling while, , cannot quite figure out how keys in plotly figures , layout objects should called. import pandas pd import plotly.plotly py plotly import tools, utils plotly.graph_objs import * d = {'one' : pd.series([1, 2, 3], index=['a', 'b', 'c']), 'two' : pd.series([1, 2, 3, 4], index=['a', 'b', 'c', 'd']), 'three' : pd.series([1, 2, 3, 4, 5], index=['a', 'b', 'c', 'd','e'])} df = pd.dataframe(d) print(df.head()) data = [] column in df: trace = scatter( x = df.index, y = df[column], mode = 'lines', line = line( color='#ffd700', width=1 ), name = column ) data.append([trace]) layout = dict( title= 'room ambient temperatures (with range slider , selecto

swift - Can I extend viewWillAppear in UIViewController? -

i looking way extend implementation of function viewwillappear uiviewcontroller class make print class name of view called everytime function called. i know it's not possible override functions in extensions wonder if there way this. ok, after finding http://nshipster.com/swift-objc-runtime/ tried similar , achieve desired result. the code looks like: extension uiviewcontroller { public override class func initialize() { struct static { static var token: dispatch_once_t = 0 } // make sure isn't subclass if self !== uiviewcontroller.self { return } dispatch_once(&static.token) { let originalselector = #selector(uiviewcontroller.viewwillappear(_:)) let swizzledselector = #selector(uiviewcontroller.nsh_viewwillappear(_:)) let originalmethod = class_getinstancemethod(self, originalselector) let swizzledmethod = class_getinstancemethod(self, swizzledselector) let didaddmethod

java - Tomcat maven plugin: Unable to find jdbc -

by using tomcat7-maven-plugin launch spring web application needs connect mysql database. however, when attempting error "unable find jdbc" . error creating bean name 'datasource' defined in servletcontext resource [/web-inf/applicationcontext.xml]: invocation of init method failed; nested exception javax.naming.namenotfoundexception: n ame [jdbc/contentdatasource] not bound in context. unable find [jdbc]. my pom file includes. <plugin> <groupid>org.apache.tomcat.maven</groupid> <artifactid>tomcat7-maven-plugin</artifactid> <version>2.2</version> <configuration> <port>9001</port> <path>/webapp</path> <serverxml>./src/main/tomcat/config/server.xml</serverxml> <contextfile>./src/main/tomcat/config/context.xml</contextfile> </configuration> <dependencies>

Python flask - Encoding links based on JSON varibale -

i'm creating application in python flask , i'm struggling encode links. in html template i'm calling data json , based on variable json, want create link page variables have "space" in them, take first word , link doesn't work should. this json: [ { "team":"afc bournemouth" }, { "team":"arsenal" } ] and python: @app.route('/<team>/') def artist(team): json_data=open('static/data.json').read() data= json.loads(json_data) urllib.quote_plus(data.team) return render_template("team.html", team=team) i'm trying use "urllib.quote_plus" error attributeerror: 'list' object has no attribute 'team' i don't know how fix it. and loop in html: {% data in results %} <div class="team"> <p><a href=/{{ data.team }}>{{ data.team }}</a></p> </div> {%

java - How to access the column# of a GridLayout programmatically? -

i working on connect 4 game. i'm trying work out logic app able access coordinates of each token imageview can work out if 4 have been connected. i've looked high , low on documentation , can't seem find method in either gridlayout or gridlayout.layoutparams return either row or column of child. gridlayout.spec seems have methods set specs, not return them. missing something? how go retrieving column or row number of child view? edit: don't have code in front of me because i'm out of home , project saved locally. however, if helps, it's gridlayout on relativelayout 4 imageviews read vaguely thusly: <imageview android:layout_width="@dimen/tokensize" android:layout_height="@dimen/tokensize" android:layout_column="0" android:layout_row="0"//or "1" or "2" or "3" android:src="@drawable/token" android:id="@+id/tokenxbyy"/> i don't have java show because that

Customized Web Scraping in Python -

i new python , apologize in advance absurdity of question. trying scrap data website below having difficulty in telling python on how so. https://etrakit.friscotexas.gov/search/project.aspx want tell python go link , click on 'at least' drop down next project number option , click search. after results show 'click on export excel'. aware can done manually since have redundantly multiple links on weekly basis, want tell python it. possible in python? have looked @ multiple posts nothing fulfilling. please enlighten kind assistance. downloading excel file web in python script extract data web page import requests dls = "https://etrakit.friscotexas.gov/search/project.aspx" resp = requests.get(dls) save_file = ('c:\users\programming\projects')

javascript - Get relative coordinates of dragged element in snap.svg -

i'm trying write own onmove event handler snap.svg element.drag function . want allow element dragged constrain area. that, need coordinates of mouse relative svg's top left corner (0,0) handler provided x , y arguments absolute positions in document. seems rather useless given positioning in svg relative top left corner, , not document. there way of getting relative coordinates without using jquery .offset absolute position of svg?

c - May printf (or fprintf or dprintf) return ("successfully") less (but nonnegative) than the number of "all bytes"? -

the manual says that upon successful return, these functions [printf, dprintf etc.] return number of characters printed. the manual not mention whethet may number less (but yet nonnegative) length of "final" (substitutions , formattings done) string. nor mentions how check whether (or achieve that) string completely written. the dprintf function operates on file descriptor. similarily write function, manual does mention that on success, number of bytes written returned (zero indicates nothing written). not error if number smaller number of bytes requested; so if want write string have enclose n = write() in while-loop. should have same in case of dprintf or printf ? my understanding of documentation dprintf either fail or output output. agree gray area (and might not understand well); i'm guessing partial output kind of failure (so returns negative size). here implementation of musl-libc : in stdio/dprintf.c dprintf function c

javascript - Add directives using another directive in angular2 -

my problem create single directive called date-input can applied html input field. within custom date-input, want add other directives other modules same input. example, using textmask found here https://github.com/text-mask/text-mask/tree/master/angular2 i not want apply custom masks on application, instead add own directive, apply inputs, , if needs changing, have change 1 directive, rather places have implemented code. using textmask have number field, let alone unmask value upon setting ngmodel. not want copy code throughout site on components, these thought simple directive great. html <input type="text" class="form-control" [(ngmodel)]="inputvalue" [textmask]="{mask: mask, guide: false}" /> my typescript import { component, input, onchanges } '@angular/core'; import createnumbermask 'text-mask-addons/dist/createnumbermask.js'; export class numbercomponent { mask = createnumbermask({

search - Replacing *target* characters in RegEx without losing anything -

Image
parameter in sublime text 3 using following regex code search combo find any alphabet character preceding 0, followed space, followed character follows: regex code [a-z]0 [a-z] search target examples eg.1 a0 p eg.2 p0 sa eg.3 ap0 l question : regex code should write replaces such occurrences containing 0s dot (.) i.e., should become this: replace objective of target examples eg.1 a0 p → a. p eg.2 p0 s → p. sa eg.3 ap0 l → ap. l use capturing groups , backreferences : regex: ([a-z])0( [a-z]) replacement: $1.$2 see regex demo details : ([a-z]) - matches , captures group 1 ascii lowercase letter 0 - literal 0 matched ( [a-z]) - group 2: space , lowercase ascii letter the replacement contains backreference value stored in group 1 ( $1 ), replace 0 dot, , use backreference group 2 contents ( $2 ).

continuous integration - How to create a build definition in "visual studio team services" that is using source codes from multiple "Team Projects"? -

Image
i use vsts ("visual studio team service") have major problem. basically, have few class library solutions (e.g. classlibrary1 , classlibrary2 ) use them reference in other projects (e.g. websitesolution1, websitesolution2 , websitesolution3.) of course, have separate git repo (team project in vsts) each solution, let's "team projects" have same name solution contain. now create build definitions below rules: if commit change 1 of classlibrary "team project" (e.g. classlibrary1) first build classlibrary solution , use result ( dll file) feed websites solutions (e.g. websitesolution1, websitesolution2 , websitesolution3.) , build web solutions (which in different team project same account) if commit change 1 of websites solutions (e.g. websitesolution1) first build every classlibrary "team projects" (e.g. classlibrary1 , classlibrary2 ) , use result ( dll file) feed websites solutions thehas commit (e.g. websitesolution1, ) ,

java - Android Studio ExpandableList asking for text input -

i have developed weight conversion application works fine. when app launched, @ top of layout number box user must input value, example, 160lbs or 50kg, select conversion want perform expandable list gives options of pounds kilos or kilos pounds. the issue when number box above expandable list , user clicks input value, keyboard comes , instead of tick @ bottom right, when clicked hides keyboard , value in place, instead goes normal keyboard. this happens when expandable below number box. when list above number box works fine. user inputs value , clicks tick @ bottom right. want able place list below number box without prompt keyboard showing up. code here if needed not sure if part of code @ all: import android.app.activity; import android.os.bundle; import android.view.view; import android.view.windowmanager; import android.widget.button; import android.widget.edittext; import android.widget.expandablelistview; import android.widget.textview; import android.widget.toast;

ios - NEProviderTargetTemplates in macOS Sierra -

in macos sierra file don't exists. reported bug apple number 28697094 here can them, networkextension.framework of el capitan version. https://www.dropbox.com/s/9w4ga1jdomyvsnj/networkextension.framework.zip?dl=0

angularjs - Typescript user defined type guard stopped working when assigned to a service object -

i'm using typescript angular , defined type guard in service this: type types = typea | typeb | typec; function istypea(data: types): data typea { return (<typea>data).a !== undefined; } function istypeb(data: types): data typeb { return (<typeb>data).b !== undefined; } function istypec(data: types): data typec { return (<typec>data).c !== undefined; } let svc = this; svc.istypea = istypea; svc.istypeb = istypeb; svc.istypec = istypec; and in service function use this: if (istypea(data)) { // use data.a } else if (istypeb(data)) { // use data.b } else if (istypec(data)) { // use data.c } it works fine in service, once assign guards service's this object , use them in controller, got following error: error ts2339: property 'a' not exist on type 'types'. the guards used this: // svc injected controller service if (svc.istypea(data)) { // use data.a } else if (svc.istypeb(data)) { // use data.b } else i

Artifactory: symlink or aliasing an Artifact URL? -

i realize artifactory support team reads these posts, question either regular question or feature request. i want programmatically update various artifacts , when operations complete (copies, writes, moves, deletes), create alias/symlink new/updated artifact urls. for example, have "latest" link points latest build number of different artifacts: java, yum, python , generic binaries, is, native executables not use pypy/maven/yum toolsets. i don't see way , if case, i'd request feature in new version of artifactory.

google app engine - GAE and Objectify query and error using order() -

i working on demo project , 1 of methods provides basic query on type. public list<conference> filterplayground(){ query<conference> query = (ofy().load().type(conference.class)).order("name"); query = query.filter("topics =", "medical innovations"); query = query.filter("city =","london"); return query.list(); } my conference entity has @index name, city , topics. but when run method in api explorer exception... (see below). quick pointers why using order method causes this. know order method without there no error. uncaught exception servlet java.io.ioexception: com.google.appengine.repackaged.org.codehaus.jackson.map.jsonmappingexcepti on: no matching index found. recommended index is: - kind: conference properties: - name: city - name: topics - name: name suggested index query is: <datastore-index kind="conference" ancestor="false" source="m

parsing - why is cloudflare blocking my wordpress page -

i have wordpress site: http://www.fairlady-sleepingtiger.co.uk/ home page not displaying content. when inspect console see message: www.fairlady-sleepingtiger.co.uk/:12 parser-blocking, cross-origin script, http://ajax.cloudflare.com/cdn-cgi/nexp/dok3v=088620b277/cloudflare.min.js, invoked via document.write. may blocked browser if device has poor network connectivity. i have deleted/disbaled cloudflare functionality site still comes up. can please? you still pointing cloudflare nameservers, domain still being proxied. there period of time continue handle dns after remove zone, protects against situation nameservers didn't changed. otherwise site unreachable. if want remove cloudflare need update nameservers @ registrar, , depending on registrar should update in 24 hours or so.

javascript - React native app crashes on slow Android devices when scheduling over 200 local notifications -

i scheduling on 200 notifications on android application in simple loop using this package . when doing so, emulators , high-end devices don't crash, low-end devices crash on release mode, leaving no trace of error except "unfortunately, %appname% has stopped.". for (let = 0; < 200; i++) { pushnotification.localnotificationschedule(event); } i tried adding throttle loop settimeout , ease load on processor app keeps crashing. after crash 100 notifications have been scheduled, of them, none , doesn't crash.

javascript - Can you have multiple spyObjs in a beforeEach -

i testing angular 1 application jasmine. question is, is possible create 2 spies 2 separate services in same beforeeach statement? right can first spy work, i'm not sure why other spy isn't working. have spies setup promise assigned global variable inside of them, can accessed in of tests. so, second variable returning undefined instead of expected promise. here sample set code inside beforeeach : mockworkingservice = jasmine.createspyobj('mockworkingservice', ['retrieve']); mockworkingservice.retrieve.and.callfake(function(crit) { workingservicedfr = $q.defer(); // $q defined globally return workingservice.promise; }); mockfailingservice = jasmine.createspyobj('mockfailingservice', ['retrieve']); mockfailingservice.retrieve.and.callfake(function(crit) { failingservicedfr = $q.defer(); return failingservice.promise; }); also, retrieve defined separately each service. the short answer "yes", ca

reporting services - SSRS Data Type Conversion issue | Tough one -

Image
i have been working on ssrs project , ran several issues. trying move averages , team averages on integers , convert string. please see picture below. getting weird results. issue when go on 60 minutes, not 01:01:00 61:00. have tried public functions such : public function minstohhmm (byval minutes as decimal)    dim hourstring = floor(minutes/60).tostring()     dim minstring = floor(minutes mod 60).tostring()    return hourstring.padleft(2, "0") & ":" & minstring.padleft(2, "0") end function  =code.minstohhmm(avg(fields!test.duration.value)) i not getting right conversion. trying hh : mm : ss format. anybody knows how modify code result want? thanks lot! lukas i think don't need use custom code that, if field containing minutes information set aggregable data type can calculate average in ssrs , format hh:mm:ss follows: =format( dateadd(dateinterval.minute,avg(fields!minutes.value),c

I'm using php 5.6.25 and trying to filter the input, but it is only entering the data once into mysqli -

i've tried few ways of filtering , when can insert table once, id set auto increment. how variables defined. <form action = "php/createaccount.php" method = "post"> first name <br /> <input type ="text" placeholder="first name" name = "fname"><br /> last name <br /> <input type ="text" placeholder="last name" name = "lname"><br /> user name <br /> <input type ="text" placeholder="username" name = "uname"><br /> password <br /> <input type ="text" placeholder="password" name = "pword"><br /> school name <br /> <input type ="text" placeholder="school name" name = "sname"><br /> email <br /> <input type ="text" placeholder="email" name = "email"> <br /> <input type =

visual studio - Asp.net mvc IntelliSense in Controller for Views in alternate location -

Image
i've asp.net mvc 4 site in vs 2015 , i've created alternate folder addional web.config, can find views addional default view folder. app views logviewer logmonitor.component.cshtml web.config views (original views folder) shared home web.config but when want access new views in controller intellisense nothing , when write right path in return view("path") red , no sign vs tells me path exists. public actionresult logmonitorcomponent() { return view("views/logviewer/logmonitor.component"); } when access default views intellisense , vs tells me files can access. knows whati need working. know should work, because i've seen allready somewhere. thats not working example @ moment, not underlined , totaly red, works view found, vs don't gives me intellisense the default view here fine underlined , "normal red". its visual studio problem, when start project working fine.

html - Is it possible to shrink the width (responsive) of an image beside a floated element? -

Image
i'm trying convert existing design (somewhat) responsive layout. has floated box (blue box) in upper left corner, , rest of content should floated around (text , green box, representing image). i'm looking way adjust size of image (green box) long beside floated blue box, returning normal size when being pushed beneath other content (lorem ipsum). my normal approach max-width:100% won't kick in here because of blue box. have approach ( fiddle , same snippet below) using wrapping div, demonstrates desired behaviour, mean wrap each content image in div. is there other smart way without wrapping div? /* try varying width of #wrap see effect */ #wrap { border:1px solid #aaa; min-height:200px; width:280px; background-color:#ddd; padding:10px; } #blue { width:150px; height:100px; border:1px solid #aaa; float:left; background-color:#ccccff; overflow:hidden; margin-right:10px; } #green { min-width:100px; min-height:3

amazon web services - Configure nginx cache in AWS Elastic Beanstalk -

i need change configuration of nginx reverse proxy in eb. in local environment have configured fine , working, when try change proxy_cache_path , other stuff, it's not working. this local configuration ( nginx.conf ), important thing here proxy_cache_path , configure cache section : #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_

ios - Push notifications not working unless it's on TestFlight or AppStore -

i'm having problems push notifications on development. used apn tester , in return: connected server gateway.sandbox.push.apple.com set ssl connection set peer domain name gateway.sandbox.push.apple.com keychain opened certificate data apple push services: com.boardinc.board initialized failure creating sec identity, error code -25300 failure creating client certificate, error code -50 failure performing handshake, error code -9824 token: <0c6586f1 3933b8df 5da790a4 dd82e6c6 6cd7245e f27590c1 8c8ede44 53d8912d> failed sending data gateway.sandbox.push.apple.com:2195 error: -9806, error code -9806 disconnected server gateway.sandbox.push.apple.com:2195 i can't seem find reason why security identity not being created. i tried doing release , debug tokens same result. gateway development , adhoc/production. no success. now, push notifications work fine on testflight , in appstore. don't know can start. suggestions? thank much.

angularjs - Passing two parameters to Express Mongoose api to return single result -

i'm new creating apis express , mongoose. i've been able setup basic endpoints, get, post, put, etc. but want set 1 pass 2 parameters search collection , return single result. i don't think i'm passing parameters correctly. in angular, have following service call, know correct: .factory('loginfactory', function($resource){ return $resource('/api/user?email=:eml&password=:pwd', {}, { query:{ method:'get', isarray:true, params:{ eml:'@eml', pwd:'@pwd'}} }); }); but don't think i'm doing right in express/mongoose api. here endpoint: router.route('/:email:password') .get(function(req, res){ user.findone({email:req.param.email, password:req.param.password}, function(err, user){ if(err) res.send(err); res.json(user); }); }); i use req.params not req.param and have slash before each param app.get("/:email/:password", function(req, res){ console.log(

c# - Configure Web API to provide metadata -

i new to.net /mvc/ web api. have created .net web api accepts input parameters queries oracledatabase , returns result in json. pretty following simple c# codes. controller looks like public class datacontroller : apicontroller { [httpget] public httpresponsemessage getdetails(string room, datetime dob_gt) { list<oracleparameter> prms = new list<oracleparameter>(); prms.add(new oracleparameter("room", oracledbtype.varchar2, room, parameterdirection.input)); prms.add(new oracleparameter("dob_gt", oracledbtype.date, dob_gt, parameterdirection.input)); string connstr = configurationmanager.connectionstrings["sdatabaseconnection"].connectionstring; using (oracleconnection dbconn = new oracleconnection(connstr)) { dataset userdataset = new dataset(); var strquery = "select * sample_results_vw room = :room , dob > :dob_gt &q

Specifed color changing in string. Swift iOS -

i'm wondering how make colorful string. what mean is: i need string example firstletter - white, second - blue, third - red , forth - orange , fifth - white , on in loop. i googled line of code: mymutablestring.addattribute(nsforegroundcolorattributename, value: uicolor.redcolor(), range: nsrange(location:2,length:4)) but gets location , length, how make changing color in specified order? try this: let color : [uicolor] = [.white, .blue, .red, .orange] let plainstring = "hello world" let str = nsmutableattributedstring(string: plainstring) var in 0..<plainstring.characters.count { let range = nsmakerange(i, 1) let newcolor = color[i % color.count] str.addattribute(nsforegroundcolorattributename, value: newcolor, range: range) }

assembly - Trying to return from Protected Mode to Real -

i'm trying go real mode, after protected, , processor got stuck right after changing cr0 register. i'm using nasm, , compile program binary .img run under virtualbox bootloader. i'm missing long jump realmain proc. [org 0x7c00] ; bios boot origin [bits 16] ; 16-bit real mode jmp start ;jump start() entry-point %include "routines16.asm" [bits 16] start: mov si, welcomemsg call print call getkey call clear realmain: cli mov ax, cs mov ds, ax mov es, ax ; mov ax, stack16 ; mov ss, ax sti mov si, inrealmsg call print mov si, anykeymsg call print call getkey call toprotected toprotected: mov si, toprotectedmsg call print call clear; ;move cli lgdt [gdt32_descriptor] ; load gdt mov eax, cr0 or eax, 0x1 mov cr0, eax jmp dword code_seg_32:protectedmain ;;;;;;;;;;;;;; welcomemsg db "ipr1-degtyarev. press key start", 0x0 inrealmsg db "in real", 0x0 toprotectedmsg db "switching prote

ecmascript 6 - Webpack build failed when a file imported some files which are not under current working directory -

app   +---commonmodule   |    +---reducers   |    |      +--- gradereducer.js   +---myapp   |    +---reducers   |    |      +--- reducers.js   |    +---components   |    +---actions   |    +---containers   |    +---webpack.config.js based on above structure, tried import gradereducer.js in reducers.js . webpack can't build it. says "referenceerror: unknown plugin "transform-runtime" specified in "base" @ 0" if put gradereducer.js under myapp/reducers directory, webpack can build successfully.