15,885,767 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by onelopez (Top 31 by date)
onelopez
16-Jun-17 22:53pm
View
Looks good, if you are trying to keep this simple, start using a switch statement with possible states of the elevator. Once inside the case statements perform logic desired for that state. Elevator loading people, then let that state change to the next state, moving to desired floor.
onelopez
13-Nov-15 0:59am
View
can't use the actionlink when using angular's routing. you have to use angular's routing mechanism to change the ui
onelopez
27-Oct-15 14:10pm
View
if these files aren't updated as often, might want to put their contents in a database and then query against said database. it would be a lot faster to search 5000 records in db than it is to open each file and look at the string content.
onelopez
16-Feb-15 7:59am
View
Also, if this doesn't work, try refreshing the browser.
onelopez
20-Nov-14 10:11am
View
Not sure what you mean with your statement of automatically firing function calls. How are you going to trigger these calls?
Also, even though you have the functionality wrapped in a directive, ever node/attribute/class/comment to activate a directive makes a new instance of it. So on every page you will have a new instance of it. Unless you do a broadcast to an event for which there's a listener to, pages will have their own behavior.
Also, a service is recommended to house common functionality; unlike a directive, only one instance of a service exists during the lifetime of the application, aka singleton.
onelopez
17-Oct-14 18:11pm
View
You're going to have to have a shared scope then, between the controller on the directive, and the parent controller. No other way around it. If you had stuff in the scope from the directive access it through the attribute instead. Like so:
// pretend this is the link function to the directive
function link( $scope, element, attr ){
attr.$observe ( 'myVar' , function ( ) {
// this function let's you know when variable changes.
// kind of like $scope.$watch but for attributes instead
});
consoloe.log( attr.myVar ); // this contains just a string, no bueno. we need the value
var value = $scope . $eval ( attr. myVar ); // <- We get the actual value of what it's meant to have
// you can use or not use the value.
( $scope.myFunc || $scope.$parent.myFunc ) ( ); // <- myFunc on the scope if for the controller on the directive, myFunc on the parent is the controller who invoked the directive.
}
Let me know if that works.
onelopez
17-Oct-14 9:00am
View
you could create a token form your application and pass it through your licensing web app. if the token is missing then redirect the user back to the main page.
onelopez
15-Oct-14 14:34pm
View
Maybe you want to use a broadcast / emit from the directive and add an event listener to the controllers so that they fire off simultaneously. If you don't have access to the controller, then I'm not sure how to approach this.
On the directive do something like:
$scope.$broadcast('fireOnController', {args:'foo'});
On controller do:
$scop.$on('fireOnController', function(sender, args){
// Do something with args here
});
onelopez
20-Aug-14 21:39pm
View
oh. Might want to look at instead. Not to familiar with this show grant.. hopefully this points you in the right direction
http://dev.mysql.com/doc/refman/5.0/en/show-grants.html
onelopez
6-Aug-14 7:57am
View
You are looking for OCR (Optical character recognition).
onelopez
3-Aug-14 14:48pm
View
Not sure if you would find a book on what you are looking for as a whole, but what I recommend is to look at it in sections. If you break your project down into what it actually is, then you find a lot of help in those specific areas.
Break it down to SQL, WPF, Business logic. Find the POCO objects that best suits your business logic and then implement the database aspect. You can look into various ORM ( database to POCO aspect ) libraries and then build it out from there.
Regardless of where you start, my advice is to start small. Keep it focused and once you have something in place that works and is efficient, build it out.
onelopez
20-Jul-14 21:48pm
View
how did you encode it to begin with? do the opposite. If you encoded the image bytes to base64 then saved it to a text file, I recommend you read back to a memory stream, then decode it from base 64 and you got your original image. that's the logic for base64 encoding... not sure how you encoded your image to the text file.
onelopez
30-Apr-14 22:54pm
View
Look at this SO question regarding your issue. May provide some more insight
http://stackoverflow.com/questions/1382791/asp-net-what-to-do-if-current-session-is-null
onelopez
29-Apr-14 7:19am
View
Is Session null? or a value from Session returning null? If Session is null, then you are requesting it way too early in the ASP.net process; wait until the page load or in the action from mvc. If it's a value in the session that is null, then check your spelling.
onelopez
21-Apr-14 11:42am
View
Reason for my vote of 4 \n extension methods are always executed regardless if the object has been instantiated or not.it's up to the method to determine whether or not to throw the exception. Microsoft extension methods always throw an exception whenever it is invoked and the object is null.
onelopez
10-Apr-14 7:36am
View
VS does not support this feature as it always tends to copy whatever file you give it to the project folder.
The way to support this feature is to create a hardlink copy of your file and then give that copy to VS. Whenever this file gets updated the actual file will be updated.
If the files you are using are being used by other projects, then I suggest creating a dll for those core projects and then reference them in VS. This will save compiler time as VS will not have to compile the core files every single build. Just a thought.
onelopez
13-Sep-13 10:44am
View
Not sure what you are attempting to ask, but you can achieve this through
HttpContext.Current.Session["key"] = "some value. Any object works too";
This can be achieved from anywhere that has reference to System.Web
Or through
Session["key"] = 5; // If you access from a class inheriting from Control / Page / Controller
onelopez
4-Sep-13 14:01pm
View
My suggestion is not to store it in the FormsAuthenticationTicket, instead store that information as a role.
IPrincipal has a function called IsInRole... or something along the lines,
"bool IsInRole(string role)"
the class inheriting from IPrincipal should be able to tell whether or not a user has a "Graduate" role. Thus eliminating the need for the cast
onelopez
26-Aug-13 22:53pm
View
That is true, but before the grouping was done, I retrieved all the data from the customers whose addresses where in those 3 countries. From there the address links back to the customer when you do the join statement again from the tmpview to the address table.
onelopez
26-Aug-13 15:11pm
View
Should look into DB replication services. This will keep bogus records from popping up and accidental data duplication.
onelopez
6-Aug-13 10:27am
View
Take a look at this awesome article here at CP.
http://www.codeproject.com/Articles/17647/Disconnected-Client-Architecture
I didn't write it myself, so cheers to the author, but it's a great place to start.
onelopez
31-Jul-13 12:42pm
View
you can't tell the browser to print content that is not there. you would have to first display the pdf in the browser, then call the print method from javascript or you can have the user download the pdf and then print it from their favorite pdf reader.
onelopez
29-Jul-13 19:05pm
View
Sometimes, depending on the size of the project, it does make sense to abstract common UI components into a stand-alone DLL, in which case it would make sense to know what kind of UI you are servicing.
I do have some common UI components in an external DLL that I use between my Winforms and ASP.NET Mvc, the DLL has some basic behavior that both projects can inherit and implement their own way of doing things.
onelopez
24-Jul-13 0:44am
View
you could try looking into the algorithms used to "package" images together in Css Sprites generator. Not really sure what the term is either, I always search under Css Sprite generator C# and get some decent results.
Perhaps if you find the algorithm you want, then you can apply it to controls as well. But they already must have their size predefined, of course.
onelopez
22-Jul-13 22:08pm
View
I agree with Ron, 11 secs to return 400 records is pretty darn slow. Might want to figure out why it is so slow to begin with, perhaps adding some more additional indexes and what not... but this is besides the point.
From the code you have provided, it seems like you ever only display the last record to the user. Might want to change your sql statement to only pull one record instead of 400. This will definitely provide the speed boost you want.
onelopez
17-May-13 14:32pm
View
Looks like
HERE
is the implementation of OLD_PASSWORD(). SHA1 hasshing is one-way hash, you cannot revert the hashed string to it's clear version. What you could do is use the OLD_PASSWORD implementation and then use SHA1 hashing to compare it with the stored value in the database.
onelopez
17-May-13 14:26pm
View
Have you tried using DisplayMessage instead? All the samples I've seen with SignalR they all had the same matching case as the C# counterpart.
onelopez
17-May-13 14:23pm
View
HTML does not have a "menu strip" per say. What you would need to do is implement a horizontal menu with drop down. Something like this
(horizontal drop down menu @ Codrops)
onelopez
8-Nov-12 14:28pm
View
Not really following what you are attempting to ask.
onelopez
8-Nov-12 9:09am
View
Try deleting the contents inside the
obj
forlder... sometimes it helps clear everything out and then rebuild the solution.
onelopez
1-Nov-12 9:31am
View
Not really sure what you are attempting to ask.
Show More