Hi folks,
Quick question. I want to change the color of an int based on the value being positive or negative, using css if possible.
Any ideas??
Thanks again!
Hi.
I need to obtain the velocity of an android device, based on the accelerometer values. I made a code that allows me to get the accelerometer values, and then I calculate the velocity, using the formula:
v = v0 + at. (vector calculation)
My problem is that my velocity only increases and never decreases. I think the problem is that the device never gets an negative acceleration.
Can you help me with this?
In Mathematica I have a list of point coordinates
size = 50;
points = Table[{RandomInteger[{0, size}], RandomInteger[{0, size}]}, {i, 1, n}];
and a list of cluster indices these points belong to
clusterIndices = {1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1};
what is the easiest way to split the points into two separate lists based on the clusterIndices values?
Hii,
I want to built a web based chat using j2ee at backend logic.i want to implement the similar way the gmail do,so that performance of application doesnr degrade.please suggest what type of architecture shoul i follow.load of application would be high.
One of the downsides of web.config/app.config is that it's just Magic Strings everywhere, since it's just an XML file.
Interpreted languages like PHP or Ruby have the advantage that the configuration is just code that is executed. In .net, doing stuff in code requires a redeployment, which defeats the purpose.
Now, before I build my own web.config replacement based on Boo or PowerShell I wanted to know if there is an existing one?
hi everyone, i have a collection of book object in a hashmap, the book has book_title, book_author, book_year_published, etc. i want to sort them based on the book_title which is a String, in both ascending and descending order, and display them on the screen. i wish someone can help me, i have been doing this for hours and still havent come up with a solution. thanks in advance
Yes, I know, most of you are thinking I'm an idiot, butt (kidding) I'm not. I've been searching everywhere for something on how to fully make a navigation-based iphone app, but all I've found is how to set up table views or navigation controllers. I haven't found anything on how to create a data model (something simple from arrays and dictionaries, SQLite and CoreData are a bit out of my scope) or navigate it. Does anyone know of any tutorials or anything like that? Thanks.
I have a form which includes select options with different items. Based on item selected, I need to show respective form on the same page.Does any one know jquery plugin for this or how aesthetically we can do this kind of requirement?
I have a pretty simple question. I want to make some date-based generic views on a Django site, but I also want to paginate them. According to the documentation the object_list view has page and paginate_by arguments, but the archive_month view does not. What's the "right" way to do it?
Which is a good .Net based CMS out there (for creating a corporate website). I have used Kentico CMS for some time, and am moderately happy with it.
However, is there anything better out there. I would like the ability to develop my own custom asp.net templates for various page types and install them.
I'm trying to write a simple socket-based client in Python that will connect to a telnet server. I can test the server by telnetting to its port (5007), and entering text. It responds with a NAK (error) or an AK (success), sometimes accompanied by other text. Seems very simple.
I wrote a client to connect and communicate with the server, but it hangs on the first attempt to read the response. The connection is successful. Queries like getsockname and getpeername are successful. The send command returns a value that equals the number of characters I'm sending, so it seems to be sending correctly. But in the end, it always hangs when I try to read the response.
I've tried using both file-based objects like readline and write (via socket.makefile), as well as using send and recv. With the file object I tried making it with "rw" and reading and writing via that object, and later tried one object for "r" and another for "w" to separate them. None of these worked.
I used a packet sniffer to watch what's going on. I'm not versed in all that I'm seeing, but during a telnet session I can see my typed text and the server's text coming back. During my Python socket connection, I can see my text going to the server, but packets back don't seem to have any text in them.
Any ideas on what I'm doing wrong, or any strategies to try?
Here's the code I'm using (in this case, it's with send and recv):
#!/usr/bin/python
host = "localhost"
port = 5007
msg = "HELLO EMC 1 1"
msg2 = "HELLO"
import socket
import sys
try:
skt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, e:
print("Error creating socket: %s" % e)
sys.exit(1)
try:
skt.connect((host,port))
except socket.gaierror, e:
print("Address-related error connecting to server: %s" % e)
sys.exit(1)
except socket.error, e:
print("Error connecting to socket: %s" % e)
sys.exit(1)
try:
print(skt.send(msg))
print("SEND: %s" % msg)
except socket.error, e:
print("Error sending data: %s" % e)
sys.exit(1)
while 1:
try:
buf = skt.recv(1024)
print("RECV: %s" % buf)
except socket.error, e:
print("Error receiving data: %s" % e)
sys.exit(1)
if not len(buf):
break
sys.stdout.write(buf)
I'm having a string where i'm using some placeholders to replace it with some values based on an object.
It is like the following:
Hello User <#= UserName #>
I need to replace the <#= UserName # with a value.
How can this be done with a regex? Please help. I dont want a string replace solution. There are somany placeholders and hardcoding the <#= UserName # and replace with the value is pointless
Imagine I want a user to be able to copy-paste a selection of pixels from MSPaint into a browser-based app. Is this possible using JavaScript in any current browsers? Will it become possible in HTML5?
If not, is it feasible using something like Flex/Silverlight, or is it simply not possible at this time, and you'd have to save a file and manually upload it?
I need to do something like the following:
Find other categories people like based on the categories you like. I have a likes table, which is joined to users and categories.
I need to do an efficient query to find out what other categories people who liked a given category also like.
Any thoughts on this would be appreciated. Thanks in advance.
Hello , I was wondering from where i can get more info on how to build plugin based Apps (design patterns , etc ).
Any books and references with detailed information would be helpful.
Also i like how WordpPress was made , if someone can point me on how to build something like WordpPress did would be awesome.
Thanks !
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL Server 2005
Let's say I have a backgroundWorker1_DoWork that finds a value in a database and returns it in e.Result. Let's say I also have a backgroundWorker1_RunWorkerCompleted that reads the result.
What I want to be able to do is based on e.Result, I can re-run backgroundWorker1_DoWork, and this I am not sure how to do.
I'd really appreciate any help.
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL SERVER 2005
I have a method like:
public T Get<T>(string key)
{
}
Now say I want to return "hello" if the type is a string, and 110011 if it is type int.
how can I do that?
typeof(T) doesn't seem to work.
I ideally want to do a switch statement, and return something based on the Type of the generic (string/int/long/etc).
Is this possible?
What's the easiest way to change a text's color based on a variable?
For example: If $var is between 1-5, green. Between 6-10, Orange. Greater than 11, Red.
Is it possible to render different actions based on what fails at validation?
For example - I have one field in the form - email addres. It is validated like this:
validates :email,
:presence => true,
:uniqueness => { :case_sensitive => false }
In the controller:
def create
@user = User.new(params[:user])
if @user.save
redirect_to somewhere
else
# render :new if email is blank
# redirect_to somwhere if email is taken
end
end
I have a website for public users, but also have an admin part of about 10 pages, that I need to secure for website admin only.
If I implement Forms-Based Authentication on the 10 pages, will it also spread across the public part of the website too? i.e. changes in web.config.
I was looking at this example (http://support.microsoft.com/kb/301240) but it looks like it closes off public view for entire application!?!
Regards
Tea
Greetings,
I'm confused as to the best approach to make when consuming REST based web services with .Net. At the moment I'm using the System.net.webclient class. Should I be using Webresponse, webrequest classes in System.Net ?
If I were to use another approach (Other than webclient) what disadvantages / advantages would I gain ?
Thanks,