Is there a way to plot multiple data for the same value x? For example following points:
[1, 1], [1, 2], [1, 3], [2, 6], [2, 9], [3, 11], [4, 11]...
Many thanks!
I have a reader from ACS "ACR83" and a brand new card from the same place ACO3-32 as a development kit and I need to use both of them to login into my laptop locally
I am not a part of domain, I am using Windows xp SP3
what should I do to enable smart card login
do I need third party software to do this without domain
or should it be a domain environment to be able to do such a thing
this is the first time dealing with smart card, so I hope some one will help me Doing this
Hi,
I was trying to understand this implementation in C of the Dijkstra algorithm and at the same time modify it so that only the shortest path between 2 specific nodes (source and destination) is found.
However, I don't know exactly what do to. The way I see it, there's nothing much to do, I can't seem to change d[] or prev[] cause those arrays aggregate some important data for the shortest path calculation.
The only thing I can think of is stopping the algorithm when the path is found, that is, break the cycle when mini = destination when it's being marked as visited.
Is there anything else I could do to make it better or is that enough?
P.S: I just noticed that the for loops start at 1 until <=, why can't it start at 0 and go until <?
I'm asking this question because it's a good way to gauge how the community at large feels about the various containers/frameworks and why. Also, whilst my expertise may lie in .Net development, I am very interested in which frameworks are popular (and why) in other languages. If I feel the need to start digging into Java for instance, then I'd like to hit the ground running with good (comfortable) knowledge that I'm starting in the right direction. Does Ruby even need one with all its magnificent dynamicism? I have my own opinions on the .Net front, and will probably add my own personal favourite in an answer below, but I'm interested in all languages and opinions here.
With all that in mind, could you please state only one IoC/DI framework that you use and recommend with the language of choice (Java/Ruby/.Net/Smalltalk etc.) and your reasoning for your choice, and if someone has already answered your particular flavour, then you can just vote it up and add comments to it so that anyone looking for advice in future and see which frameworks are more than likely to work for them once they read your reasoning. I'm hoping that over time, the best ones will bubble up to the top.
I realise that this question doesn't have only one correct answer, so I won't be choosing one - the community will decide which framework gets the most votes and why. Of course, if you really feel strongly opposed to a particular brand, you could take the reputation hit and vote it down too, and this question can serve as a true wiki-style entry for research into this field.
Remember, only one IoC per answer you write please - if you feel the need to promote two frameworks, then write two answers with your reasoning inside for each choice - then others in the community can agree or disagree with you.
I need to receive 320 bytes of data from a server which consist of 80 4 bytes int fields. How do I receive them in bytes of 4 and display their respective int values? Thanks. Not
sure if this is right for the receiving part:
//for reading the data from the socket
BufferedInputStream bufferinput=new BufferedInputStream(NewSocket.getInputStream());
DataInputStream datainput=new DataInputStream(bufferinput);
byte[] handsize=new byte[32];
// The control will halt at the below statement till all the 32 bytes are not read from the socket.
datainput.readFully(handsize);
OK this is probably insane, but I want to be able to have a check box at the very top of every row in my tree view. This box will "disable" or "enable" the ability to use the column. Oh I think it should be mentioned that I'm using a ListStore and am using C#, mono, GTK#. However, ill take anything and try to figure it out.
Ill even accept a way to make two views where the columns line up ....
So, possible? or just insane?
I'm getting weird EXC_BAD_ACCESS errors. I thought that I didn't need to retain objects if I was didn't need them after the method exited, but I want to double-check that. In the following, do I need to retain "tData"?
-(void)myMethod:(UITouch*)touch{
TouchData *tData = (TouchData *)CFDictionaryGetValue(datasByUITouch, touch);
[tData doSomething];
}
Hi,
I want to use two tableviews under the segmentedcontrol. one is plain styled and the other is groupstyled. How can i controll the delegate and datasource for the two table views?
--
Regards,
Syed yusuf
Java example method:
//Stores the user input into an integer variable called 'choice'
int choice = keyboard.nextInt();
Do I need to write javadoc for a simple method like this or should I only document the main method of any program, if so then what sort of things should I write for the main method?
Thanks,
Chris.
Hello
I'm creating an dynamic image, which creates headers on my page using PHPs GD-library. The problem is, that I need a line-wrapping system. It's not a problem itself, but first I need to get the width (in pixels) of current character.
I'm pretty curious about this, is there any way? Or do I need to manually specify width of every abc?
Martti Laine
If you could go back in time and tell yourself to read a specific book at the beginning of your career as a developer, which book would it be?
I expect this list to be varied and to cover a wide range of things. For me, the book would be Code Complete. After reading that book, I was able to get out of the immediate task mindset and begin to think about the bigger picture, quality and maintainability.
SELECT * FROM tbl_houses WHERE (SELECT HousesList FROM tbl_lists WHERE tbl_lists.ID = '123') LIKE CONCAT('% ', tbl_houses.ID, '#')
It only selects the row from tbl_houses of the last occuring tbl_houses.ID inside tbl_lists.HousesList
I need it to select all the rows where any ID from tbl_houses exists within tbl_lists.HousesList
I am using a custom error page:
<customErrors redirectMode="ResponseRedirect" mode="On" defaultRedirect="Error2.aspx"/>
I want to disable authentication for the custom error page because the error being raised is related to an authentication module and I don't want to get into an infinite loop and I want to display a clean error page to the user. I have been trying the following configuration to do that.
<location path="Error2.aspx">
<system.web>
<authentication mode="None"/>
<authorization>
<allow users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>
I am getting a System.Configuration.ConfigurationErrorsException for the line that sets the authentication mode.
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
I have verified that there are no other web.config files in subdirectories under the application's folder. The applications folder is configured as an application in IIS and the error page is at the application's root. File permissions set for the error page in IIS include anonymous and windows authentication (I have tried just anonymous as well).
Fairly simple issue which is solved in PHP by using a static variable.
private static $pages;
public function Pages() {
if($pages == null) {
$pages = new PageCollection();
$pages->findAll();
}
}
Everywhere in my code I use Pages()::someFindFunction() to make sure the results are fetched only once, and I use that same collection.
I want the same in my .NET MVC application: use something like:
<%=MySite.Pages.findById(1).Title%>
In the code below, if I use a private variable, or if I use a public class with shared variables (doesn't matter) they are both persisted during the entire application.
I want them to load the same way PHP does, once per request. Now where do I store the .NET equivalent of private static $pages, so that the code below works?
//what to do with $pages??
Public Module MySite
Public Function Pages() As PageCollection
If $pages Is Nothing Then
$pages.loadAll()
End If
Return $pages
End Function
End Module
Suppose I have a given Object (a string "a", a number - let's say 0, or a list ['x','y'] )
I'd like to create list containing many copies of this object, but without using a for loop:
L = ["a", "a", ... , "a", "a"]
or
L = [0, 0, ... , 0, 0]
or
L = [['x','y'],['x','y'], ... ,['x','y'],['x','y']]
I'm especially interested in the third case.
Thanks!
My client's web app allows members to sign up (Rails using AuthLogic) and those signups are limited in that they must be under the auspices of a university. To wit: A university organizer can sign up to be the representative of a university, and students can sign up as "attendees" of that university.
I've been tasked with finding if there is a programmatic way to verify university membership/attendance. The only way I can see doing this is having a database of universities and a database of associated emails, and verifying that the student's email address is part of this database. That doesn't help if using Facebooker and AuthLogic's "sign up with Facebook credentials" ability, however.
I suspect the answer to this is "via human intervention," and that this is something we can't solve programmatically. Either we, or the university, will have to bite the bullet and check records. However, I'd thought I'd ask if anyone else has run into the issue of verification of university membership before.
Hi, so in my program I have parts where I use try catch blocks like this
try
{
DirectoryInfo dirInfo = new DirectoryInfo(someString);
//I don't know if that directory exists
//I don't know if that string is valid path string... it could be anything
//Some operations here
}
catch(Exception iDontCareWhyItFailed)
{
//Didn't work? great... we will say: somethings wrong, try again/next one
}
Of course I probably could do checks to see if the string is valid path (regex), then I would check if directory exists, then I could catch various exceptions to see why my routine failed and give more info... But in my program it's not really necessary. Now I just really need to know if this is acceptable, and what would a pro say/think about that. Thanks a lot for attention.
I am using the jquery ui out the box, based on a theme.
Having links rendered as button is great, however I need to override some buttons with different colours.
How do I specify an specific class for a particular button to use?
What's the difference between having keyspace Foo and column families A and B in it vs. having two keyspaces FooA and FooB with one column family in each?
API make it look as if these two were pretty much equivalent.
As a bonus question, how do supercolumns fit into this picture?
Hi guys,
So I am relatively new to Python and I am having trouble working with 2D Lists.
Here's my code:
data = [[None]*5]*5
data[0][0] = 'Cell A1'
print data
and here is the output (formatted for readability):
[['Cell A1', None, None, None, None],
['Cell A1', None, None, None, None],
['Cell A1', None, None, None, None],
['Cell A1', None, None, None, None],
['Cell A1', None, None, None, None]]
Why does every row get assigned the value?
I have a table in Access in a custom format saved as dd/MM/yyyy hh:mm:ss tt , Also A form in VB.NET 2010, I get a specific day, month and year with no problem but the problem comes when I want to query the sum of a column named value depending on a specific month or day or year....
The table is like:
+-----+-----------+-------------------------+
| id | value | date |
+-----+-----------+-------------------------+
| id1 | 1499 | 01/01/2012 07:30:11 p.m.|
| id2 | 1509 | 11/02/2012 07:30:11 p.m.|
| id3 | 1611 | 21/10/2012 07:30:11 p.m.|
| id1 | 1115 | 11/10/2012 07:30:11 p.m.|
| id1 | 1499 | 17/05/2012 07:30:11 p.m.|
| id2 | 1709 | 11/06/2012 07:30:11 p.m.|
| id3 | 1911 | 30/07/2012 07:30:11 p.m.|
| id1 | 1015 | 01/08/2012 07:30:11 p.m.|
| id1 | 1000 | 11/05/2012 07:30:11 p.m.|
|+-----+-----------+------------------------+
So I Know the query
SELECT SUM(value) FROM mytable WHERE date in='01/05/2012 00:00:00' ...
How to tell the query I want the month of May so I would get 1499+1000= 2499
Or how to tell I want the year 2012 so I would get the sum of all the table
Which would be the correct syntax...
I am trying to sign a token object using SHA1.
I am using bouncycastle as the security provider.
Whenever the program tries to sign something it gives me this error.
java.security.SignatureException: java.lang.IllegalArgumentException: input data too large.
What is the maximum size for signing something?
Do you have any suggestions about how I can sign this object?
In my app, I have a User model and a Project model. A user has_many assignments and each project belongs_to a user. But along with each project having an owner, the user who created it, I would like the owner be able to share it with others (so that the project gets shown on the other users' account along with their own). I imagine having to use has_many :through, and setting up a projects_users table with a user_id and a project_id. And I guess this would be the end result?
Project.first.user
# The creator of the project
=> #<User id: 1, name: 'andrew', etc...>
Project.first.users
# The users that the creator chose to share it with
=> [#<User id: 2 ...>, #<User id: 3 ...>]
How would I go about doing this? Thanks!
If I passed a list of key ids as an argument in a transaction, would the change associated with the first key in the list happen first? And if not, how do I specify the order that I want the changes to happen in?
As a concrete example, consider this code below from Google Docs Transactions--would changes to the first item in acc.key() happen first?
class Accumulator(db.Model):
counter = db.IntegerProperty()
Docshttp://code.google.com/appengine/docs/python/datastore/transactions.html:
def increment_counter(key, amount):
obj = db.get(key)
obj.counter += amount
obj.put()
q = db.GqlQuery("SELECT * FROM Accumulator")
acc = q.get()
db.run_in_transaction(increment_counter, acc.key(), 5)
I would like to protect one key/value pair in my appSettings but not the others using something like I've previously done with the ProtectSection method as seen below.
var configurationSection = config.GetSection("appSettings");
configurationSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
Ideally I would like to do something like the following:
var configurationElement = config.GetSection("appSettings").GetElement("Protected");
configurationElement.ElementInformation.ProtectElement("DataProtectionConfigurationProvider");
Here is the example appSettings I would be operating on:
<configuration>
<appSettings>
<add key="Unprotected" value="ChangeMeFreely" />
<add key="Protected" value="########"/>
</appSettings>
</configuration>
I've been searching but haven't found a way to do this. Is this possible?