Posts

vb.net - Visual basic database login: manager and admin logins -

i have code open form if login credentials matches database. dont know how add separate login manager. in database made column yes/no called ismanager , checked 1 of users cant seem if checked , open different form. can please improve code make change? public class login public function login() 'save database file in u:\my documents\visual studio 2008\projects\sequenceselectionrepetition\sequenceselectionrepetition\bin\debug 'right-click sequenceselectionrepetition solution explorer , select add reference 'choose com , choose microsoft activex daba objects 2.5 library dim dbconn new adodb.connection dim users new adodb.recordset dim username string dim userdb string dim passdb string dim userfound boolean dbconn.open("provider = microsoft.ace.oledb.12.0;" & "data source = '" & application.startuppath & "\capsule staff.accdb'") users.open("credentials", dbconn, ado...

vb.net - VB SaveFileDialog returns "No items match your search." for a specific folder filtering for .txt for example -

vb savefiledialog returns "no items match search." specific folder filtering .txt example. open file dialog other applications eg. notepad show .txt files. sorry not posting code, after finding solution can see important. found solution ' not work i.e. dialog returns "no items match search." filedialog1.filter = "" savefiledialog1.filter += "|c/c++|*.cpp;*.c;*.h;*.rc" savefiledialog1.filter += "|csharp|*.cs" savefiledialog1.filter += "|css|*.css" savefiledialog1.filter += "|eruby|*.erb;*.rhtml" savefiledialog1.filter += "|java|*.java" savefiledialog1.filter += "|javascript|*.js" savefiledialog1.filter += "|jsp|*.jsp" ' solves problem, dialog shows files selected file extension(s) savefiledialog1.filter = "" savefiledialog1.filter += "|c/c++ (*.cpp;*.c;*.h;*.rc)|*.cpp;*.c;*.h;*.rc" savefiledialog1.filter += "|csharp (*.cs)|*.cs" savef...

php - All combinations of 2D array with mutual exclusivity -

i have array looks this: $i[0] = ['a', 'b', 'c']; $i[1] = ['d', 'e']; $i[2] = ['a', 'b', 'c']; $i[3] = ['d', 'e']; $i[4] = ['f', 'g', 'h']; i want possible permutations or combinations of array, without using same value twice 2 or more sub-arrays. instance, result a d b e f possible, not a d d f . i have tried basic permutation algorithms, can't wrap head around how modify want. here's i've got currently: function array_permutation(array $a){ $count = array_map('count', $a); $finalsize = 1; foreach ($count $val) { $finalsize *= $val; } $output = []; ($i = 0; $i < $finalsize; $i++) { $output[$i] = []; ($c = 0; $c < count($a); $c++) { $index = ($i + $finalsize) % $count[$c]; array_push($output[$i], $a[$c][$index]); } } return $output; } a simple a...

ruby on rails - How to use variable from link -

i have link reads <a href="<%= user_collections_path(@user, :status => "got") %>">collection</a> and reads <a href="<%= user_collections_path(@user, :status => "want") %>">wantlist</a> they link same view produce different lists. on view page want able alter text depending on if collection or wantlist page. this: <% if :status == 'got' %>collection<% elsif :status == 'want' %>wantlist<% end %> obviously doesn't work after experimentation can't work out how query status passed in link. possible? you should doing this <% if params[:status] == 'got' %>collection <% elsif params[:status] == 'want' %>wantlist <% end %>

jquery - Canvas arrow is not shown in Chrome -

i have drawn arrow in canvas using below code. window.onload = function() { var canvas = document.getelementbyid("arrow"); var context = canvas.getcontext("2d"); context.beginpath(); context.strokestyle = "red"; context.fillstyle = "red"; context.moveto(150, 400); context.lineto(400, 400); context.lineto(375, 375); context.arcto(400, 400, 375, 425, 35); context.lineto(400, 400); context.stroke(); context.fill(); }); but arrow not shown on screen. in html5 spec , canvas element has default coordinate size of 300×150px. if use css resize canvas to, say, 500×500px, canvas coordinates stretched (300, 150) still bottom right of canvas: http://jsfiddle.net/mh4uh/ you need apply canvas width , height property: <canvas id="arrow" width="500" height="500"></canvas> alternatively, can use javascript set width , height match on-...

c - Command terminated when inputting large number -

how come message "command terminated" when try input large number (around 10 million)? program displays whether number prime or not. see code below: #include <stdlib.h> #include <stdio.h> #include <stdbool.h> int main ( int argc, char *argv[] ) { unsigned long long number; bool prime ( unsigned long long ); printf ("enter positive integer greater 1: "); scanf ("%llu", &number ); prime( number ) ? printf ( "%llu prime.\n", number ): printf ( "%llu not prime.\n", number); return exit_success; } bool prime ( unsigned long long number ) { unsigned long long i, j; bool isprime[number + 1]; ( = 2; <= number; i++ ) isprime[i] = true; ( = 2; <= number - 1; i++ ) ( j = 1; i*j <= number; j++ ) isprime[i*j] = false; return isprime[number]; } the problem attempt create array isprime on stack larger available memory. should cre...

How to return multiple values between two dates in excel? -

we have spreadsheet of our employees, , need generate list of employees who's 3 month probation period expire in coming week. in other words, need list automatically display employees records who's 3 month probation period expire in next 7 days. needs array because there multiple records each week, , change every day. column id number, value need return. our data looks this: a b c id name hire date 1234 joe blow february 21, 2014 2345 man chu february 26, 2014 3456 jim hill february 26, 2014 4567 brad chill february 28, 2014 5678 mike grow march 5, 2014 6789 hibs bee march 5, 2014 1230 sarah mean march 7, 2014 i've tried index&match `{=index($a:$a,small(if(and($c:$c">="&(today()-90),$c:$c"<="&(today()-80)),row($c:$c)),row(1:1)),1)} other formulas, it's not working, , can't figure out why. any appreciated, much. driving me crazy! your comme...