Search Results

Search found 3046 results on 122 pages for 'tom smith'.

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

  • django + ExtJs - list of example implementations with source code

    - by Tom Tom
    Hi, I want to learn ExtJs http://www.extjs.com/ in combination with Django (I know Django already .. a bit ;-) and I'm on the search of examples I can learn from. I found already this post. Would be great if you post your links to examples here. Maybe we get a nice list of examplary implementations that help users to start with django + ExtJs. Ext js Poll Tutorial Ext js vs. Jquery "Show how you can use extjs to display a table and how to use jqgrid 3.2 to get the same as in extjs. Incluses extjs and jqgird libraries. I have had to patch jqgrid adding" RESTful Web apps with Django, Piston and Ext JS Convert your forms.Form and forms.ModelForm to extjs and handles the form submission like any django form.

    Read the article

  • Django custom managers - how do I return only objects created by the logged-in user?

    - by Tom Tom
    I want to overwrite the custom objects model manager to only return objects a specific user created. Admin users should still return all objects using the objects model manager. Now I have found an approach that could work. They propose to create your own middleware looking like this: #### myproject/middleware/threadlocals.py try: from threading import local except ImportError: # Python 2.3 compatibility from django.utils._threading_local import local _thread_locals = local() def get_current_user(): return getattr(_thread_locals, 'user', None) class ThreadLocals(object): """Middleware that gets various objects from the request object and saves them in thread local storage.""" def process_request(self, request): _thread_locals.user = getattr(request, 'user', None) #### end And in the Custom manager you could call the get_current_user() method to return only objects a specific user created. class UserContactManager(models.Manager): def get_query_set(self): return super(UserContactManager, self).get_query_set().filter(creator=get_current_user()) Is this a good approach to this use-case? Will this work? Or is this like "using a sledgehammer to crack a nut" ? ;-) Just using: Contact.objects.filter(created_by= user) in each view doesn`t look very neat to me. EDIT Do not use this middleware approach !!! use the approach stated by Jack M. below After a while of testing this approach behaved pretty strange and with this approach you mix up a global-state with a current request. Use the approach presented below. It is really easy and no need to hack around with the middleware. create a custom manager in your model with a function that expects the current user or any other user as an input. #in your models.py class HourRecordManager(models.Manager): def for_user(self, user): return self.get_query_set().filter(created_by=user) class HourRecord(models.Model): #Managers objects = HourRecordManager() #in vour view you can call the manager like this and get returned only the objects from the currently logged-in user. hr_set = HourRecord.objects.for_user(request.user)

    Read the article

  • additional security measures besides a login with user-password - what can you think of?

    - by Tom Tom
    I'm wondering which additional security measures one could take besides a traditional login with user and password. What do you think of this one: _manually adding a cookie to each client which includes a secret key _this cookie is not served by the webserver, it is actually copied "by hand" to each client computer _if a client connects to the web-app the server graps that cookie and if the containing secret key is ok, the traditional login box is presented where the user has to enter the user-password combination _communication between client and server is encrypted with https Thus a potential intruder would first need to get the cookie from the clients computer, which is only possible with having access to the clients computer. This would work only for a very small user-base and an admin willing to do this manual work.

    Read the article

  • django return file over HttpResonse - file is not served correctly

    - by Tom Tom
    I want to return some files in a HttpResponse and I'm using the following function. The file that is returned always has a filesize of 1kb and I do not know why. I can open the file, but it seems that it is not served correctly. Thus I wanted to know how one can return files with django/python over a HttpResponse. @login_required def serve_upload_files(request, file_url): import os.path import mimetypes mimetypes.init() try: file_path = settings.UPLOAD_LOCATION + '/' + file_url fsock = open(file_path,"r") #fsock = open(file_path,"r").read() file_name = os.path.basename(file_path) mime_type_guess = mimetypes.guess_type(file_name) try: if mime_type_guess is not None: response = HttpResponse(mimetype=mime_type_guess[0]) response['Content-Disposition'] = 'attachment; filename=' + file_name response.write(fsock) finally: fsock.close() except IOError: response = HttpResponseNotFound() return response

    Read the article

  • django media url is not resolved in 500 internal server error template

    - by Tom Tom
    Hi, I'm using a 500.html template for my app, which is an identical copy of the 404.html with some minor text changes. Interestingly the {{ media_url }} context variable will not be resolved by the server if the 500.html is presented (e.g. when I force an internal server error), resulting in a page without any css loaded. An easy way to circumvent this would be to hardcode the links to the css, but I m just curious why the media_url is not resolved. Probably it is because the server encounters a internal server error and that leads to context variables not any more available!?

    Read the article

  • django custom management command does not show up in production

    - by Tom Tom
    I wrote a custom management command for django. Locally with my dev settings everything works fine. Now I deployed my project onto the production server and the management command does not show up, respectively is not available. But I did not get an error message deploying the project (syncdb). Any ideas where I could try to begin to search? Is there a special command that all custom management commands are "autodiscovered"?

    Read the article

  • serving files using django - is this a security vulnerability

    - by Tom Tom
    I'm using the following code to serve uploaded files from a login secured view in a django app. Do you think that there is a security vulnerability in this code? I'm a bit concerned about that the user could place arbitrary strings in the url after the upload/ and this is directly mapped to the local filesystem. Actually I don't think that it is a vulnerability issue, since the access to the filesystem is restricted to the files in the folder defined with the UPLOAD_LOCATION setting. UPLOAD_LOCATION = is set to a not publicly available folder on the webserver url(r'^upload/(?P<file_url>[/,.,\s,_,\-,\w]+)', 'aeon_infrastructure.views.serve_upload_files', name='project_detail'), @login_required def serve_upload_files(request, file_url): import os.path import mimetypes mimetypes.init() try: file_path = settings.UPLOAD_LOCATION + '/' + file_url fsock = open(file_path,"r") file_name = os.path.basename(file_path) file_size = os.path.getsize(file_path) print "file size is: " + str(file_size) mime_type_guess = mimetypes.guess_type(file_name) if mime_type_guess is not None: response = HttpResponse(fsock, mimetype=mime_type_guess[0]) response['Content-Disposition'] = 'attachment; filename=' + file_name #response.write(file) except IOError: response = HttpResponseNotFound() return response

    Read the article

  • django handling file uploads - target different than media folder

    - by Tom Tom
    Hi, I want to enable the user to upload media which will not be saved in the media folder. When I use the following line of code data will be uploaded to media/upload/logo . logo_img = models.FileField(upload_to='upload/logo', blank=True) I'm wondering how I can change this behaviour. I would try to write a custom FileField and a view that serves the data based on the database entries. I do not want to place the data the user uploads to the media folder, since it is no public data. Is this approach correct? Are there solutions out there which do exactly what I want and I would reinvent the wheel with implementing this by myself? Would appreciate any help!

    Read the article

  • SQL SERVER – Signal Wait Time Introduction with Simple Example – Wait Type – Day 2 of 28

    - by pinaldave
    In this post, let’s delve a bit more in depth regarding wait stats. The very first question: when do the wait stats occur? Here is the simple answer. When SQL Server is executing any task, and if for any reason it has to wait for resources to execute the task, this wait is recorded by SQL Server with the reason for the delay. Later on we can analyze these wait stats to understand the reason the task was delayed and maybe we can eliminate the wait for SQL Server. It is not always possible to remove the wait type 100%, but there are few suggestions that can help. Before we continue learning about wait types and wait stats, we need to understand three important milestones of the query life-cycle. Running - a query which is being executed on a CPU is called a running query. This query is responsible for CPU time. Runnable – a query which is ready to execute and waiting for its turn to run is called a runnable query. This query is responsible for Signal Wait time. (In other words, the query is ready to run but CPU is servicing another query). Suspended – a query which is waiting due to any reason (to know the reason, we are learning wait stats) to be converted to runnable is suspended query. This query is responsible for wait time. (In other words, this is the time we are trying to reduce). In simple words, query execution time is a summation of the query Executing CPU Time (Running) + Query Wait Time (Suspended) + Query Signal Wait Time (Runnable). Again, it may be possible a query goes to all these stats multiple times. Let us try to understand the whole thing with a simple analogy of a taxi and a passenger. Two friends, Tom and Danny, go to the mall together. When they leave the mall, they decide to take a taxi. Tom and Danny both stand in the line waiting for their turn to get into the taxi. This is the Signal Wait Time as they are ready to get into the taxi but the taxis are currently serving other customer and they have to wait for their turn. In other word they are in a runnable state. Now when it is their turn to get into the taxi, the taxi driver informs them he does not take credit cards and only cash is accepted. Neither Tom nor Danny have enough cash, they both cannot get into the vehicle. Tom waits outside in the queue and Danny goes to ATM to fetch the cash. During this time the taxi cannot wait, they have to let other passengers get into the taxi. As Tom and Danny both are outside in the queue, this is the Query Wait Time and they are in the suspended state. They cannot do anything till they get the cash. Once Danny gets the cash, they are both standing in the line again, creating one more Signal Wait Time. This time when their turn comes they can pay the taxi driver in cash and reach their destination. The time taken for the taxi to get from the mall to the destination is running time (CPU time) and the taxi is running. I hope this analogy is bit clear with the wait stats. You can check the Signalwait stats using following query of Glenn Berry. -- Signal Waits for instance SELECT CAST(100.0 * SUM(signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [%signal (cpu) waits], CAST(100.0 * SUM(wait_time_ms - signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [%resource waits] FROM sys.dm_os_wait_stats OPTION (RECOMPILE); Higher the Signal wait stats are not good for the system. Very high value indicates CPU pressure. In my experience, when systems are running smooth and without any glitch the Signal wait stat is lower than 20%. Again, this number can be debated (and it is from my experience and is not documented anywhere). In other words, lower is better and higher is not good for the system. In future articles we will discuss in detail the various wait types and wait stats and their resolution. Read all the post in the Wait Types and Queue series. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL DMV, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Wait Stats, SQL Wait Types, T SQL, Technology

    Read the article

  • SQL SERVER – Single Wait Time Introduction with Simple Example – Wait Type – Day 2 of 28

    - by pinaldave
    In this post, let’s delve a bit more in depth regarding wait stats. The very first question: when do the wait stats occur? Here is the simple answer. When SQL Server is executing any task, and if for any reason it has to wait for resources to execute the task, this wait is recorded by SQL Server with the reason for the delay. Later on we can analyze these wait stats to understand the reason the task was delayed and maybe we can eliminate the wait for SQL Server. It is not always possible to remove the wait type 100%, but there are few suggestions that can help. Before we continue learning about wait types and wait stats, we need to understand three important milestones of the query life-cycle. Running - a query which is being executed on a CPU is called a running query. This query is responsible for CPU time. Runnable – a query which is ready to execute and waiting for its turn to run is called a runnable query. This query is responsible for Single Wait time. (In other words, the query is ready to run but CPU is servicing another query). Suspended – a query which is waiting due to any reason (to know the reason, we are learning wait stats) to be converted to runnable is suspended query. This query is responsible for wait time. (In other words, this is the time we are trying to reduce). In simple words, query execution time is a summation of the query Executing CPU Time (Running) + Query Wait Time (Suspended) + Query Single Wait Time (Runnable). Again, it may be possible a query goes to all these stats multiple times. Let us try to understand the whole thing with a simple analogy of a taxi and a passenger. Two friends, Tom and Danny, go to the mall together. When they leave the mall, they decide to take a taxi. Tom and Danny both stand in the line waiting for their turn to get into the taxi. This is the Signal Wait Time as they are ready to get into the taxi but the taxis are currently serving other customer and they have to wait for their turn. In other word they are in a runnable state. Now when it is their turn to get into the taxi, the taxi driver informs them he does not take credit cards and only cash is accepted. Neither Tom nor Danny have enough cash, they both cannot get into the vehicle. Tom waits outside in the queue and Danny goes to ATM to fetch the cash. During this time the taxi cannot wait, they have to let other passengers get into the taxi. As Tom and Danny both are outside in the queue, this is the Query Wait Time and they are in the suspended state. They cannot do anything till they get the cash. Once Danny gets the cash, they are both standing in the line again, creating one more Single Wait Time. This time when their turn comes they can pay the taxi driver in cash and reach their destination. The time taken for the taxi to get from the mall to the destination is running time (CPU time) and the taxi is running. I hope this analogy is bit clear with the wait stats. You can check the single wait stats using following query of Glenn Berry. -- Signal Waits for instance SELECT CAST(100.0 * SUM(signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [%signal (cpu) waits], CAST(100.0 * SUM(wait_time_ms - signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [%resource waits] FROM sys.dm_os_wait_stats OPTION (RECOMPILE); Higher the single wait stats are not good for the system. Very high value indicates CPU pressure. In my experience, when systems are running smooth and without any glitch the single wait stat is lower than 20%. Again, this number can be debated (and it is from my experience and is not documented anywhere). In other words, lower is better and higher is not good for the system. In future articles we will discuss in detail the various wait types and wait stats and their resolution. Read all the post in the Wait Types and Queue series. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL DMV, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Wait Stats, SQL Wait Types, T SQL, Technology

    Read the article

  • To ref or not to ref

    - by nmarun
    So the question is what is the point of passing a reference type along with the ref keyword? I have an Employee class as below: 1: public class Employee 2: { 3: public string FirstName { get; set; } 4: public string LastName { get; set; } 5:  6: public override string ToString() 7: { 8: return string.Format("{0}-{1}", FirstName, LastName); 9: } 10: } In my calling class, I say: 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(Employee employee) 16: { 17: employee.FirstName = "Smith"; 18: employee.LastName = "Doe"; 19: } 20: }   After having a look at the code, you’ll probably say, Well, an instance of a class gets passed as a reference, so any changes to the instance inside the CallSomeMethod, actually modifies the original object. Hence the output will be ‘John-Doe’ on the first call and ‘Smith-Doe’ on the second. And you’re right: So the question is what’s the use of passing this Employee parameter as a ref? 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(ref employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(ref Employee employee) 16: { 17: employee.FirstName = "Smith"; 18: employee.LastName = "Doe"; 19: } 20: } The output is still the same: Ok, so is there really a need to pass a reference type using the ref keyword? I’ll remove the ‘ref’ keyword and make one more change to the CallSomeMethod method. 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(Employee employee) 16: { 17: employee = new Employee 18: { 19: FirstName = "Smith", 20: LastName = "John" 21: }; 22: } 23: } In line 17 you’ll see I’ve ‘new’d up the incoming Employee parameter and then set its properties to new values. The output tells me that the original instance of the Employee class does not change. Huh? But an instance of a class gets passed by reference, so why did the values not change on the original instance or how do I keep the two instances in-sync all the times? Aah, now here’s the answer. In order to keep the objects in sync, you pass them using the ‘ref’ keyword. 1: class Program 2: { 3: static void Main() 4: { 5: Employee employee = new Employee 6: { 7: FirstName = "John", 8: LastName = "Doe" 9: }; 10: Console.WriteLine(employee); 11: CallSomeMethod(ref employee); 12: Console.WriteLine(employee); 13: } 14:  15: private static void CallSomeMethod(ref Employee employee) 16: { 17: employee = new Employee 18: { 19: FirstName = "Smith", 20: LastName = "John" 21: }; 22: } 23: } Viola! Now, to prove it beyond doubt, I said, let me try with another reference type: string. 1: class Program 2: { 3: static void Main() 4: { 5: string name = "abc"; 6: Console.WriteLine(name); 7: CallSomeMethod(ref name); 8: Console.WriteLine(name); 9: } 10:  11: private static void CallSomeMethod(ref string name) 12: { 13: name = "def"; 14: } 15: } The output was as expected, first ‘abc’ and then ‘def’ - proves the 'ref' keyword works here as well. Now, what if I remove the ‘ref’ keyword? The output should still be the same as the above right, since string is a reference type? 1: class Program 2: { 3: static void Main() 4: { 5: string name = "abc"; 6: Console.WriteLine(name); 7: CallSomeMethod(name); 8: Console.WriteLine(name); 9: } 10:  11: private static void CallSomeMethod(string name) 12: { 13: name = "def"; 14: } 15: } Wrong, the output shows ‘abc’ printed twice. Wait a minute… now how could this be? This is because string is an immutable type. This means that any time you modify an instance of string, new memory address is allocated to the instance. The effect is similar to ‘new’ing up the Employee instance inside the CallSomeMethod in the absence of the ‘ref’ keyword. Verdict: ref key came to the rescue and saved the planet… again!

    Read the article

  • pci-express ssd running an OS

    - by tom
    Hi, Simple question really, is it possible to install an OS such as windows or ubuntu on a PCI-Express SSD (solid state drive)? And if so is it as straight forward as selecting that drive on install? Thanks Tom

    Read the article

  • Replace sound in another YouTube video

    - by Tom
    I have received permission from someone to translate the audio in their movies. The problem I am facing is that the video quality is quite poor and the author does not have the original videos any more. How can I replace the audio in the YouTube videos without further degrading the quality of the videos? Thanks, Tom

    Read the article

  • Setting Manager path in Tomcat6

    - by Tom
    Hi gurus I want to switch context path to Manager app in Tomcat6 http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html I change $CATALINA_BASE/conf/[enginename]/[hostname]/manager.xml to: <Context path="/adm" docBase="${catalina.home}/webapps/manager" privileged="true" antiResourceLocking="false" antiJARLocking="false"> notice to: path="/adm", but manager app is always in /manager. Please, how can I change manager path in Tomcat6? Thanks a lot. Tom

    Read the article

  • How can I disable the css {position:fixed} side-bar on Slashdot?

    - by Tom
    When I look at a story on Slashdot, I see a side-bar that sits constantly in the upper-left corner. Every time I open a story, I have to click on the "slash" sign in its upper-right corner. How can I disable it, so it will always have css position absolute, relative or static? Is there an option for it? Because I find it is slowing my browser down when I am scrolling the page. Thank you, Tom

    Read the article

  • Logon onto shared Windows account using individual passwords?

    - by Tom
    In a networked WinXP environment, I have a computer-controlled device which I want to connect to the network, but allow various people to use. The computer must be left running and logged on at all times. My thought is to run the computer under a "shared account" which would allow each user to logon/unlock the screen using their own network password (i.e., the password for their personal account). Is this possible? Thanks, Tom

    Read the article

  • efficient collision detection - tile based html5/javascript game

    - by Tom Burman
    Im building a basic rpg game and onto collisions/pickups etc now. Its tile based and im using html5 and javascript. i use a 2d array to create my tilemap. Im currently using a switch statement for whatever key has been pressed to move the player, inside the switch statement. I have if statements to stop the player going off the edge of the map and viewport and also if they player is about to land on a tile with tileID 3 then the player stops. Here is the statement: canvas.addEventListener('keydown', function(e) { console.log(e); var key = null; switch (e.which) { case 37: // Left if (playerX > 0) { playerX--; } if(board[playerX][playerY] == 3){ playerX++; } break; case 38: // Up if (playerY > 0) playerY--; if(board[playerX][playerY] == 3){ playerY++; } break; case 39: // Right if (playerX < worldWidth) { playerX++; } if(board[playerX][playerY] == 3){ playerX--; } break; case 40: // Down if (playerY < worldHeight) playerY++; if(board[playerX][playerY] == 3){ playerY--; } break; } viewX = playerX - Math.floor(0.5 * viewWidth); if (viewX < 0) viewX = 0; if (viewX+viewWidth > worldWidth) viewX = worldWidth - viewWidth; viewY = playerY - Math.floor(0.5 * viewHeight); if (viewY < 0) viewY = 0; if (viewY+viewHeight > worldHeight) viewY = worldHeight - viewHeight; }, false); My question is, is there a more efficient way of handling collisions, then loads of if statements for each key? The reason i ask is because i plan on having many items that the player will need to be able to pickup or not walk through like walls cliffs etc. Thanks for your time and help Tom

    Read the article

  • It's Not TV- It's OTN: Top 10 Videos on the OTN YouTube Channel

    - by Bob Rhubart
    It's been a while since we checked in on what people are watching on the Oracle Technology Network YouTube Channel. Here are the Top 10 video for the last 30 days. Tom Kyte: Keeping Up with the Latest in Database Technology Tom Kyte expands on his keynote presentation at the Great Lakes Oracle Conference with tips for developers, DBAs and others who want to make sure they are prepared to work with the latest database technologies. That Jeff Smith: Oracle SQL Developer Oracle SQL Developer product manager Jeff Smith (yeah, that Jeff Smith) talks about his presentations at the Great Lakes Oracle Conference and shares his reaction to keynote speaker C.J. Date's claim that "SQL dropped the ball." Gwen Shapira: Hadoop and Oracle Database Oracle ACE Director Gwen Shapira @gwenshap talks about the fit between Hadoop and Oracle Database and dives into the details of why Oracle Loader for Hadoop is 5x faster. Kai Yu: Virtualization and Cloud Oracle ACE Director Kai Yu talks about the questions he is most frequently asked when he does presentations on cloud computing and virtualization. Mark Sewtz: APEX 4.2 Mobile App Development Application Express developer Marc Sewtz demos the new features he built into APEX4.2 to support Mobile App Development. Jeremy Schneider: RAC Attack Oracle ACE Jeremy Schneider @jer_s describes what you can expect when you come to a RAC (Real Application Cluster) Attack. Frits Hoogland: Exadata Under the Hood Oracle ACE Director Frits Hoogland (@fritshoogland) talks about the secret sauce under Exadata's hood. David Peake: APEX 4.2 New Features David Peake, PM for Oracle Application Express, gives a quick overview of some of the new APEX features. Greg Marsden: Hugepages = Huge Performance on Linux Greg Marsden of Oracle's Linux Kernel Engineering Team talks about some common customer performance questions and making the most of Oracle Linux 6 and Transparent HugePages. John Hurley: NEOOUG and GLOC 2013 Northeast Ohio Oracle User Group president John Hurley talks about the background and success of the 2013 Great Lakes Oracle Conference.

    Read the article

  • cloud/grid computing

    - by tom smith
    Hi guys. I'm appologizing in advance to the guys who will tell me this isn't a tech/server/IT issue! But I've been beating my head around this for a couple of days now. I'm trying figure out who to talk to, or which company I can approach to try to see if there are Grid/Cloud Computing companies who have programs setup to deal with colleges. I'm dealing with a compsci course, and we're looking at a few projects that would require a great deal of computing/computational resources. But in calling different companies (HP/Rackspace/etc..) I'm either not getting through to the right depts, or to the right people, or the companies just aren't setup for this. There are plenty of companies who have discounts for desktop software/hardware, but who in the biz deals with discounts/offerings for Cloud/Grid Computing solutions?? Any thoughts/pointers would be greatly appreciated. Thanks -tom

    Read the article

  • Aggregating Excel cell contents that match a label [migrated]

    - by Josh
    I'm sure this isn't a terribly difficult thing, but it's not the type of question that easily lends itself to internet searches. I've been assigned a project for work involving a complex spreadsheet. I've done the usual =SUM and other basic Excel formulas, and I've got enough coding background that I'm able to at least fudge my way through VBA, but I'm not certain how to proceed with one part of the task. Simple version: On Sheet 1 I have a list of people (one on each row, person's name in column A), on sheet 2 I have a list of groups (one on each row, group name in column A). Each name in Sheet 1 has its own row, and I have a "Data Validation" dropdown menu where you choose the group each person belongs to. That dropdown is sourced from Sheet 2, where each group has a row. So essentially the data validation source for Sheet 1's "Group" column is just "=Sheet2!$a1:a100" or whatever. The problem is this: I want each group row in Sheet 2 to have a formula which results in a list of all the users which have been assigned to that group on Sheet 1. What I mean is something the equivalent of "select * from PeopleTab where GROUP = ThisGroup". The resulting cell would just stick the names together like "Bob Smith, Joe Jones, Sally Sanderson" I've been Googling for hours but I can't think of a way to phrase my search query to get the results I want. Here's an example of desired result (Dash-delimited. Can't find a way to make it look nice, table tags don't seem to work here): (Sheet 1) Bob Smith - Group 1 (selected from dropdown) Joe Jones - Group 2 (selected from dropdown) Sally Sanderson - Group 1 (selected from dropdown) (Sheet 2) Group 1 - Bob Smith, Sally Sanderson (result of formula) Group 2 - Joe Jones (result of formula) What formula (or even what function) do I use on that second column of sheet 2 to make a flat list out of the members of that group?

    Read the article

  • Junit test bluej [closed]

    - by user1721929
    Can someone make a junit test of this? public class PersonName { int NumberNames(String wholename) { // store the name passed in to the method String testname=wholename; // initialize number of names found int numnames=0; // on each iteration remove one name while(testname.length()>numnames) { // take the "white space" from the beginning and end testname = testname.trim(); // determine the position of the first blank // .. end of the first word int posBlank= testname.indexOf(' '); // cut off word /** * it continues to the stop sign because that is where you commanded it to end */ testname=testname.substring(posBlank+1,testname.length()); // System.out.println(numnames); // System.out.println(testname); numnames++; System.out.println(testname); } return numnames; } public static void main(String args[]) { PersonName One= new PersonName(); System.out.println(One.NumberNames("Bobby")); System.out.println(One.NumberNames("Bobby Smith")); System.out.println(One.NumberNames("Bobby L. Smith")); System.out.println(One.NumberNames(" Bobby Paul Smith Jr. ")); } }

    Read the article

  • Syncing contacts to iOS device with Exchange

    - by flackend
    I set up a Microsoft Exchange account on my iOS device to sync my Gmail contacts. But Microsoft Exchange is ignoring phone numbers that are labeled as 'iPhone' or 'main'. For example, John Smith: On Mac and Gmail: John Smith main: 123-334-1212 home: 123-330-1002 work: 123-330-8211 iPhone: 123-778-5556 On iOS device (via Exchange sync): John Smith home: 123-330-1002 work: 123-330-8211 I'd like to sync my contacts from my Mac to iCloud and Gmail, but you can't do both: Is there a solution to sync iOS and Gmail contacts without using Exchange? Thanks for any help!

    Read the article

  • How to handle recurring dates (dates only) in .NET?

    - by Wayne M
    I am trying to figure out a good way to handle recurring events in .NET, specifically for an ASP.NET MVC application. The idea is that a user can create an event and specify that the event can occur repeatedly after a specific interval (e.g. "every two weeks", "once a month" and so on). What would be the best way to tackle this? My brainstorming right now is to have two tables: Job and RecurringJob. Job is the "master" record and has the description of the job as well a key to what customer it's for, while RecurringJob links back to Job and has additional info on what the occurrence frequency is (e.g. 1 for "once a month") as well as the timespan (e.g. "Weekly", "Monthly"). The issue is how to determine and set the next occurrence of the job since this will have to be something that's done regularly. I've seen two trains of thought with this: This logic should either be stored in a database column and periodically updated, or calculated on the fly in the code. Any thoughts or suggestions on tackling this? Edit: this is for a subscription based web app I'm creating to let service businesses schedule their common recurring jobs easily and track their customers. So a typical use might be to create a "Cut lawn" job for Mr Smith that occurs every month The exact date isn't important - it's the ability for the customer to see that Mr Smith gets his lawn cut every month and followup with him about it. Let me rephrase the above to better convey my idea. A sample use case for the application might be as follows: User pulls up the customer record for John Smith and clicks the Add Job link. The user fills out the form to create a job with a name of "Cut lawn", a start date of 11/15/2009, and selects a checkbox indicating that this job continually occurs. The user is presented with a secondary screen asking for the job frequency. The user indicates (haven't decided how at this point - let's assume select lists) that the job occurs once a month. User clicks save. Now, when the user views the record for John Smith, they can see that he has a job, "Cut lawn", that occurs every month starting from 11/15/2009. On the main dashboard when it's one week prior to the assumed start date, the user sees the job displayed with an indicator such as "12/15/2009 - Cut lawn (John Smith)". A week before the due date someone from the company calls him up to schedule and he says he's going to be out of town until 1/1/2010, so he wants his appointment rescheduled for that date. Our user can change the date for the job to be 1/1/2010, and now the recurrence will start one month from that date (e.g. next time will be 2/1/2010). The idea behind this is that the app is targeting businesses like lawn care, plumbers, carpet cleaners and the like where the exact date isn't as important (because it can and will change as people are busy), the key thing is to give the business an indicator that Mr. Smith's monthly service is coming up, and someone should give him a call to determine when exactly it can be scheduled for. In effect give these businesses a way to track repeat business and know when it's time to followup with a customer.

    Read the article

  • Same code, not the same place, different results

    - by Tom
    Hi! I'm trying to something pretty simple but I don't understand why the second bit of code is giving me a bad access error... First: - (UITableViewCell *)tableView:tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; } // Tom: Converting the row int to a string and adding 1 to it so that the rows fit with the array indexes.) NSString *key = [NSString stringWithFormat:@"%d", indexPath.row+1]; NSArray *array = [self.tableDataSource objectForKey:key]; NSLog(@"%@", key); NSLog(@"%@", [array description]); cell.textLabel.text = [array objectAtIndex:1]; return cell; } That code gives me exactly what I want: 2010-03-18 15:18:12.884 PremierSoins[28005:40b] 1 2010-03-18 15:18:12.885 PremierSoins[28005:40b] ( 7, Blessures ) 2010-03-18 15:18:12.892 PremierSoins[28005:40b] 2 2010-03-18 15:18:12.893 PremierSoins[28005:40b] ( 18, "Test 2" ) But then, the second: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString *key = [NSString stringWithFormat:@"%d", indexPath.row+1]; NSArray *array = [self.tableDataSource objectForKey:key]; NSLog(@"%@", key); NSLog(@"%@", [array description]); } Is only able to get me the key, but the description of the array makes it crash... tableDataSource is a NSMutableDictionary containing multiple arrays... Like this: { 1 = ( 7, Blessures ); 2 = ( 18, "Test 2" ); } Do you have any clue? I've been looking at this since yesterday... Thanks! Tom

    Read the article

  • Nec USB 3.0 controller drops connection - Ubuntu 12.04.1

    - by Tom
    I have some serious problems with Technaxx pci-e 302p card. It has uPD720200a NEC chip with 4020 firmware. BIOS recognises it. Sometimes it recognises devices and system mounts them and are functional for few minutes, other times they can't be mount and error occours. After fresh install card worked fine, but after kernel and firmware update it behaves as mentioned. Outputs: uname -a Linux asd-GA-MA770-UD3 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux lspci -vvv USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04) (prog-if 30 [XHCI]) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 17 Region 0: Memory at fd8fe000 (64-bit, non-prefetchable) [size=8K] Capabilities: <access denied> Kernel driver in use: xhci_hcd lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 07d1:3c0a D-Link System DWA-140 RangeBooster N Adapter(rev.B2) [Ralink RT3072] Bus 005 Device 004: ID 1997:1221 Bus 005 Device 003: ID 15c2:003c SoundGraph Inc. lsmod Module Size Used by nls_iso8859_1 12713 0 nls_cp437 16991 0 vfat 17585 0 fat 61512 1 vfat vesafb 13844 1 saa7134_alsa 18602 1 rfcomm 47604 0 bnep 18281 2 bluetooth 180104 10 rfcomm,bnep tda827x 18182 1 snd_hda_codec_hdmi 32474 1 ir_lirc_codec 12859 0 lirc_dev 19204 1 ir_lirc_codec tda8290 22616 1 arc4 12529 2 snd_hda_codec_realtek 224173 1 ir_mce_kbd_decoder 12777 0 ir_sony_decoder 12510 0 ir_jvc_decoder 12507 0 tuner 27428 1 ir_rc6_decoder 12507 0 snd_hda_intel 33773 5 rt2800usb 22684 0 rt2800lib 58925 1 rt2800usb crc_ccitt 12667 1 rt2800lib rt2x00usb 20762 1 rt2800usb rt2x00lib 51144 3 rt2800usb,rt2800lib,rt2x00usb mac80211 506816 3 rt2800lib,rt2x00usb,rt2x00lib ir_rc5_decoder 12507 0 rc_avermedia_m135a 12526 0 rc_imon_pad 12505 0 ir_nec_decoder 12507 0 cfg80211 205544 2 rt2x00lib,mac80211 snd_hda_codec 127706 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel snd_ctxfi 111202 2 snd_hwdep 13668 1 snd_hda_codec imon 32839 0 snd_pcm 97188 5 saa7134_alsa,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_ctxfi snd_seq_midi 13324 0 saa7134 181851 1 saa7134_alsa videobuf_dma_sg 19354 2 saa7134_alsa,saa7134 snd_rawmidi 30748 1 snd_seq_midi snd_seq_midi_event 14899 1 snd_seq_midi joydev 17693 0 rc_core 26412 13 ir_lirc_codec,ir_mce_kbd_decoder,ir_sony_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_rc5_decoder,rc_avermedia_m135a,rc_imon_pad,ir_nec_decoder,imon,saa7134 snd_seq 61896 2 snd_seq_midi,snd_seq_midi_event fglrx 3263886 101 videobuf_core 26390 2 saa7134,videobuf_dma_sg v4l2_common 16454 2 tuner,saa7134 videodev 98259 3 tuner,saa7134,v4l2_common sp5100_tco 13791 0 snd_timer 29990 2 snd_pcm,snd_seq snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq snd 78855 28 saa7134_alsa,snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_ctxfi,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device v4l2_compat_ioctl32 17128 1 videodev tveeprom 21249 1 saa7134 i2c_piix4 13301 0 soundcore 15091 1 snd edac_core 53746 0 serio_raw 13211 0 snd_page_alloc 18529 3 snd_hda_intel,snd_ctxfi,snd_pcm edac_mce_amd 23709 0 wmi 19256 0 mac_hid 13253 0 ppdev 17113 0 parport_pc 32866 1 k10temp 13166 0 lp 17799 0 parport 46562 3 ppdev,parport_pc,lp usb_storage 49198 0 uas 18180 0 usbhid 47199 0 hid 99559 1 usbhid firewire_ohci 41000 0 firewire_core 63558 1 firewire_ohci crc_itu_t 12707 1 firewire_core floppy 70365 0 pata_atiixp 13204 2 r8169 62099 0 dmesg | tail after plugging to usb 3.0 port [ 834.871296] sd 9:0:0:0: rejecting I/O to offline device [ 834.871308] sd 9:0:0:0: rejecting I/O to offline device [ 834.871319] sd 9:0:0:0: rejecting I/O to offline device [ 834.871330] sd 9:0:0:0: rejecting I/O to offline device [ 834.871530] sd 9:0:0:0: [sdd] Unhandled error code [ 834.871536] sd 9:0:0:0: [sdd] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [ 834.871545] sd 9:0:0:0: [sdd] CDB: Read(10): 28 00 0e 8e 48 0a 00 00 3e 00 [ 834.871564] end_request: I/O error, dev sdd, sector 244205578 [ 834.875497] sd 8:0:0:1: Device offlined - not ready after error recovery [ 834.885339] usb 9-2: USB disconnect, device number 2 Are there any other outputs need for answering? I'll post them ASAP. I could of course reject updating the system but I think it's halfway solution. Any help appreciated. BTW USB 2.0 and 1.1 ports run well, card itself runs under win7 as charm. Tom

    Read the article

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