Search Results

Search found 283 results on 12 pages for 'benjamin manns'.

Page 7/12 | < Previous Page | 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Quick MySQLi security question

    - by Benjamin Falk
    I have a quick MySQLi security related question... For example, take a look at this code (gets in put from the user, checks it against the database to see if the username/password combination exist): $input['user'] = htmlentities($_POST['username'], ENT_QUOTES); $input['pass'] = htmlentities($_POST['password'], ENT_QUOTES); // query db if ($stmt = $mysqli->prepare("SELECT * FROM members WHERE username=? AND password = ?")) { $stmt->bind_param("ss", $input['user'], md5($input['pass'] . $config['salt'])); $stmt->execute(); $stmt->store_result(); // check if there is a match in the database for the user/password combination if ($stmt->num_rows > 0) {} } In this case, I am using htmlentities() on the form data, and using a MySQLi prepared statement. Do I still need to be using mysql_real_escape_string()?

    Read the article

  • sql query problem

    - by benjamin button
    why this query give me an error:ORA-01790 SELECT TO_CHAR(logical_date,'MM') MONTH FROM logical_date WHERE logical_date_type='B' UNION SELECT TO_CHAR(logical_date,'MM')+1 MONTH FROM logical_date WHERE logical_date_type='B' but when i run them separately,they give the proper output.

    Read the article

  • jQuery multiple running totals

    - by Benjamin Randal
    0I am using jQuery to calculate a running total on multiple textboxes. Just found an awesome response on how to get that working a few days ago, but now I am running into another problem. When using one selector, the total for GetTotal is calculated perfectly. However, when I include the second selector, the totals begin to conflict with one another, and no longer calculate properly. I have been searching for a solution to this for some time now, does anyone have any ideas? Here is the selector i am currently using: function GetTotal(txtBox) { var total = 0; $('input:text').each(function(index, value) { total += parseInt($(value).val() || 0); }); $("#chkTotal").html(total); } My view uses these txt boxes <div class="editor-field"> @Html.TextBox("Field1", String.Empty, new {InputType = "text", id = "field1", onchange = "GetTotal(this)" }) </div> <div class="editor-field"> @Html.TextBox("Field2", String.Empty, new {InputType = "text", id = "field2", onchange = "GetTotal(this)" }) </div> <div> <h3>Total Checked</h3> </div> <div id="chkTotal"></div> Now I am trying to implement another selector which will total two additional editor fields... function GetTotal1(txtBox) { var total1 = 0; $('input:text').each(function (index, value) { total1 += parseInt($(value).val() || 0); }); $("#disTotal").html(total1); } View: <div class="editor-field"> @Html.TextBox("Field3", String.Empty, new {InputType = "text", id = "field3", onchange = "GetTotal1(this)" }) </div> <div class="editor-field"> @Html.TextBox("Field4", String.Empty, new {InputType = "text", id = "field4", onchange = "GetTotal1(this)" }) </div> <div> <h3>Total Distributed</h3> </div> <div id="disTotal"></div>

    Read the article

  • scripting in awk

    - by benjamin button
    I have a text file with contents as below: 1,A,100 2,A,200 3,B,150 4,B,100 5,B,250 i need the output as : A,300 B,500 the logic here is sum of all the 3rd fields whose 2nd field is A and in the same way for B how could we do it using awk?

    Read the article

  • late binding in C

    - by benjamin button
    How can late binding can be achieved in c language? can anybody please provide an example. i think it can be achieved using dlopen and dlsym but i am not sure about it.please correct me if i am wrong!

    Read the article

  • Many DIVs inside parent DIV, CSS height issue

    - by Benjamin
    Hi everyone, I am putting together a dynamic photo gallery and getting stuck trying to place thumbnails. Basically I am trying to place each thumbnail and caption in its own DIV, floated to the left. The thumbnails are working just as I want them to but for some reason the parent DIV refuses to cover the height of the thumbnail area. Here is the CSS I am using.. #galleryBox { width: 650px; background: #fff; margin: auto; padding: 5px; text-align: center; } .item { display: block; margin: 10px; padding: 10px; float: left; background: #353535; min-width: 120px; } .label { display: block; color: #fff; } I have tried height: auto and that hasn't done anything. Here is what I am trying to style: <div id="galleryBox" class="ui-corner-all"> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> <div class="item ui-corner-all"> <img src="http://tapp-essexvfd.org/images/ajax-loader.gif" alt="test"/><br/> <p><span class="label">Testing</span></p> </div> </div> Thanks!

    Read the article

  • Initial text and paperclipped-URL for action in UIActivityViewController & UIActivityItemSource?

    - by Benjamin Kreeger
    Finally been making it through Apple's (rather dismal) documentation on the new UIActivityViewController class and the UIActivityItemSource protocol, and I'm trying to send different data sets to different actions called from the activity view. To simplify things, I'm looking at two things. A Facebook posting action, which should say "Check this out!" and also attach a URL to the post (with that cute little paperclip). A Twitter posting action, which should say "Check this out, with #hashtag!" and also attach that same URL (with the same paperclip). Here's the code I've got implemented right now. - (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType { if ([activityType isEqualToString:UIActivityTypePostToFacebook]) { return @"Check this out!"; } else if ([activityType isEqualToString:UIActivityTypePostToTwitter]) { return @"Check this out, with #hashtag!"; } return @""; } - (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController { return @""; } And then when I set up this activity view controller (it's in the same class), this is what I do. UIActivityViewController *activityView = [[UIActivityViewController alloc] initWithActivityItems:@[self] applicationActivities:nil]; [self presentViewController:activityView animated:YES completion:nil]; My dilemma is how to attach that NSURL object. It's relatively easy when calling the iOS 6 SL-class posting modals; you just call the individual methods to attach a URL or an image. How would I go about doing this here? I'll note that instead of returning NSString objects from -activityViewController:itemForActivityType, if I return just NSURL objects, they show up with that paperclip, with no body text in the post. If I return an array of those two items, nothing shows up at all.

    Read the article

  • Windbg + IDA: calculate an address in a module

    - by Benjamin
    Hi all, I'm debugging remotely a windows XP machine. One of my drivers is loaded at address 0xb2c4c000 up to 0xb2cb9680. Now when I open my driver in IDA, the offset I want to set a breakpoint on is at 00017619. How can I effectively match my IDA address into windbg? I've tried the obvious which is to sum 0xb2c4c000 + 00017619 = 0xB2C635F7 and disassemble that address using the 'u' command in windbg. But the results did not match the assembly in IDA. On the side question: is there a way to cancel a command that is running in windbg? Several times I've ran commands that took ages to process, I would like to be able to cancel them if needed. So I can keep working. Thanks for your time.

    Read the article

  • How can we receive a volume attaching notification

    - by Benjamin
    When a volume is attached to file system, on Windows, the Window explorer detects the volume and refreshes automatically. I wonder the technique. How do an program(include device driver) get the notification? -Of course, it doesn’t mean a polling. I want to get an event(or a message). I would like to get the notification when a network volume(like SMB) is attached. Thanks in advance.

    Read the article

  • Default enum visibility in C++

    - by Benjamin Borden
    I have a class that looks like this: namespace R { class R_Class { enum R_Enum { R_val1, R_val2, R_val3 } private: // some private stuff public: // some public stuff } } I'm performing unit testing using an automated test tool (LDRA). The compiler (GHS) claims that my test harness cannot access the type R::R_Class::R_Enum. I have no trouble accessing the values within a similar class that is defined as such: namespace S { class S_Class { public: enum S_Enum { S_val1, S_val2, S_val3 } } private: // some private stuff public: // some public stuff } Do enums in C++ need to be given explicit visibility directives? If not given any, do they default to private? protected?

    Read the article

  • Export database data to csv from view by date range asp.net mvc3

    - by Benjamin Randal
    I am trying to find a way to export data from my database and save it as a .csv file. Ideally the user will be able to select a date range on a view, which will display the data to be exported, then the user can click an "export to CSV" link. I've done quite a bit of searching and but have not found much specific enough to help me step through the process. Any help would be great. I would like to export data from this database model... { public class InspectionInfo { [Key] public int InspectionId { get; set; } [DisplayName("Date Submitted")] [DataType(DataType.Date)] // [Required] public DateTime Submitted { get; set; } [DataType(DataType.MultilineText)] [MaxLength(1000)] // [Required] public string Comments { get; set; } // [Required] public Contact Contact { get; set; } [ForeignKey("Contact")] public Int32 ContactId { get; set; } [MaxLength(100)] public String OtherContact { get; set; } I have a service for search also, just having difficulty implementing public SearchResults SearchInspections(SearchRequest request) { using (var db = new InspectionEntities()) { var results = db.InspectionInfos .Where( i=> ( (null == request.StartDate || i.Submitted >= request.StartDate.Value) && (null == request.EndDate || i.Submitted <= request.EndDate.Value) ) ) .OrderBy(i=>i.Submitted) .Skip(request.PageSize*request.PageIndex).Take(request.PageSize); return new SearchResults{ TotalResults=results.Count(), PageIndex=request.PageIndex, Inspections=results.ToList(), SearchRequest=request }; } }

    Read the article

  • Reading text files line by line, with exact offset/position reporting

    - by Benjamin Podszun
    Hi. My simple requirement: Reading a huge ( a million) line test file (For this example assume it's a CSV of some sorts) and keeping a reference to the beginning of that line for faster lookup in the future (read a line, starting at X). I tried the naive and easy way first, using a StreamWriter and accessing the underlying BaseStream.Position. Unfortunately that doesn't work as I intended: Given a file containing the following Foo Bar Baz Bla Fasel and this very simple code using (var sr = new StreamReader(@"C:\Temp\LineTest.txt")) { string line; long pos = sr.BaseStream.Position; while ((line = sr.ReadLine()) != null) { Console.Write("{0:d3} ", pos); Console.WriteLine(line); pos = sr.BaseStream.Position; } } the output is: 000 Foo 025 Bar 025 Baz 025 Bla 025 Fasel I can imagine that the stream is trying to be helpful/efficient and probably reads in (big) chunks whenever new data is necessary. For me this is bad.. The question, finally: Any way to get the (byte, char) offset while reading a file line by line without using a basic Stream and messing with \r \n \r\n and string encoding etc. manually? Not a big deal, really, I just don't like to build things that might exist already..

    Read the article

  • activate RTTI in c++

    - by benjamin button
    Hi, Can anybody tell me how to activate RTTI in c++ when working on unix. I heard that it can be disabled and enabled. on my unix environment,how could i check whether RTTI is enabled or disabled?

    Read the article

  • confusing fork system call

    - by benjamin button
    Hi, i was just checking the behaviour of fork system call and i found it very confusing. i saw in a website that Unix will make an exact copy of the parent's address space and give it to the child. Therefore, the parent and child processes have separate address spaces #include <stdio.h> #include <sys/types.h> int main(void) { pid_t pid; char y='Y'; char *ptr; ptr=&y; pid = fork(); if (pid == 0) { y='Z'; printf(" *** Child process ***\n"); printf(" Address is %p\n",ptr); printf(" char value is %c\n",y); sleep(5); } else { sleep(5); printf("\n ***parent process ***\n",&y); printf(" Address is %p\n",ptr); printf(" char value is %c\n",y); } } the output of the above program is : *** Child process *** Address is 69002894 char value is Z ***parent process *** Address is 69002894 char value is Y so from the above mentioned statement it seems that child and parent have separet address spaces.this is the reason why char value is printed separately and why am i seeing the address of the variable as same in both child and parent processes.? Please help me understand this!

    Read the article

  • Scala and HttpClient: How do I resolve this error?

    - by Benjamin Metz
    I'm using scala with Apache HttpClient, and working through examples. I'm getting the following error: /Users/benjaminmetz/IdeaProjects/JakartaCapOne/src/JakExamp.scala Error:Error:line (16)error: overloaded method value execute with alternatives (org.apache.http.HttpHost,org.apache.http.HttpRequest)org.apache.http.HttpResponse <and> (org.apache.http.client.methods.HttpUriRequest,org.apache.http.protocol.HttpContext)org.apache.http.HttpResponse cannot be applied to (org.apache.http.client.methods.HttpGet,org.apache.http.client.ResponseHandler[String]) val responseBody = httpclient.execute(httpget, responseHandler) Here is the code with the error and line in question highlighted: import org.apache.http.client.ResponseHandler import org.apache.http.client.HttpClient import org.apache.http.client.methods.HttpGet import org.apache.http.impl.client.BasicResponseHandler import org.apache.http.impl.client.DefaultHttpClient object JakExamp { def main(args : Array[String]) : Unit = { val httpclient: HttpClient = new DefaultHttpClient val httpget: HttpGet = new HttpGet("www.google.com") println("executing request..." + httpget.getURI) val responseHandler: ResponseHandler[String] = new BasicResponseHandler val responseBody = httpclient.execute(httpget, responseHandler) // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ println(responseBody) client.getConnectionManager.shutdown } } I can successfully run the example in java...

    Read the article

  • UIView Login screen to tabbar logic

    - by Benjamin De Bos
    Folks, i'm having trouble with some navigation logic. Currently i have a simple two tabbed tabbar application. But i want to show a loginscreen in front. So that would be an UIView. Currently the code is as follows: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIViewController *viewController1 = [[roosterViewController alloc] initWithNibName:@"roosterViewController" bundle:nil]; UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.viewControllers = @[viewController1, viewController2]; self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; return YES; } SO this pushes a simple tabcontroller. Well, now i want to have a login screen. So that would be a simple UIView which pushes the tabbar controller. But i can't seem to see the logic on how to do this. I've been trying to present a modal view controller, but the thing is: the tabbar will be loaded on the background. Since i need the username/password information to work on the tabbarview, this won't work. My Logic would be: delegate load loginViewController load tabbar controller But, then i need to be able to "logout". So i need to destroy the tabbar controller and present the login screen. Any thoughts on this?

    Read the article

  • MySQLi Prepared Statement Query Issue

    - by Benjamin Flak
    I'm relatively new to MySQLi prepared statements, and running into an error. Take this code: $user = 'admin'; $pass = 'admin'; if ($stmt = $mysqli->query("SELECT * FROM members WHERE username='$user' AND password='$pass'")) { echo $stmt->num_rows; } This will display "1", as it should. This next piece of code though, returns "0": $user = 'admin'; $pass = 'admin'; if ($stmt = $mysqli->prepare("SELECT * FROM members WHERE username=? AND password=?")) { $stmt->bind_param("ss", $user, $pass); $stmt->execute(); echo $stmt->num_rows; } Any ideas why?

    Read the article

  • Freeing memory twice

    - by benjamin button
    Hi, AFAIK, freeing a NULL pointer will result in nothing. I mean nothing is being done by the compiler/no functionality is performed. Still, I do see some statements where people say that one of the scenarios where memory corruption can occur is "freeing memory twice"? Is this still true?

    Read the article

  • Should I upgrade to Intellij Ultimate Edition?

    - by Benjamin Metz
    I am working in java and primarily Scala. I'm using the community edition of Intellij. I'm curious if its worth it to upgrade to the Ultimate Edition? I've been back and forth with Intellij and Eclipse... and for Scala dev I like Intellij a little bit better (for now). Thanks in advance...

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12  | Next Page >