Posts

Showing posts from January, 2012

IdentityServer3 with EF support and Asp.NEt Identity -

i planning use identityserver3 identityserver3.entityframework clients,scopes , operationaldata. , want configure user store using identityserver3.aspnetidentity what recommendation here? okay have single database clients, scopes, operational data , asp.net identity? there issue ef migration if have asp.net identity tables in same database? or should create seprate database 1 identityserver3.entityframework , asp.net identity? i want configure users per client, not sure supported identityserver3 i not know if there issue combining database did 2 databases working. in case not using migrations , using modified ef datastore users info. not recall exact details did have mess of configuration working. right see scopes , clients working me, roles created own authorize attribute solve "what kind of token has roles" thing never understood way. experience has been 1 of trail , error seems there no 1 simple path in making oauth / oidc work. not fault of identit

how can i access the elements of array which is located in a value of associative array in php -

i have array holds data returned sql query $user = $stmt->fetch(pdo::fetch_assoc); $user["username"] = "username1"; $user["password"] = "password1"; i have associative array $user array saved value of key: return array("invalid credentials:"=>"false", "credentials"=>$user); my question how can access values($user) of "credentials" key have tried $user["credentials"] => "username"; not work you can access value of multidimentional array stacking keys in brackets; so if function returned array you've created $arr $arr = somefunction(); // whatever function you're calling named $username = $arr['credentials']['username']; hope helps.

ios - Hit json url link to check any new data after a certain time in objective c -

