Posts

Showing posts from 2013

css - jquery height() returning 0 value -

i have small script written center content of div setting padding top & bottom adjacent div: $(document).ready(function() { $('.index-block:first').css({ 'padding-top': (($(window).height() - $('.cta').height()) / 4) - $('footer').height() + "px", 'padding-bottom': (($(window).height() - $('.cta').height()) / 4) - $('footer').height() + "px" }); $('.search').css({ 'padding-top': ($('.brand').height() - $('.search').height()) / 4 + "px", 'padding-bottom': ($('.brand').height() - $('.search').height()) / 4 + "px" }); alert('brand: ' + $('.brand').height() + ' | search: ' + $('.search').height()); }); html: <div class="index-block cta row"> <div class="col-md-4 brand"> <img src="/static/ima...

Parsing string with 3 hyphens C# -

i have string coo70-123456789-12345-1. need parse based on "-" not length of substrings , use parsed values. have tried using regular expressions having issues.please suggest. after have split values need use each values: string = coo70, int b = 123456789, int c = 12345, short d = 1 . how in different variables a,b,c,d. string[] results = uniqueid.split('-'); string = results[0]; string b = results[1]; string c = results[2]; int k_id = convert.toint32(k_id); string d = results[3]; short seq = convert.toint16(seq); string s = "coo70-123456789-12345-1"; string[] split = s.split('-'); //=> {"coo70", "123456789", "12345", "1"}

multithreading - Python Tkinter: Reading Serial Values -

i read serial values tkinter gui. either text window or text label widget updates every second or so. issue having queue class. error getting is: attributeerror: 'applcation' object has no attribute 'queue' here code: #!/usr/bin/env python tkinter import * tkinter import messagebox time import sleep import picamera import os import serial import sys import rpi.gpio gpio import _thread import threading import random import queue # setup gpio pin(s) gpio.setmode(gpio.bcm) gpio.setwarnings(false) gpio.setup(18, gpio.out) gpio.output(18, false) #============================================================== # declaration of constants # none used #============================================================== class serialthread(threading.thread): def __init__(self, queue): threading.thread.__init__(self) self.queue = queue.queue() def read_sensor_values(self): ser = serial.serial('/dev/ttyusb0', 9600) while tr...

io - C trie node reassignment causing segmentation fault -

