Posts

asp.net mvc 4 - Adding SQL Server Express to mvc 4 project -

i new asp.net mvc 4, trying hard connect sql server express database in project. not getting right. have been researching many days. i not able exact steps. please provide me step step procedure connect asp.net mvc 4 project sql server express typically link setup . http://msdn.microsoft.com/en-us/library/ms171890.aspx or http://msdn.microsoft.com/en-us/library/vstudio/ms171890(v=vs.110).aspx cheers

Scala 2 dimensional Array and Arrays -

this question has answer here: how create , use multi-dimensional array in scala? 2 answers i trying write java ode in scala , think need help. problem: java: public static int[][] scorematrix = new int[5][20]; scala: var scorematrix: array[array[int]] = new array[array[int]](5, 20) it's not working, don't know why? error "too many arguments constructor array(_length:int)array[array[int]]" for initializing 5*20 2d int array can use: var scorematrix: array[array[int]] = array.ofdim[int](5, 20) your code doesn't work because array constructor has 1 argument, array length.

c# - Cannot implicitly convert type 'bool' to 'system.threading.tasks.task bool' -

i have error: "cannot implicitly convert type 'bool' 'system.threading.tasks.task bool'" in service implementation code. correct code please. public task<bool> login(string usn, string pwd) { dataclasses1datacontext auth = new dataclasses1datacontext(); var message = p in auth.users p.usrname == usn && p.usrpass == pwd select p; if (message.count() > 0) { return true; } else { return false; } } you need specific whether want operation happen asynchronously or not. as example async operation : public async task<bool> login(string usn, string pwd) { dataclasses1datacontext auth = new dataclasses1datacontext(); var message = await (from p in auth.users p.usrname == usn && p.usrpass == pwd select p); if (message.count() > 0) ...

c - Segmentation fault & core dumped with changing window size -

i make program using ncurses using window(?). there strange problem!! (i use putty) if change window size, deletetree() not working well. if maintain window size, deletetree() working well!! the function of deletetree() max_child = 100 enum day {mon, tue, wed, thu, fri, sat, sun}; enum tree_type {header,day,place,room}; typedef struct _tree { enum tree_type type; union _info info; struct _tree* link[max_child]; } tree; typedef tree* tnode; tnode troot; void deletetree(tnode* twalk) { int i; if (*twalk == null) return; (i=0;i < max_child;i++) { if ((*twalk)->link[i] != null){ deletetree(&(*twalk)->link[i]); (*twalk)->link[i] = null; }else break; } free(*twalk); *twalk = null; } and void deletetree(tnode twalk) { int i; if (twalk == null) return; (i=0;twalk->link[i]!=null;i++) { deletetree(twalk->link[i]); free(twalk-...

uitableview - create a UITableViewController programmatically in Swift -

i'm trying to, title say, set uitableviewcontroller programmatically. after few hours of trying hope can me. and, yes, hve checked out other posts on matter: import uikit class mainviewcontroller: uitableviewcontroller { init(style: uitableviewstyle) { super.init(style: style) // custom initialization } override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } // #pragma mark - table view data source override func numberofsectionsintableview(tableview: uitableview?) -> int { return 1 } override func tableview(tableview: uitableview?, numberofrowsinsection section: int) -> int { return 5 } override func tableview(tableview: uitableview?, cellforrowatindexpath indexpath: nsindexpath?) -> uitableviewcell? { var cell = tableview?.dequeuereusab...

PHP $_GET not giving me required result -

i writing php code in adobe dreamweaver. code shown below. expecting code output 2 boxes, write something. , when click on submit button, expect see 2 separate things entered box concatenated. i'm not getting concatenation. in fact, nothing happens when click on submit. confused. code not should using dreamweaver for? relatively new php , not understand bits. suspicion dreamweaver not recognize "twofieldform.php". can please tell me how can overcome issue? <!doctype html> <html> <head> </head> <body> <h1>form filler</h1> <?php function joined($s1, $s2) { return array($s1.$s2, strlen($s1.$s2)); } $first = $_get[fieldone]; $second = $_get[fieldtwo]; $answer = joined($first, $second); echo "the concatenated string \"{$answer[0]}\" , length \"{$answer[1]}\"; ?> <form action = "twofieldform.php" method = "get"> fi...

Compile error with `let` in Swift switch statements -

in swift, can slice of array using range operator, this: let list: string[] = ["first", "middle", "last"] let cdr = list[1..list.endindex] assert(cdr == ["middle", "last"]) i'm trying same thing in recursive function takes string[] parameter, not having luck: func last(xs: string[]) -> string? { switch xs { case let (singleitemlist) singleitemlist.endindex == 1: return singleitemlist[0] case let(multiitemlist) multiitemlist.endindex > 1: let cdr: string[] = multiitemlist[1..multiitemlist.endindex] // compilation error! return last(cdr) default: return nil // empty list } } last(["first", "middle", "last"]) last(["last"]) last([]) the middle case statement doesn't compile. fails error: playground execution failed: error: <repl>:14:29: error: not find overload 'subscript' accepts supplied arguments ...