i need hit json url every 1 week check new data.i tried way. first take lunching time in milisecond , save in plist, - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { long currenttime = (long)(nstimeinterval)([[nsdate date] timeintervalsince1970]); nsdictionary * dict =[nsmutabledictionary new]; paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); documentsdirectory = [paths objectatindex:0]; path = [documentsdirectory stringbyappendingpathcomponent:@"time.plist"]; [dict setvalue:[nsnumber numberwithlong:currenttime] forkey:@"count"]; [dict writetofile:path atomically:yes]; } then check in background .if 7 days gone,i fire timer hit json url. - (void)applicationdidenterbackground:(uiapplication *)application { paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); documentsdirectory = [paths objec

java - Retrieve query execution plan text from a MSSQL server using JDBC -

i have following java method returning statement itself. how can retrieve mssql query execution plan text using jdbc? public string explainstatementmssql(string sqlstatement) { connection connection = null; statement statement = null; resultset rs = null; stringbuilder output = new stringbuilder(); try { connection = utilities.getconnection(); connection.setautocommit(false); statement = connection.createstatement(); statement.execute("set showplan_text on"); statement.executequery(sqlstatement); rs = statement.getresultset(); while (rs.next()) { output.append(rs.getstring(1)).append("\n"); } statement.execute("set showplan_text off"); connection.commit(); } catch (exception e) { e.printstacktrace(); } { utilities.close(rs, statement, connection); } return output.tostring(); } environment: java -version java version "

jquery - How do i stop duplicate entrys on a modal dialog -

what best way avoid user entering same record twice. have following in plugin jquery(document).ready(function(){ jquery("#submit").click(function(){ var points = jquery("#points]").val(); jquery.ajax({ type: 'post', url: myajax.ajaxurl, data: {"action": "updateredeempoints", "points":points}, success: function(data){ alert(data); } }); }); my function posting want stop inserting db twice should produce friendly looking message box javascript default or possible use bootstrap notifications this. wp_localize_script( 'gogreen', 'myajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php'))); function updateredeempoints(){ $userid = get_current_user_id(); $mykey = 'player_id'; $single = true; $playerid = get_user_meta( $userid, $mykey, $single ); $points=$_post['points'];

c# - Using AppDomainSetup.ShadowCopyDirectories in IIS -

i've got ton of dlls used website. of them never change, change 1 of them. every time site down 5 minutes while iis restarts. i'd reduce this. i've read shadow copying being slow when have lot of dll files i'd disable in cases, want use on modified dll can change without having stop iis. the documentation on shadow copying seems presume setting before appdomain created, iis handles creation of appdomain don't know how use appdomainsetup.shadowcopydirectories property tell not shadow copying in main /bin folder , shadow copy things in /bin/changesfrequently folder. can set in web.config somehow? there way run c# code in iis before shadowcopy process starts?

html - Uneven table cells when changing display none -

i having trouble html tables when hide , show rows using javascript (display:block). need hide rows through javascript when re-show rows, find table grid layout lost , hidden row collapsed left side of grid. my sandbox code follows: <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> table { } .rowa { background-color: #70cdb3; } .rowb { background-color: #fff1dc; } .rowc { background-color: #edc7ff; } .cell { border: solid 3pt white; width:25%; } { cursor: pointer; } </style> <script type='text/javascript'> function hide(elemid) { var elem=document.getelementbyid(elemid); elem.style.display='none'; } function show(elemid) {

c++ - What's the difference between using a.var and a.var() -

just example class a{ public: int a; }; int main(){ test; int b = test.a; int c = test.a(); } my question when accessing member variable of class, there difference between using test.a , test.a() ? here test.a() call a function whereas test.a access object's public variable, both different things. also, syntax incorrect should class instead of class .

c++ - Why not have access to the element? -

Image
here code: #import "c:\...\.....\....tlb" using namespace std; int main() { hresult hr = coinitialize(null); _applicationptr myapp("indesign.application"); documentptr mydoc = myapp->activedocument; swatchesptr myswatches = mydoc->swatches; cout << "number of swatch: " << myswatches->count << endl; // count = 10 swatchptr first_swatch = myswatches->item[1l]; swatchptr second_swatch = myswatches->item[2l]; cout << first_swatch->name; // correctly cout << second_swatch->name; // crash cin.get(); return 0; } why can not access elements? count 10. ideas? the line swatchptr second_swatch = myswatches->item[2l]; compiles, empty. error when accessing second_swatch->name :

android - 'colorButtonNormal' working as on press state -

i customizing button style <style name="custom_button" parent="@android:style/widget.button"> <item name="android:paddingtop">5dp</item> <item name="android:paddingbottom">5dp</item> <item name="android:textallcaps">false</item> <item name="colorbuttonnormal">#f37022</item> <item name="android:textcolor">#ffffff</item> </style> using <button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="prepaid package" style="@style/custom_button"/>` but color on colorbuttonnormal has appears on on press state. what now? i have taken example here. custom background if want customise background depending on state of button: create xml file eg button_custom.xml in res/drawable/ <?xml version=&quo

c# - Adding duplicated values to a BindingList -

when add information bindinglist, gets duplicated... dont how... i have class lists: public videorepository() { videos = new bindinglist<video>(); videosfiltered = new bindinglist<video>(); } public bindinglist<video> videos { get; set; } public bindinglist<video> videosfiltered { get; set; } public void addvideo(video video) { console.writeline("size 1 " + videos.count); videos.add(video); videosfiltered.add(video); console.writeline("size 2 " + videos.count); } when call method addvideo first print shows size 1 0 , second print shows size 2 2 . when using debuger... what problem? drunk? i've noticed both videos , videosfiltered have public setters. way can behavior described if external code (not shown here) sets them 1 , same bindinglist<video> instance. you'd better remove public setters. or, modify code follows public void addvideo(video video) { console.writeli

python - Getting an error when trying to create/check for a new directory -

i have code meant to: create new directory; ask user enter text put in file; create file; join file name , path , write text translated file. when run code below with open(new_file, 'a') f: typeerror: invalid file: <_io.textiowrapper name='c:\\downloads\\encrypted messages\\hi' mode='w' encoding='cp1252'> import os import os.path import errno translated = str(input("please enter text")) encpath = r'c:\downloads\encrypted messages' def make_sure_path_exists(encpath): try: os.makedirs(encpath) except oserror exception: if exception.errno != errno.eexist: raise name = str(input("please enter name of file ")) fullpath = os.path.join(encpath, name) new_file = open(fullpath, 'w') open(new_file, 'a') f: f.write(translated + '\n') i have tried import os import os.path import errno translated = "hello world" encpath = r'c:\downloads

C return null if read 0 is empty -

how verify if standard input empty in c ? have project school , allowed use malloc, write, read , free, solutions find on web use functions not allowed use. read works except when don't put in input. here code : char *ft_get_buffer(void) { char buf[10]; int ret; int count; char *result; count = 0; result = ""; while (1) { ret = read(0, buf, 10); count += ret; if (ret < 10) { buf[ret] = '\0'; result = ft_ralloc(buf, result, count); break ; } else result = ft_ralloc(buf, result, count); } return (result); } echo "test" | ./mybinary // works fine echo ./mybinary // infinite loop read() block unless encountering eof or signal event occurs. so code 'sit' on read() until 1 of 4 things happens: the reque

java - Cannot comprehend Output Of The Program -

import java.util.scanner; public class asdf { public static void main(){ string temp = "165"; int ch = temp.charat(0); int ch1 = temp.charat(1); int ch2 = temp.charat(2); system.out.println(ch); system.out.println(ch1); system.out.println(ch2); } } output: 49 54 53 i cannot understand output.is implicit cast according character converted number . appreciated. it printing ascii values of digits. 1,6,5. note ascii value of 0 48. so, 49 ascii value of character 1 , on. have here: http://www.asciitable.com/ try actual characters printed instead of ascii values: char ch = temp.charat(0); char ch1 = temp.charat(1); char ch2 = temp.charat(2);

pandas - How to write data to Redshift that is a result of a dataframe created in Python? -

i have dataframe in python. can write data redshift new table? have created db connection redshift , able execute simple sql queries. need write dataframe it. you can use to_sql push data redshift database. i've been able using connection database through sqlalchemy engine. sure set index = false in to_sql call. table created if doesn't exist, , can specify if want call replace table, append table, or fail if table exists. from sqlalchemy import create_engine import pandas pd conn = create_engine('postgresql://username:password@yoururl.com:5439/yourdatabase') df = pd.dataframe([{'a': 'foo', 'b': 'green', 'c': 11},{'a':'bar', 'b':'blue', 'c': 20}]) df.to_sql('your_table', conn, index = false, if_exists = 'replace') note may need pip install psycopg2 in order connect redshift through sqlalchemy. to_sql documentation

javascript - pass {...this.state} with {this.props.children} -

hi , time. i see tutorial lynda.com react.js. but, used old version of react. code: render: function(){ return ( <div> <header title={this.state.title} status={this.state.status}/> <routehandler {...this.state} /> </div> ) } but use new version of react 15.2.1 , react-router 2.5.2. , don't know how pass {...this.state} {this.props.children} render: function(){ return ( <div> <header title={this.state.title} status={this.state.status}/> {this.props.children} </div> ) } thank you, everyone in order pass props {this.props.children} , can use react.cloneelement .the resulting element have original element's props new props merged in shallowly. render: function(){ return ( <div> <header title={this.state.title} status={this.state.status}/> {react.cloneelement(this.props.children,this.state)} </div>

javascript - How do I make an image act as a upload file button -

i want make image act button when pressed allows me upload image. what have right part in snippet want make pull image server act button , run ajax not have reload page display image chosen (the previous image should change 1 chosen). .uploadbtn { position: relative; overflow: hidden; padding: 10px 20px; text-transform: uppercase; color: #fff; background: #000066; -webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; width: 100px; text-align: center; cursor: pointer; } .uploadbtn .input-upload { position: absolute; top: 0; right: 0; margin: 0; padding: 0; opacity: 0; height: 100%; width: 100%; } <div class="uploadbtn"> <input type="file" class="input-upload" /> <span>image</span> </div> <input type="image" src="image.jpg" /> this s

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

looking through primefaces code in app noticed following line: <f:facet name="header">#{trainsearch.traincount} trains</f:facet> it looks overriding header, makes sense, can explain me in little more detail? what happening line of code? complete code listed below: <p:datatable id = "results" value = "#{trainsearch.trains}" var = "train" rendered="#{not empty trainsearch.trains}" styleclass = "train-search-table horizontal-border"> <f:facet name="header">#{trainsearch.traincount} trains</f:facet> <p:column headertext = "train id"> <p:panelgrid columns="1" styleclass = "train-id-grid" layout = "grid"> <h:outputtext styleclass = "train-id-label" value="#{train.traini}"/> <h:outputtex

java - Is my clojure code being AOT compiled? -

i have maven project mix java , clojure code of clojure-maven-plugin. i have clojure namespace this: (ns org.myproject.clojure (:gen-class)) (defn do-stuff [] (println "doing stuff")) and java, call like: ifn require = clojure.var("clojure.core", "require"); require.invoke(clojure.read("org.myproject.clojure")); ifn do_stuff = clojure.var("org.myproject.clojure", "do-stuff"); do_stuff.invoke(); when running code, "doing stuff" correctly being printed screen. moreover, can see .class files clojure code inside generated jar maven. despite that, i'm still not sure what's clojure doing when require namespace. compiling whole thing on again? or code being aot compiled setup? finally, there way can treat clojure code "regular" java functions? is, importing org.myproject.clojure , calling do-stuff regular function? given clojure generating bytecode code. don't see why java couldn&#

How to configure Spring Session Redis redisNamespace at runtime -

Image
i'm using spring boot 1.3.6 , spring session , redis session store. need able set redisnamespace application runtime, , not hard-code in code. means cannot use @enableredishttpsession since not can set via applaction.yml file. i've updated spring session 1.2.1.release support need, cannot seem system configure namespace via configuration. tried using spel in @enableredishttpsession(redisnamespace) call, doesn't work. tried have redishttpsessionconfiguration injected via autowired set well, , seemed have been ignored. there reference in post using spring.session.redis.namespace property in application.yml doesn't work. any suggestions/tips appreciated! i put -dspring.session.redis.namespace=mykeyname vm arguments. , working fine. and i'm using spring boot v1.3.5.release , spring session 1.2.0.release.

Getting the value from command line input, command-line-args NPM module, node.js/javascript -

i use code add -find flag, can't find how value in useable variable. const commandlineargs = require('command-line-args') const quicksearch = [ {name: 'find', alias: 'f',type: string} ] i'd achieve in terminal, -find=github, use value of find flag, in useable variable, can emit server, i've read docs theres nothing it. run @ command-promt/bash like: node test.js -f github or node test.js --find github or node test.js --find=github expect output: { find: 'github' } server/javascript file ( test.js ): var commandlineargs = require('command-line-args') const optiondefinitions = [ { name: 'find', alias: 'f', type: string } ] const options = commandlineargs(optiondefinitions) console.log(options); //options.find equal 'github'

c - How to use scanf with 3 integers and '/' between them -

i have started learning c language while ago. let's want add birth date, month , year of random person. user types date, month , year in program. want displayed this! birthday: 20/12/1987 example not printf! want done scanf! problem how add '/' displayed in scanf display in program. note: date, month , year integers thank you it's not difficult. try asked: for [integer]/[integer]/[integer] format, try this: int day, month, year; scanf("%d/%d/%d", &day, &month, &year);

networking - intermittent ping failures even though host device has valid IP address -

i using ping command in cpp code , application use code determine whether particular device in network connected or disconnected based on ping response. sending below parameters ping command datablocksize [56] packetcount [1] timeout [1] host [ip address]. for 1 of devices intermittently ping failing , getting packets received 0. intermittent (some times ping success & times failure in span of seconds). not sure why ping failing though device has valid ip. can 1 please let me know reasons of ping command failure though device connected , has valid ip. if connection type matters, device connected through wifi. often, network congestion. icmp, ping uses, low priority traffic, , first dropped in event there congestion on network. also, host being pinged busy respond. should check logs , interfaces of network devices in path see if there congestion.

javascript - setTimeout doesn't work as expected -

Image
in application loading user posts using ajax scroll down feature. the loop iteration takes time, browser freezes until results displayed. implemented settimeout method fix that, reason flow doesn't go inside settimeout method on debugging. also page blank, data not rendered. success : function(responsejson) { $("#loadingdata").toggle(); enablescrolling(); if($.isemptyobject(responsejson)){ $("#nomoreposts").toggle(); disablescrolling(); paginationcomplete=true; } $.each(responsejson, function (index) { (function(index) { settimeout(function(index) { //the flow doesn't move inside var resp_json=responsejson[index]; var dateobj=resp_json.postcreationtime; resp_json.postcreationtime = moment(dateobj).format("h:mm a, ddd, mmm yy"); var timeago = moment(dateobj).fromnow(); re

PHP for loop puzzle -

i have question. trying learn php , told me doing "star" exercises way learn loops. got pretty far myself stuck. here code ; for ($row = 0; $row < 11; $row++) { for($y = 0; $y < 1; $y++){ echo "y"; } for($o = 0; $o < 5; $o++){ echo "o"; } if ($o <=5) { echo "</br>"; } } im trying print following browser ; y o o o o o o y o o o o o o y o o o o o o y o o o o o o y o o o o o o y o o o o y o o o o y o o o o y o o o o y o o o o y o o o o o i hope able assist me! thanks in advance! $n=11; ($row = 0; $row < $n-1; $row++) { for($line=0; $line < $n;$line++){ if ($row==$line) { echo 'y'; } else echo 'o';} echo '</br>'; } ($row = $n-1; $row > 0; $row--) { for($line=0; $line < $n;$line++){ if ($row==$line) { echo 'y'; } else echo 'o';} echo '</br>'; }

dji sdk - Accessing remote controller signal strength in Mobile SDK -

i'm trying develop ios app using dji mobile sdk interact phantom 4. i'd app display signal strength of remote controller in sdk (as displayed in dji go app). djircinfo class contains signalquality field corresponds signal quality of connected master or slave remote controller, phantom 4 apparently doesn't support master/slave mode (the ismasterslavemodesupported returns false ). how go accessing rc's signal strength? djiairlink object represents link between aircraft , remote controller. there delegate method -lbairlink:didupdateremotecontrollersignalinformation: that give signal strength light bridge based links.

Python : Most efficient way to get list of combinations? -

i have dictionary : diff_params = {0: [a, b], 1: [c, d]} each key setting_name, , each value specific setting. able make list like: [[a, c], [a, d], [b, c], [b, d]] i can't figure out how cleanly when have 3 or 4 or 5 settings , each setting has several options. it seems more looking itertools.product() can used unpacking : from itertools import product result = product(*diff_params.values()) you may need cast result if want list of list (surrounding list useless if using python 2 because map() return list): result = list(map(list, result))

powershell - Limiting text box entry to numbers or numpad only - no special characters -

i have small program accepts integer , converts datetime . however, try use keycode allow numbers both keyboard , numpad, , eliminate special characters , letters. code allowing shift + num enter special characters. how eliminate them being entered? $fromdatetext.add_keydown({keydown}) $todatetext.add_keydown({keydown}) #textbox function keydown() { if ($fromdatetext.focused -eq $true -or $todatetext.focused -eq $true) { if ($_.keycode -gt 47 -and $_.keycode -lt 58 -or $_.keycode -gt 95 -and $_.keycode -lt 106 -or $_.keycode -eq 8) { $_.suppresskeypress = $false } else { $_.suppresskeypress = $true } } } instead of intercepting keydown event, i'd remove non-digit character textbox every time textchanged event raised: $todatetext.add_textchanged({ # check if text contains non-digits if($tbox.text -match '\d'){ # if so, remove them

java - Automatic logging in Android -

i fan of debug logs (in debug builds), , want make improvements custom logger class. ideally, create base method logs calling class name, method name, , parameter values. for example, have application "myapplication" class "mainactivity", , calling method "foo" parameter "bar". see in logcat: d/myapplication mainactivity foo("bar") is there way of getting information without having pass in of these values manually? i've seen articles referring java supported methods, such java.lang.invoke.methodhandles, haven't found referring android supported methods. expect parameters have passed in, automating class name , method name excellent. calling thread.currentthread().getstacktrace() can stacktraceelement of current thread. can call getclassname() , getmethodname() , getlinenumber() print out class, method , line of code. in code. stacktraceelement ste = thread.currentthread().getstacktrace()[0]; string msg

Vue.js How to bind an element of the data array to a child components property? -

i using vue-tables show tabular data. trying extend vue-tables make cells in columns editable. therefore created vuejs child component called "editable-cell" able edit cell content. child component inserted vue-tables template editable column. these vue-tables options: headings: { title: 'title', description: 'description', createdby: 'created by', createdat: 'created at', updatedat: 'updated at', }, compiletemplates: true, // compile vue.js logic on templates. templates: { title: function(row) { return '<editable-cell row-id="'+row._id.$oid+'" key="title" value="'+row.title+'"></editable-cell>' }, currently passing plain string value of row.title down child component. my problem: when updated, data in parent component not changed. know two-way bi

c - TimeComplexity of the the following merging k linked lists -

http://www.geeksforgeeks.org/merge-k-sorted-linked-lists/ with reference link: how divide , conquer strategy gives o(nk log k) complexity please explain. also,i have coded same in little bit different way. difference being in pattern of merging. merge first 2 linked result , result other linked list. what complexity of this? node * mergek(){ int n; puts("enter number of linked list want enter"); scanf("%d",&n); node ** arr=malloc(sizeof(node *)*n); int i=0; for(i=0;i<n;i++){ arr[i] = takeinput(); } for(i=0;i<n;i++){ print(arr[i]); } node * temp=null; for(i=0;i<n;i++){ if(i==0){ temp=merge(arr[i],arr[i+1]); i=i+1; } else{ temp=merge(arr[i],temp); } } return temp; } i wanted know if have same complexity or no e. o(nklog(k)) complexity. the number of merges remain same. while number of me

php - Pimcore: How to override built-in controller -

i attempting extend bulk object import functionality in pimcore restrict users fields have available them in custom layout. the file need override pimcore/modules/admin/controllers/objectcontroller.php and believe method need extend is: public function importgetfileinfoaction() { $success = true; $supportedfieldtypes = ["checkbox", "country", "date", "datetime", "href", "image", "input", "language", "table", "multiselect", "numeric", "password", "select", "slider", "textarea", "wysiwyg", "objects", "multihref", "geopoint", "geopolygon", "geobounds", "link", "user", "email", "gender", "firstname", "lastname", "newsletteractive", "newsletterconfirmed", "countrymultiselect",

c# - Authenticate SignalR from MVC Controller -

i learning asp.net identity , signalr among other stuff. able create own authentication system using custom implementation of identity. trying authenticate user signalr before calling overridden onconnected. after user gets authenticated using cookie authentication, [system.web.mvc.authorize] attribute passes succesfully, while [microsoft.aspnet.signalr] attribute tells me user has not authenticated yet. //this authorize method: [httpget] public actionresult authorize() { authenticationmanager.signin(new claimsidentity(new claimsprincipal(user).claims.toarray(), "bearer")); return new emptyresult(); } //this cookieauthenticationoptions app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/account/login"), provider = new cookieauthenticationprovider() }); //on hub public override task onconnected() { string username = context.user

java - How can I have list of all users logged in my web application -

i use spring-mvc , each use logged in web app create session variable user object containing id , name , others info. session.setattribute("user", user); what want have list of users logged in program. i want list check simultaneous log in because must 1 access account. ps : don't tell me use spring-security because want work mvc interceptor , prehandle() 1) use below code auto-wire servletcontext object in spring mvc @autowired servletcontext context; 2) need collect logged in users set in context. ... public void login(user user) { logins.add(user); } ... public void logout(user user) { logins.remove(user); } if you're storing logged-in users in session already public void sessiondestroyed(httpsessionevent event) { user user = (user) event.getsession().getattribute("user"); if (user != null) { set<user> logins = (set<user>) event.getsession().getservletconte

r - what is a model matrix / design matrix -

i stumbeled upon stats::model.matrix function in r. in description sais create design matrix. gives me weired number of rows, not correspend neither number of observations in data, nor number of parameters in model. what design matrix / model matrix? here how used it: m03b <- glmer(apms ~ prepost + gf + eyefrf + (1|content) + (eyefrf|id), data=mlmdata, family=binomial("logit")) x <- model.matrix(m03b) it gives me 2895x4 matrix. id has 105 levels , content 28, number of rows not make sense me. maybe missing values issue? in regression model, written in matrix-vector form as y = x * b + e, the matrix x design matrix, while y vector of observations on dependent variable, b vector of response coefficients (one each explanatory variable) , e vector containing values of model's error term various observations. in design matrix, each column vector of observations on 1 of explanatory variables. thus, size of x must such n x m matrix , b m x p

java - Regex to find exactly 11 repeating numbers -

my regex: ^(\d)\1{2}.\1{3}.\1{3}-\1{2}$ repetitions aren't allowed: 000.000.000-00 111.111.111-11 222.222.222-22 333.333.333-33 444.444.444-44 555.555.555-55 666.666.666-66 888.888.888-88 999.999.999-99 it's working fine according https://www.regex101.com/ so i'm trying put in java, tried way: ^(\\d)\\1{2}.\\1{3}.\\1{3}-\\1{2}$ , don't want work. my code: if (hasthesamedigits(cpfreplaced)) { msg = "all digits of informed cpf equal."; } public boolean hasthesamedigits(string cpf) { return cpf.matches("^(\\d)\\1{2}\\1{3}\\1{3}\\1{2}$"); } it great if me. this regex should work: ([0-9])\1\1\.\1\1\1\.\1\1\1-\1\1\1 . (note: bloats java string because of escapes: "([0-9])\\1\\1\\.\\1\\1\\1\\.\\1\\1\\1-\\1\\1\\1" .) explanation: ([0-9]) finds digit. \1 finds same digit. , again. , again. , again. \. matches . - matches -

ios - Swift disable hidden property for UIImageView in Cell in UICollectionView -

i using swift 2 xcode 7 beta. rendering uicollectionview cells have image , label in it. image should hidden @ time of viewload. this code: func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell { let cell = collectionview.dequeuereusablecellwithreuseidentifier("contactcell", forindexpath: indexpath) as! contactcell cell.contactname.text = contactsnames[indexpath.row] cell.selectedicon.hidden = true return cell } // selection of item func collectionview(collectionview: uicollectionview, didselectitematindexpath indexpath: nsindexpath) { let cell = collectionview.dequeuereusablecellwithreuseidentifier("contactcell", forindexpath: indexpath) as! contactcell cell.selectedicon.hidden = false } i have tried during loading put in first collectionview method cell.selectedicon.hidden = true , showed items. still interaction didn't work (when click on item, didn&#

php - How to send contact form detail including userEmail on form through codeigniter on web-server not through local-host -

there lots of answer send mail though local-host contact form data , this. when website on server (hostinger) going stuck problem. i want send data of contact form on email , contact form data on email user-email field data not comes in email , if i'm pass email field data on form, it's send email mail not comes in mail account , not show error, , on console show request post successfully. if i'm comment user-email field data every thing going user-email, got nothing on email box. if 1 have idea how pass email value, pleas shear knowledge. tired problem , put 2 days on problem , still have no clue. my code - application/view/email_temp.php - <html style="background:#5d849e;background-size:cover;height:100%;"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body> <div>

javascript - Return different subset of data when clicking checkbox in Meteor -

i trying make simple-todo app given on meteor website. here's code or view complete app on meteorpad : <body> <div class="container"> <header> <h1>todo list</h1> <label class="hide-completed"> <input type="checkbox" checked="{{hidecompleted}}" /> hide completed tasks </label> <form class="new-task"> <input type="text" name="text" placeholder="type add new tasks" /> </form> </header> <ul> {{#each tasks}} {{> task}} {{/each}} </ul> </div> </body> template.body.helpers({ tasks: function() { if (session.get("hidecompleted")) { // if hide completed checked, filter tasks return tasks.find({ checked: { $ne: true

c# - Adding a image element to a webbrowser control page (existing site) -

i'm trying create element image windows forms webbrowser control existing site. want move created element position. have code, doesn't work. private void webbrowser1_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) { webbrowser1.document.getelementbyid("gpu_notice").style = "display:none"; webbrowser1.document.getelementbyid("header").outerhtml = ""; webbrowser1.document.getelementbyid("ads").outerhtml = ""; webbrowser1.document.getelementbyid("the_game").style += "position: absolute; top: 0px; right: 0px;"; htmlelement logo = webbrowser1.document.createelement("logo"); logo.setattribute("src", @"c:\users\susana\documents\projeto haxballk\design\logo hk.png"); webbrowser1.document.body.appendchild(logo); logo.setattribute("float", "right"); }

python - How to loop through multiple cells in Jupyter / iPython Notebook -

this question has answer here: run parts of ipython notebook in loop / different input parameter 1 answer i've got jupyter notebook couple hundred lines of code in it, spread across 30 cells. if want loop through 10 cells in middle (e.g. using loop), how do that? possible, or need merge code in loop 1 cell? the way can see join cells, , put entire thing in for/while loop.

javascript - issue on dropdown li menu -

Image
i have following javascript , following html excerpt code. have element fantasylink id, , want when clicked, li dropdown shows doesn't anything, when run code on console, action. clicked element circled in image. $(document).ready(function () { $('#fantasylink').on('click', function (){ $('body').find('#droplogin').click(); }); }); <li class="dropdown" id="linklogin"> <a id="droplogin" href="#" class="dropdown-toggle" data-toggle="dropdown"><b>login</b> <span class="caret"></span></a> <ul id="login-dp" class="dropdown-menu"> <li> <div class="row"> <div class=&

r - Conditional initial values in shiny UI? -

is there way make initial value of shiny ui input conditional? consider below example using old faithful eruptions app example shiny's homepage i akin having individual observations turned off except when input$n_breaks == 50 ui.r shinyui(bootstrappage( selectinput(inputid = "n_breaks", label = "number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), checkboxinput(inputid = "individual_obs", label = strong("show individual observations"), value = false), checkboxinput(inputid = "density", label = strong("show density estimate"), value = false), plotoutput(outputid = "main_plot", height = "300px"), # display if density shown conditionalpanel(condition = "input.density == true", sliderinput(inputid = "bw_adjust", l

sql - How do databases differ from MATLAB variables? -

i'm used working data (sometimes large amounts of data) matrices or cells in matlab. i'd make switch managing larger datasets through tools sqlite. so here question. how approach conceptual switch matlab variables (again multi-dimensional numerical matrices, cells text entries) database? example, if have 4d matrix in matlab, there way store data directly table? or have like, say, make multiple labelled 2d tables? data in database stored in table? is right think migration of data matlab database like, more or less, reorganization of multidimensional matlab variables set of 2d tables? any experience migrating data matlab environment sql-accessible database helpful. a table not 2d array. 4d 2*2*2*2 array stored {{{{1,2},{3,4}},{{5,6},{7,8}}},{{{9,10},{11,12}},{{13,14},{15,16}}}} ( it's mentioned in manual ). means in database can store 4 coordinates(x,y,z,t) , value. x|y|z|t|value -+-+-+-+----- 1|1|1|1|1 1|1|1|2|2 1|1|2|1|3 ......... now instead of doing

javascript - Div to take entire height of viewport, until scroll to next div -

i have 5 div containers. want render first div entire height of viewport. , on scroll, next div takes on entire height of viewport. how this? html code: <div class="wrapper"> <div id="first-container" > <p> hello </p> </div> <div id="second-container"> <p> hello </p> </div> <div id="third-container"> <p> hello </p> </div> <div id="four-container"> <p> hello </p> </div> <div id="five-container"> <p> hello </p> </div> </div> i found simple css code. works on first div doesn't allow me scroll next div. #first-container{ position: fixed !important; position: absolute; top:0; right:0; bottom:0; left:0; } #second-container{ background-image: url("blue-gra

c# - optional parameters in stored procedure -

i building website using mvc , want save data using stored procedure contains set of parameters. wondering if it's possible set of parameters optional. reason being data gets sent depends on type of account. if user edits account type 1, parameters must sent back, if edit account type 2, 3 parameters sent back. sql parameters: alter procedure web.maint_updateclinic @accountid int ,@isactive bit = 1 ,@accountname varchar(100) = null ,@accountaddress varchar(100) = null ,@city varchar(100) = null ,@state varchar(2) = null ,@zipcode varchar(10) = null ,@phonenumber varchar(20) = null ,@webid int action in controller calling procedure: using (odbcconnection _conn = new odbcconnection("filedsn=c:\\datasources\\rxcard.dsn")) using (odbccommand cmd1 = new odbccommand()) { cmd1.connection = _conn; cmd1.commandtext = "{call web.maint_updateclinic(

complete login form example with AngularJS -

during last week have created complete example web-application demonstrate custom login form implementation angularjs. not easy me because java developer , not have experience in javascript. code works fine. hurray :-) i share solution , happy if have @ , suggest me simplification. please feel free criticize javascript code. in demo application server-side resources (images, html pages , restful api) protected openam. in order avoid mistakes , complicated configuration of protected urls in openam created 2 folders in web application, 1 public content , 1 protected content. the structure of war file (web-app) looks this: web-ui.war |-app | |-components | |-protected <-- protected web folder openam | | |-welcome | | |-welcome.html | |-public | | |-help | | | |-help-general.html | | | |-help-howitworks.html | | |-home | | | |-home.html | | |-log-in | | | |-login.html | | | |-login-controller.js | | |