i trying implement spellchecker, , 1 step load dictionary trie structure. have used gdb determine that, understanding, getting segmentation fault every time try assign current->children value. full code @ bottom, method in question: bool load(const char* dictionary) { file* dic = fopen(dictionary, "r"); if(dic == false) { return false; } root = calloc(27, sizeof(node)); node* current = null; /**for(int i=0;i<27;i++) { current->children[i]=null; }*/ //this location of segmentation fault if uncommented int = 0; while((a = fgetc(dic)) != eof) { if (a == '\n') { //this end of word if(!current->is_word) { //duplicate case current->is_word = true; wordcounter++; } current = root; } else { if(current->children[a-'a...

javascript - Get the exact font of a rendered text in the browser, maybe with a browser extension -

this question has answer here: how actual rendered font when it's not defined in css? 4 answers i know can font-family value window.getcomputedstyle() that's not font used browser render. example, if given text contains (multi-lingual) text font family not carry, browser renders text partially system font. if take @ built-in web developer tool, either in chrome or firefox, both have little area display ( rendered fonts pane on chrome or fonts tab on firefox) exact fonts used. firefox, guess this code used , seems calling internal api. i'm looking dom-compliant (or vendor-specific) way exact font javascript land or else. if means writing browser extension/add-on provide api/inject info/whatever in-page code access, that's worst case, acceptable. you can hack : main idea compare size of inline elements given fonts. 1 should use comple...

How to set a empty line before output in bash shell? -

i have this: $ any_command any_command: command not found but need this: $ any_command any_command: command not found what add ps1? you can use trap command debug signal: trap 'echo' debug this print newline before command output. $ any_command bash: any_command: command not found $ or: $ date tue sep 29 17:51:38 edt 2015 $

database - Sequelize field association does not work -

i have 2 tables. how link field in first table id field in second table in sequelize? first table: tables.comments = sequelize.define('comments', { id: { type: sequelize.integer, primarykey: true, autoincrement: true }, text: sequelize.text, article: sequelize.integer, author: { type: sequelize.integer, references: "users", referenceskey: "id", allownull: false }, answer: sequelize.integer, rating: { type: sequelize.integer, defaultvalue: 0 } }, { classmethods: { associate: function(models) { tables.comments.belongsto(tables.models.users, {foreignkey: 'author', targetkey: 'name'}); } } }); second table: tables.users = sequelize.define('users', { id: { type: sequelize.integer, primarykey: true, autoincrement: true }, mail: sequelize.text, nam...

Update statement and cursor in SQL Server -

i'm little confused below update statement. example if @num = 1 , ntt = 4 . while using cursor want use initial value of num .i.e 1. i'm receiving incremented value 5. doing wrong ? thanks, appreciate it. update #temp set num = @num, @num = @num + ntt declare cur cursor local forward_only dynamic select yr, id, num #temp open cur fetch cur @yr, @id, @num while @@fetch_status = 0 begin update #temp2 set tran_id = @num, @num = @num +1 ........... fetch cur @yr, @id, @num end the update 2 things determined in set updates num column in #temp @num updates @num @num + ntt

AngularJS: Register Controller from separate .js file -

i new angularjs , using plnkr.co learn how use angular. have having difficulty registering controller stored in separate .js module initialized. can tell me why below not work? index.html file <!doctype html> <html ng-app="plunker"> <head> <meta charset="utf-8" /> <title>angularjs plunker</title> <script> document.write('<base href="' + document.location + '" />'); </script> <link rel="stylesheet" href="style.css" /> <script data-require="angular.js@1.4.x" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.6/angular.min.js" data-semver="1.4.6"></script> <script src="app.js"></script> <script scr="mainctrl.js"></script> </head> <body ng-controller="mainctrl"> <p>hello {{name}}!</p> </...

angularjs - HTTP response following long process -

the current project in node.js expressjs framework. have application client/prospect information, authenticated users allowed modify database , initiate long-running processes on server. example, printing 30 pg document 1 process. the application user needs 2 main things: a response when process begins. a response (notification) when process ends. we handle need #1 in standard express fashion ensuring process starts followed res.json({msg: 'process started']); angular front end. need #2 handed email user initiated process process status report. i improve how handle need #2. specifically, send json string user display in interface. questions : is possible on http? does functionality exist within express or well-know middleware. assuming 1 & 2 false. solution run tcp socket server maintain socket required users. when process ends message sent user status update. can comment on issues solution presents? yes both 1 , 2. seek achieve here push ...

c - My dequeue function doesn't work properly, what is my mistake? -

struct node* dequeue(struct queue *queue) { struct node *temp = queue->front; if (temp == null) { printf("nothing delete"); return temp; } else if (temp->next == null) { free(temp); queue->front = null; queue->rear = null; printf("successfully delete."); return temp; } else { queue->rear = queue->rear->next; free(temp); printf("successfully delete."); return temp; } } as printed in main() function data of deleted node, appears outputting random number, mistake here? please help. you both free , return node. if want free node, don't return it. if want return node, don't free it. now, returning pointer node before freed it. use that?

c++ - virtual noexcept(true) errors: MinGW and gtkmm -

i've been fighting month solid build //working// c++/gtkmm-3.0 application on windows mingw. managed libraries, mingw, , codeblocks along on windows xp (virtualbox). however, when try build, following errors. these recent versions of gtkmm-3.0 , dependencies. got them via msys2, though cannot build in environment reasons yet unknown. so, oft recommended, copied them on mingw /lib , /include directories, , ensured pkg-config find them. all's there (allegedly). these problems not originating code, obviously. didn't write or modify gtkmm. yet, can't these go away. it worth mentioning last getting errors relating "cannot find glib::ustring::ustring", , decided stop whining , give me these out of blue instead. if earlier messages ever show again, i'll post them here. i'm beginning think isn't worth releasing software on windows @ all. note: getting on 50 of these, in gtkmm-3.0 , dependency libraries, originating line 1 or 2 of main, , ...

python - SQLite3 Request Hangs in Twisted -

i trying write script automatically update schema of database. however, reason twisted hangs during second request make on adbapi.connectionpool. here code: update.py import os import glob import imp twisted.internet import reactor twisted.enterprise import adbapi twisted.internet import defer @defer.inlinecallbacks def get_schema_version(conn): schema_exists = yield conn.runquery("select name sqlite_master type='table' , name='schema_meta';") defer.returnvalue(0) def add_schema_files(schemas): # finds , imports schema_*.py files list module_files = glob.glob(os.path.dirname(os.path.abspath(__file__)) + "/schema_*.py") mod in module_files: module_name = os.path.basename(os.path.splitext(mod)[0]) newmod = imp.load_source('%s'%module_name, mod) schemas.append( (module_name, newmod) ) @defer.inlinecallbacks def update_schema(conn): # update database schema latest version schema_vers...

javascript - Jquery parent not working properly -

a few days ago created comment system (hardly) , , wanted add edit , reply , , delete function, , after searching web (including one) managed , have problem jquery. want use in order create buttons when clicked display reply , delete , edit form, i've search forum , find solutions, , applied them, have various problems: first when use .toggle , display form comments , started use parents() , when use nothing works! here code: <body> <h1>comments (3)</h1> <div class="comment"> <form action="new.php" id="new_comment" method="post" name= "new_comment"> <textarea class="text_cmt" name="text_cmt" placeholder= "post new comment"> </textarea><br> <input type="submit" value="post"> </form> </div> <div class="comment"> ...

javascript - How to insert a template inside a meteoric IonPopup.show -

i'm trying have rating form inside meteoric ionpopup. have button show form: template.thing.events({ 'click [data-action="showreview"]': function(event, template) { ionpopup.show({ title: 'leave review', cssclass : '', templateurl: 'reviewpopup.html', buttons: [{ text: 'cancel', type: 'button-default', ontap: function(e) { e.preventdefault(); } }, { text: 'ok', type: 'button-positive', ontap: function(e) { return scope.data.response; } }] }); } }); which ideally should put reviewpopup.html in body reviewpopup.html <template name="reviewpopup"> {{#if currentuser}} rating: {{> rating}} {{/if}} </template> <template name="rating"> <div class="rateit"></div> </template> however ...

JSON Extraction in Python. -

trying specific data through json format , i'm unable so. trying in python , want more 1 thing printed out. im providing example code make clear. name of file blah { u'info': { u'more_info': { u'xyz': u'[]', u'xyz': none, u'xyz': 00000, u'description': u'blah blah blah', u'xyz': 0000, u'url': u'xyz': false, u'name': u'blah blah', u'xyz': 10, u'xyz': 1, i refer documentation, still fails me. i tried for xyz in blah['info']['more_info']: fs = xyz['name']['description']['url'] the error that: "typeerror: string indices must integer" please help. iteratin...

python - How to split a pandas dataframe based on column prefix -

i have dataframe imported csv. goes this: df a.1 b.1 a.2 b.2 1 1 1 1 2 2 2 2 my question is, efficient way turn seperate data frames comprised of a's , b's df_a a.1 a.2 1 1 2 2 df_b b.1 b.2 1 1 2 2 i not picky far column names, fine having them stripped 1 , 2 etc haven't been able find way this. open other/better ways accomplish trying in case doesn't make sense more knowledgable. thanks! you use df.filter regex patterns: df_a, df_b = df.filter(regex=r'^a'), df.filter(regex=r'^b') or df_a, df_b = df.filter(like='a'), df.filter(like='b') note if use like='a' columns name contains 'a' selected. if use regex=r'^a' columns name begins a selected. in [7]: df out[7]: a.1 b.1 a.2 b.2 0 1 1 1 1 1 2 2 2 2 in [8]: df_a, df_b = df.filter(regex=r'^a'), df.filter(regex=r'^b') in [9]: df_a out[9]: a...

c++ - What exactly are knots (b-spline) -

knots things make curve continuous, in bezier curves, line segment mid point control point have have same tangent , length , if bezier curves c-continuous. so, knots have read parameters of spline handle start , end points hence c-continuosity of curve. so, knot data type ? any idea's? a b-spline piecewise polynomial, , knots points pieces meet. knot have same type argument polynomials. supply value @ each knot, , either control point between each consecutive pair or first derivative. say, smoothness depends on function , derivatives being continuous @ knots.

javascript - How to get first childnode within a for loop -

i'm trying create script gets sections of documentation , creates navigation id link , h2 link text. i've tried several ways , title undefined. i've tried using class, getting first child node, , converting nodelist array. http://codepen.io/brooksroche/pen/xmpnaq?editors=101 if (document.getelementsbyclassname("doc-section")) { var sections = document.getelementsbyclassname("doc-section"), sidebar = document.getelementbyid('sidebarnav'), navlinks = ""; (var = 0; < sections.length; ++i) { var current = sections[i], anchorid = current.id, title = current.childnodes[0].text, navlink = '<li><a href="#' + anchorid + '">' + title + '</a></li>', navlinks = navlinks + navlink; } if (sidebar) { sidebar.innerhtml = navlinks; } } use instead (when collecting headers): title = current.children[0].textcontent demo . in ...

php - Trying to get a while loop inside another while loop, but it is not working together -

this question has answer here: commands out of sync; can't run command now 11 answers i trying make while() loop, data database, , need make loop based on 1 of variables given last while() loop. there no typo's far can see, keep getting fatal error: call member function bind_param() on boolean in ... on line 77." this code: (image better structure: http://imgur.com/0dfhorb ) <?php $sql = 'select raised_id, user_id, project_id, amount cf_donations order raised_id desc limit 6'; $stmt = $connection->prepare($sql); $stmt->bind_result($rid, $uid, $pid, $amount); $stmt->execute(); while($stmt->fetch()){ ?> <?php $userinfoquery = 'select first_name, last_name, profile_image cf_users user_id = ?'; $stamt = $connection->prepare($userinfoquery); ...

php - Laravel access classes without namespace in views -

usually, laravel out of box able access default "user" model without prefixing namespace routes, within view, so: user::find(1); however, if create model, example - "business", in order access in views need following: app\business::find(1); is there way "use" classes globally in views, works user class? thanks in advance. edit: works if following in blade.php file, example: @extends('layouts.main') @section('content') <?php use app\business; ?> {{ business::find(1)->name }} @stop but seems not-so-clean way it. or wrong , acceptable? p.s - using laravel 5.1 not idea eloquent models technically can service injection since laravel 5.1. again should better off doing in controller , passing data in. something along lines of: @inject('business', 'app\business') @section('content') {{ $business->find(1)->name }} @stop

css - Styling jQuery widget divs -

when try modify class #dialog .ui-dialog-titlebar there no visual change. $(function() { $("#dialog").dialog(); }); #dialog .ui-dialog-titlebar { background-image: none; background-color: red; } <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <div id="dialog" title="dialog"></div> becouse .ui-dialog-titlebar not in #dialog . should send int dialogclass , use class. javascript: $(function() { $("#dialog").dialog({dialogclass: 'test'}); }); css: .test .ui-dialog-titlebar { background-image: none; background-color: red; } or can change .ui-dialog-titlebar (but think don't want this)

joomla3.4 - Joomla Form w/ File Upload for iOS & Android? -

i've used chronoforms joomla forms , it's great, haven't been able figure out how make file upload process clean , efficient ios , android devices it. what joomla 3.x form @ handling file uploads ios , android? or, how setup chronoforms it? as is, in android given choice of several unfamiliar apps choose file, not gallery or form of file browser. if there way tell os type of file needs trying upload work great. chronoforms work , can setup cleanly handle uploads mobile devices. for desired file field select edit , scroll down params box. in there, add following link of code: accept=images/* this presents users choice of apps select file, both file browsers , photo gallery. allows uploads file types , cleanest way have discovered handle uploads of documents , other types of files. additionally, if wish can force users take photo camera attached adding line in addition above line: capture=camera

c - Loop runs multiple times after input before allowing input -

so whenever run code, code runs , prints out results, runs again , prints arbitirary results, , again, , again, lets me input loop. not find error , tried searching online. help appreciated while (x > 0) { printf("please enter money , nickels (ex. $12.63 , 3 nickels). \nenter 0 end program:\n"); scanf("%c %lf %s %d", &dollar, &money, &andword, &nickel_input); if (dollar == '0') { printf("thanks using program!"); return 0; } money *= 100; money -= nickels * 5; quarters = (money / 25); money -= quarters * 25; dimes = (money / 10); money -= dimes * 10; nickels = (money / 5); money -= nickels * 5; pennies = (money / 1); money -= pennies * 1; coins = quarters + dimes + nickels + pennies; nickels += nickel_input; printf("the fewest number of coins have %d:\n", coins); printf("# quarters: %d\n", quarters); ...

Matching game using javascript -

i making game logic of game match word given uses image. how validate using image? < script > var e = document.getelementbyid("e"); var n = document.getelementbyid("n"); var d = document.getelementbyid("d"); /*move img_letter*/ //e function move_e() { e.onclick = function() { e.style.bottom = "300px" e.style.left = "320px" } }; //n function move_n() { n.onclick = function() { n.style.bottom = "300px" n.style.left = "550px" } }; //d function move_d() { d.onclick = function() { d.style.bottom = "300px" d.style.left = "780px" } }; window.onload = function() { move_e(); move_n(); move_d(); } < /script> <html> <head> </head> <style> #d { margin-left: -3%; position: absolute; } #n { margin-left: 5%; position: absolute; } #e { margin-l...

In an input array in Java, how do I find the number of pairs of values that are equal? -

i'm trying make o(nlogn) algorithm determines number of pairs of values in input array equal. thinking of doing storing each value of array in variable , continue comparing current value previous values , see if there's match , if there counter goes one. int current value; int previous value; for(int j = 0; j < array.length; j++){ current value = array[k] previous value = array[k-1] what i'm confused fact running time has o(nlogn) i'm wondering if that's right kind of method use problem or if there's better , more convenient way of doing this. pseudo code: n = array.length k - 1 n if k == k-1 increment counter 1 you can sort array , compare adjacent values, it's 1 option. you'll have complexity of o(n*log(n)) then. another option track visited elements using temporary hashset , result hashmap counter pairs: public static <t> map<t, integer> findpairs(list<t> elements) { s...

java - How to accelerate the cpu's uptime? -

there jdk bug: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8022628 it java.net.sockettimeoutexception in 49.7 days. in link, says "we've accelerated cpu's uptime". want make test bug, don't know how "accelerate cpu's uptime". import java.io.ioexception; import java.net.serversocket; public class testsocket { public static void main(string[] args) throws ioexception { serversocket serversocket = new serversocket(5555); serversocket.accept(); } } i ran program above, changed time 49.7 days later, or more later, there's no sockettimeoutexception. jdk version: java version "1.7.0_79" java(tm) se runtime environment (build 1.7.0_79-b15) java hotspot(tm) server vm (build 24.79-b02, mixed mode) most means set clock forward. timers based on clock, moving clock forward makes timers expire sooner. this why, incidentally, ntp avoids abrupt clock adjustments: can cause aberrations in ...

Hierarchical modeling categorical variable interactions in PyMC3 -

i'm attempting use pymc3 implement hierarchical model categorical variables , interactions. in r, formula take form of like: y ~ x1 + x2 + x1:x2 however, on tutorial https://pymc-devs.github.io/pymc3/glm-hierarchical/#partial-pooling-hierarchical-regression-aka-the-best-of-both-worlds explicitly glm doesn't play nice hierarchical modeling yet. so how go adding x1:x2 term? categorical variable 2 categorical parents (x1 , x2)? you can manually add interaction term linear model. have add 3 regression coefficients (betas) , 1 intercept. can estimate y likelihood follows: y = pm.normal('regression', mu=intercept + beta_x1 * data_x1 + beta_x2 * data_x2 + beta_interaction * data_x1 * data_x2, sd=sigma, observed=data_y) the parameters can have hyperpriors build hierarchical model.

android - Default Launcher App - How to detect if another app is 'always' the launcher -

when app selected 'always' default launcher, when try startup launcher dialog goes directly 'always' selected launcher. how can detect if app 'always' launcher? android: choose default launcher programatically is solution, problem if user has selected app 'always' firing off intent goes home screen, , not selector dialog. did try resolving intent via packagemangers resolveactivity (intent intent, int flags) ? you have configure intent launching default launcher , determine result if can detect launcher.

How to store hash value from C# in SQL Server using sql query -

i have problems getting data type correct. have column in database table binary(64) hold salted hash value of password. i don't understand how present data sql server. have read supposed pass strsaltedpassword.gethashcode() nvarchar(max) have not been able make work... so next tried having parameter first of binary , have tried varchar this c# code , sql insert query //sqldbtype.varchar = "implicit conversion data type varchar binary not allowed. use convert function run query." sqlparameter myfield = sqlcmd.parameters.add("@myfield", sqldbtype.varchar); myfield.value = strsaltedpassword.gethashcode(); string sqlquery = "insert users ([username],[firstname],[lastname],[emailaddress],[emailverified],[verifiedtimestamp],[isactive],[passwordhash],[securitystamp],[accountcreatetimestamp]) values ('" + username.text + "'" + ", '" + firstname.text + "'" + ", '" + lastname.text + ...

jQuery - Display radio button seleted label value -

i working on voting application. how can display, user selected value? online demo detailed description: default, selected value div ( <div class="your-answer"> ) hidden, if user selects of answer, div visible text : <div class="your-answer"> <h3>you answer is: <span></span></h3> </div> inside <span></span> tag, want display user selected radio label. i able achieve first half minimal knowledge in jquery, not able display selected value inside span tag, though getting value alert :( html structure <div id="livepoll"> <div class="question"> <h1>lorem ipsum dolar sit amet lieu?</h1> </div> <div class="question-options"> <ul> <li> <input type="radio" name="radiog" id="radio1"> <label for="radio1">terrible</label> ...

c# - Getting the content of the cell of a selected row from DataGridView -

this question has answer here: accessing gridview cells value 3 answers string feeid = grdvw.rows[index].cells[0].text; is correct way retrieve content of cell in selected row? if use this, not value. so, please suggest best way. yes, that's way it, can like: string feeid = grdvw.rows[index].cells[0].value; also, if want values rows iterate through datagridview this: foreach (datagridviewrow row in grdvw.rows) { string column0 = row.cells[0].value; string column1 = row.cells[1].value; //more code here }

xcode - Set NSData dataWithContentsOfURL timeout -

so have method in app returns bool if , update available apps content - (bool)isupdateavailable{ nsdata *dataresponse=[nsdata datawithcontentsofurl:[nsurl urlwithstring:@"url returns json object"] ]; if(dataresponse!=nil){ nserror *error; dicupdates = [nsjsonserialization jsonobjectwithdata:dataresponse options:nsjsonreadingmutablecontainers error:&error]; } if(dicupdates.count > 0) isupdateavailable = yes; else isupdateavailable = no; return isupdateavailable; } i need synchronous request this, cause next view controller dependent on server response. takes long time server respond or internet slow, need set time out prevent app 'being frozen'. i used nsurlconnection accomplish task, has been deprecated. also, tried using nsurlsession, (been using download updates in background thread), can figure out if can used synchronous request. any idea how deal this? need synchronous method returns bool . best regards...

How to remove default input class type from Simple Form, using Rails 4 and Bootstrap 4? -

i'm using rails 4.2.4 bootstrap 4 (using bootstrap_ruby gem). simple form adds input type classes form... if input string add class string input. wanted know how stop happening? for example, if had form file input. simple_form_for @attachment |f| f.input_field :file, as: :file end it produce following html: <form> ... <div class="form-group file optional photo_image"> <label class="file optional control-label" for="attachment_file">file</label> <input class="file optional" type="file" name="attachment[file]" id="attachment_file"></div> ... </form> it adds file class label , input fields. there way remove file class when form being built? i'm trying use bootstrap 4 (alpha) , it's clashing file class name. i thought on config.wrappers adds type of input class eg. string, file . thanks in advance. bootstrap 4...

c# - How to create transaction with asp.net identity? -

i doing registration on asking 5 things: fullname,emailid,password,contactnumber,gender now emailid , password storing register method , given in below 2 link: public async task<actionresult> register(registerviewmodel model) { if (modelstate.isvalid) { var user = new applicationuser { username = model.email, email = model.email }; using var context = new myentities()) { using (var transaction = context.database.begintransaction()) { try { var datamodel = new usermaster(); datamodel.gender = model.gender.tostring(); datamodel.name = string.empty; var result = await usermanager.createasync(user, model.password);//doing entry in aspnetuser if transaction fails if (result.succeeded) { ...

How Selnium WebDriver overcomes Same Origin Policy -

how selenium webdriver overcome same origin policy? same origin policy problem in selenium rc first of “same origin policy” introduced security reason, , ensures content of site never accessible script site. per policy, code loaded within browser can operate within website’s domain. --------------------------------------------------------------------------------- ---------------------------------------------- what did??? same origin policy prohibits javascript code accessing elements domain different launched. example, html code in www.google.com uses javascript program "testscript.js" . same origin policy allow testscript.js access pages within google.com such google.com/mail, google.com/login, or google.com/signup . however, cannot access pages different sites such yahoo.c...

Eclipse Mars: Import from svn is not found -

Image
i want download/import project svn. option not there in workspace. think need add plugin. please me this. attached screenshot thanks in advance download or install subclipse plugin eclipse market place. after make checkout of project, can link or keep in sync workplace svn through subclipse plugin. tutorial install subclipse in eclipse

ios - Swift "can not increment endIndex" when deleting Japanese characters -

i'm using swift 2.0/xcode 7.0 ios app. i've built japanese ime convert roman characters japanese equivalent. example: typing "a" convert "a" "あ" typing "k" nothing (no match in japanese) until next character typed, example typing "k" "a" result in "か" my problem when try delete japanese character. if there 1 character in text field, delete key/function works expected. however, if there more one, when try delete character, receive can not increment endindex error in following code. var imeinputlength: int = 0 let currentinputvalue: string = txtfldyourresponse.text!.lowercasestring if(currentinputvalue.characters.count==0) { imeinputlength = 0 } let inputstringtokeep: string = currentinputvalue.substringwithrange( range<string.index>(start: currentinputvalue.startindex.advancedby(imeinputlength), end: currentinputvalue.endindex)) let imestringtokeep: string = currentinputval...