i want to find a framework to make my work simple on gae ,
has it ?
thanks
i found one, but not very good http://code.google.com/p/appengine-framework/
a=[1,2,3,4]
b=a.index(6)
del a[b]
print a
it show error:
Traceback (most recent call last):
File "D:\zjm_code\a.py", line 6, in <module>
b=a.index(6)
ValueError: list.index(x): x not in list
so i have to do this :
a=[1,2,3,4]
try:
b=a.index(6)
del a[b]
except:
pass
print a
but this is not simple,has any simply way ?
thanks
I have a simple array with x number of items. I am displaying them individually via a link click... I want to update a number that say 1 of 10. when the next one is displayed i want it to display 2 of 10 etc...
I have looked all around and my brain is fried right now... I know its simple I just cant get it out.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Page Title</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/>
<script type="text/javascript">
var quotations = new Array()
quotations[0]= "1"
quotations[1]= "2"
quotations[2]= "3"
quotations[3]= "4"
quotations[4]= "5"
quotations[5]= "6"
quotations[6]= "7"
numQuotes = quotations.length;
curQuote = 1;
function move( xflip ) {
curQuote = curQuote + xflip;
if (curQuote > numQuotes)
{ curQuote = 1 ; }
if (curQuote == 0)
{ curQuote = numQuotes ; }
document.getElementById('quotation').innerHTML=quotations[curQuote - 1];
}
var curPage = //this is where the current index should go
</script>
</head>
<body>
<div id="quotation">
<script type="text/javascript">document.write(quotations[0]);</script>
</div>
<div>
<p><a href="javascript();" onclick="move(-1)">GO back</a>
<script type="text/javascript">document.write(curPage + " of " + numQuotes)</script>
<a href="javascript();" onclick="move(1)">GO FORTH</a></p>
</div>
</body>
</html>
I am not a programmer, but a designer. I created a static web site in Dreamweaver (CS4) and my client would like to be able to update a news page on his own. I have looked in to several CMS options and haven't found one that seems to fit my needs. Mainly, simple to set up, possible to set up and, preferrably, free to set up. Any suggestions? I'm all ears.
Thanks
Input integer array:
a[8] = { a1, a2, a3, a4, b1, b2, b3, b4 }
Output array:
a[8] = { a1, b1, a2, b2, a3, b3, a4, b4 }
Forget all corner cases, make sure your solution works for any int array of size 2n. You can use one or two temp variables for looping or anything, but you shouldn't use any temp arrays/stacks/queues etc to store entire array or part of array.
I'm able to get answer in O(n*log n), but I'm looking for better solution.
The prior instance of TFS I was using is no longer available and I have a test project I want to bind to the new instance of TFS. However, when I try to add the solution to source control, the error message tells me that the collection is not available on the server. I have deleted all old source control files, and it still has the old bindings somewhere.
Does anyone know how to remove ALL bindings so I can just simply start over again with a new instance of TFS?
Thanks.
I am building out a number of Silverlight 4.0 libraries that are part of the same solution. I like to break them into separate projects and have a Unit Test project for each:
SolutionX
-LibraryProject1
---Class1.cs
---Class2.cs
-LibraryProject1.Test
---Tests1.cs
---Tests2.cs
-LibraryProject2
---Class1.cs
---Class2.cs
---CLass3.cs
-LibraryProject2.Test
---Tests1.cs
---Tests2.cs
---Tests3.cs
-LibraryProject3
---Class1.cs
-LibraryProject3.Test
---Tests1.cs
This works great when using VS regular test projects and infrastructure because I can create and execute list of test that are aggregated from each Test project. But with the Silverlight Unit Test Framework since the Silverlight Unit Test Project must be the "start up project" I cannot figure how to run a collection of tests from each test project in one go. I have to run each separately then switch the starting project each time. I would prefer to avoid create complex build scripts or build definitions - is there a way to run all the tests at once?
-Thanks
Can anyone point me towards some good documentation / code examples on how best to manage the configuration of a DI container in a scenario where you need different configuations sets?
We have a layered, distributed application that has multiple entry points (ie; a website, winforms app, office plugin etc). Depending on how you are using the solution (through a UI vs. an automated workflow for example), it needs to be configured slightly differently.
We are using Windsor, and it's fluent configuration capabilities.
I have two projects in my Solution. One implements my business logic and has defined entity model of entity framework. When I want to work with classes defined within this project from another project I have some problems in runtime. Actually, the most concerning thing is why I can not instantiate my, so called, TicketEntities(ObjectContext) object from other projects? when I catch following exception: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid. I found out it's brake at: public partial class TicketEntities : global::System.Data.Objects.ObjectContext
{
public TicketEntities() :
base("name=TicketEntities", "TicketEntities")
{
this.OnContextCreated();
} with exception: Unable to load the specified metadata resource.
Just to remind you everthing works fine from orginal project.
I have a Visual Studio 2005 solution (.sln) with a mix of .NET and C++ projects. What is the best way to generate the .build file I will need to run my build process with NAnt. I'm new to using NAnt, and I'm not sure how to set it up. Will I have to update the .build file manually every time there is a new source file in any of the projects? Is there a tool that will generate the files for NAnt from the .sln and studio project files?
Hi,
Im working with a CD722UN Customer Display for our POS application.
it comes with a USB2.0 connection and a installation package containing a driver ect..
now, for my application. how should i do when i want to access this driver?
at the moment i'm using the "CD722UN application"s .dll path but that can warry from clients OS ect..
Declare Function opencd722usb Lib "C:\Program\cd7220 USB\cd722dusb.dll" () As Boolean
Declare Function writecd722usb Lib "C:\Program\cd7220 USB\cd722dusb.dll" (ByRef dataoutput As Byte, ByVal Length As Integer) As Integer
Declare Function readcd722usb Lib "C:\Program\cd7220 USB\cd722dusb.dll" (ByRef DataInput As Byte, ByVal size As Integer) As Integer
Declare Function closecd722usb Lib "C:\Program\cd7220 USB\cd722dusb.dll" () As Boolean
my first thought was to first check if there was a device installed in the device manager and somehow use the driver from there???
or
distribute the .dll inside our application folder and use
searchpath ""installed directory"\cd722dusb.dll"
what is the best solution?
thanks in advance!
My solution has a
C# application project
C# User Controls project
C++ Mathematics project
One of the UserControls uses function from the Mathematics (C++ project). This UserControl is used in the application.
Building and starting the application works just fine. When typing the IntelliSense suggests all the contained classes and methods. The UserControl appears correctly, but on clicking a button which calls the C++ function I get a BadImageFormatException (it pops out on the end of the automatically created Main function).
The help suggests to use /fixed:no for linking, but that is already set up.
I have a Visual studio 2008 solution, with 2 projects. A DLL, A, and a Web application, B.
B has a project reference to A, and A.dll and A.pdb are being copied to B's bin/ directory.
Everything is set to compile in debug mode.
I can run the cassini webserver and debug web application B fine, but when I come to call a method in A.dll, pressing F11 to step into it does not step into it, it steps over it. I want to step into it.
Any ideas why I might not be able to step into the source code of A?
I've written a website in PHP and it will have ability for users to upload images. My website will have more than 100.000 users. Aprox. 1k users will upload image about 50 KB. And every image will be displayed on this website 5k times so it's transfer of:
1k x 50 KB x 5k = 250 GB per month.
So my question is:
Do you know any good solution (hosting or CDN network or else) that:
will be payed for transfer not space used and no entrance fee
will have API to upload images easily with PHP
is extremely easy to use
will be good for low budget
will not require any special, complicated registration and formal things
will allow commercial use
will allow using this images in website layout
?
Hi!
Is there a Delphi-5 solution to easily integrate single-file storage into existing code? I would like to have files like Java *.jar or Openoffice document files which are zipped/compressed files and folders but with their own file extension.
Edit:
I know some ZIP capable components but in a nutshell I want to access files within the "container" and use normal file handling routines on them (eg. TStringList.SaveToFile). Any overhead about compress/uncompress should be handled by the component.
Hi,
I need to download and parse webpage with lxml and build UTF-8 xml output. I thing schema in pseudocode is more illustrative:
from lxml import etree
webfile = urllib2.urlopen(url)
root = etree.parse(webfile.read(), parser=etree.HTMLParser(recover=True))
txt = my_process_text(etree.tostring(root.xpath('/html/body'), encoding=utf8))
output = etree.Element("out")
output.text = txt
outputfile.write(etree.tostring(output, encoding=utf8))
So webfile can be in any encoding (lxml should handle this). Outputfile have to be in utf-8. I'm not sure where to use encoding/coding. Is this schema ok? (I cant find good tutorial about lxml and encoding, but I can find many problems with this...) I need robust approved solution so I ask you seniors.
Many thanks
I'm trying to determine what is involved in synchronizing MailChimp, the popular bulk email service, with Aptify, the .NET-powered CRM my company uses. MailChimp supplies a .NET wrapper DLL which should make this process much easier. They also advertise a 3rd-party solution:
Sync Module for .Net systems - MailChimp Sync Module makes it easier for developers to synchronize their lists from any datasource to mailchimp. It has been developed in C# on the mailchimp .NET wrapper. Check it out here. Provided by Wim De Coninck.
What steps would have to take to use these tools to get MailChimp and Aptify playing nicely together?
I have started creating a game, and I added a second project, it's the standard XNA Windows game 3.1 project, and since the other project already had a Main to start the program and the 2nd is for game data, where as the first was for the drawing and graphical side of things (menu's etc) I thought I would remove the Main method, and now all I get are Errors saying there isn't a Valid main method, I tried to make it dependant on the other (since this data is loaded at run time and is such as quests/items etc) but it still wont let me run the solution at all. the code for the main method is still in the 1st project, and if I delete the 2nd project it runs fine, although no game data so I only get menus...
Thank you in advance for any assistance.
Is there a real solution for COMET AND PHP combination? Basically, I've come to a point that I need to update a user home page periodically whenever there is new data in the database. As far as I understand, I need to open a persistent connection between my server and my clients browsers to update the contents of their home page as soon as new info. available without dedicating a lot of resources but I had no luck finding anything clear about this issue. I read many articles suggests that PHP is not a good language to implement COMET. My web application is completely programmed in PHP and I don't want to learn another language but if I'm forced to, Would you suggest a good language to start with? Do you think that I can program an interface just to handle this issue?
Thanks in advance.
I'm using Google Test Framework to set some unit tests. I have got three projects in my solution:
FN (my project)
FN_test (my tests)
gtest (Google Test Framework)
I set FN_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd (not doing this was leading me to linking errors before)).
Particularly, I define a class called Embark in FN I would like to test using FN_test. So far, so good. Thus I write a classe called EmbarkTest using googletest, declare a member Embark* and write inside the constructor:
EmbarkTest() {
e = new Embark(900,2010);
}
Then , F7 pressed, I get the following:
1>FN_test.obj : error LNK2019: unresolved external symbol "public: __thiscall Embark::Embark(int,int)" (??0Embark@@QAE@HH@Z) referenced in function "protected: __thiscall EmbarkTest::EmbarkTest(void)" (??0EmbarkTest@@IAE@XZ)
1>D:\Users\lg\Product\code\FN\Debug\FN_test.exe : fatal error LNK1120: 1 unresolved externals
Does someone know what have I done wrong and/or what can I do to settle this?
I have created an C++ solution in VS2008. The first project contains the model. The second projects is the view. The problem is that i don't get make references to my model classes defined in the first project. The message error is :
Error 1 fatal error C1083: Cannot open include file: 'utils/GeradorSistematicoDeAlturaDoPlanoDeCorteStrategy.h': No such file or directory c:\Users\user\Programação em C++\Simulacao\Simulacao_Testes\src\Teste1.cpp 3 Simulacao_Testes
Is there any configuration in VS2008 that makes to be made in order to, from the my view (second project) project, i do make references to the first project, the model?
Hello,
I having a hard time to capture the backspace button in a UITextView.
I am trying to capture it in the method
- (BOOL)textView:(UITextView *)textView
shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
I thought it was ok to do like this.
if([text isEqualToString:@"\b") { // code ... }
But for some reason, when backspace is pressed 'text' is empty.
I know I can compare lenght of the UITextView but it isnt what I want to achieve.
So I found a solution to this.
If I look at '[text lenght]' every key on the defaultkeyboard returns 0 . Every key excepts the backspace wich is 0. In that way i know when backspace is pressed.
I do this check.
if([text lenght] == 0) { // BACKSPACE PRESSED }
What is your opinion about this? -or can I do it in a better way?
Regards.
- Martin
Hello everyone.
I am trying to start a new project (asp.net MVC) and I would like to apply some DDD rules I've learned in these last few months.
I don't know how to organize my solution though.
I would like to use Nhibernate but I don't want to use Fluent Nhibernate cause it must be something like an experiment.
I've seen some examples where people keep everything in the same project.
Some others tend to create a different project for everything.
Do you think I should differentiate the model and the repository or put it in the same project?
If someone has some links to articles etc it would be appreciated.
thanks
Alberto
Here is the situation:
There is a transaction intensive database - used for both routine transactions and reports.
I was wondering if I could isolate these two operations and 2 independent databases, so reports could run off of one database and all the transactions could occur in another one. This would improve performance for the OLTP SQL database.
I have gone over a few options like, Mirroring, Log shipping, Replication, Snapshots, Clustering - but would like to discuss the best possible strategy for the desired result.
Please advise the best solution to implement this strategy, or any other thoughts/suggestion you may have.
Hello,
I'm currently building a web application. In one of it's key processes the application need to match short phrases to other similar ones available in the DB.
The application needs to be able to match the phrase:
Looking for a second hand car in good shape
To other phrases which basically have the same meaning but use different wording, such as:
2nd hand car in great condition needed
or
searching for a used car in optimal quality
The phrases are length limited (say 250 chars), user generated & unstructured.
I'm in need of a service / company / some solution which can help / do these connections for me.
Can anyone give any ideas?
Thanks,
Roy