Search Results

Search found 2403 results on 97 pages for 'alex peta'.

Page 41/97 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Django BigInteger auto-increment field as primary key?

    - by Alex Letoosh
    Hi all, I'm currently building a project which involves a lot of collective intelligence. Every user visiting the web site gets created a unique profile and their data is later used to calculate best matches for themselves and other users. By default, Django creates an INT(11) id field to handle models primary keys. I'm concerned with this being overflown very quickly (i.e. ~2.4b devices visiting the page without prior cookie set up). How can I change it to be represented as BIGINT in MySQL and long() inside Django itself? I've found I could do the following (http://docs.djangoproject.com/en/dev/ref/models/fields/#bigintegerfield): class MyProfile(models.Model): id = BigIntegerField(primary_key=True) But is there a way to make it autoincrement, like usual id fields? Additionally, can I make it unsigned so that I get more space to fill in? Thanks!

    Read the article

  • A problem happened during install the ruby

    - by Alex
    I’m a freshman on Ruby and now trying to install ruby on my machine according to the Tutorial on http://wiki.openqa.org/display/WTR/Tutorial However, after I installed the ruby186-26, and run the command “gem update --system”, the following error occurred: C:\Documents and Settings\e482090\Desktopgem update --system c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in initialize': Inval id argument - <Not Set>/.gemrc (Errno::EINVAL) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:inopen' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in initi alize' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:innew' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in do_con figuration' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:inrun' from c:/ruby/bin/gem:23 C:\Documents and Settings\e482090\Desktopgem install watir c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in initialize': Inval id argument - <Not Set>/.gemrc (Errno::EINVAL) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:inopen' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in initi alize' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:innew' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in do_con figuration' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:inrun' from c:/ruby/bin/gem:23 Meanwhile, we have tried this on other machines and the result turned out ok. Thus, my question is why the error happened on my pc? Have you met this kind of error before?

    Read the article

  • How do I make matlab legends match the colour of the graphs?

    - by Alex Gosselin
    Here is the code I used: x = linspace(0,2); e = exp(1); lin = e; quad = e-e.*x.*x/2; cub = e-e.*x.*x/2; quart = e-e.*x.*x/2+e.*x.*x.*x.*x/24; act = e.^cos(x); mplot = plot(x,act,x,lin,x,quad,x,cub,x,quart); legend('actual','linear','quadratic','cubic','quartic') This produces a legend matching the right colors to actual and linear, then after that it seems to skip over red on the graph, but not on the legend, i.e. the legend says quadratic should be red, but the graph shows it as green, the legend says cubic should be green, but the graph shows it as purple etc. Any help is appreciated.

    Read the article

  • Using graphical ActiveX (COM) controls in WinForms project

    - by alex
    I have a collection (set) of ActiveX controls. I recieved them from our vendor company. I created a wrappers for them using tlbimp.exe and aximp.exe. All non-graphical controls work good. All graphical controls don't react on some methods. When I call their methods I get: TargetInvocativeException (InnerException is null). or Attempt to read/write protected memory. Our vendor company assure that their graphical activex controls work good. But they don't provide support service, so I have to find solution of my problem alone. And some more, All graphical activex controls don't react on mouseclick or any other mouse manipulations. But documentation says: it must change the color on mouse click. Maybe, someone have same symptoms and can help me ! I googled over that problem many pages but they don't help me. Maybe it's some Visual Studio settings or compiler options ? I use VS 2005.

    Read the article

  • Overloading the QDataStream << and >> operators for a user-defined type

    - by Alex Wood
    I have a an object I'd like to be able to read and write to/from a QDataStream. The header is as follows: class Compound { public: Compound(QString, QPixmap*, Ui::MainWindow*); void saveCurrentInfo(); void restoreSavedInfo(QGraphicsScene*); void setImage(QPixmap*); QString getName(); private: QString name, homeNotes, addNotes, expText; Ui::MainWindow *gui; QPixmap *image; struct NMRdata { QString hnmrText, cnmrText, hn_nmrText, hn_nmrNucl, notes; int hnmrFreqIndex, cnmrFreqIndex, hn_nmrFreqIndex, hnmrSolvIndex, cnmrSolvIndex, hn_nmrSolvIndex; }*nmr_data; struct IRdata { QString uvConc, lowResMethod, irText, uvText, lowResText, highResText, highResCalc, highResFnd, highResFrmla, notes; int irSolvIndex, uvSolvIndex; }*ir_data; struct PhysicalData { QString mpEdit, bpEdit, mpParensEdit, bpParensEdit, rfEdit, phyText, optAlpha, optConc, elemText, elemFrmla, notes; int phySolvIndex, optSolvIndex; }*physical_data; }; For all intensive purposes, the class just serves as an abstraction for a handful of QStrings and a QPixmap. Ideally, I would be able to write a QList to a QDataStream but I'm not exactly sure how to go about doing this. If operator overloading is a suitable solution, would writing code like friend QDataStream& operator << (QDataStream&,Compound) { ... } be a potential solution? I'm very open to suggestions! Please let me know if any further clarification is needed.

    Read the article

  • Re-using Buttons in WPF

    - by Alex Marshall
    I have a bunch of different objects that are commonly edited in the same TabControl using different DataTemplates, but I want each DataTemplate to have a common look and feel with Ok and Cancel buttons at the bottom right of each tab that will close the tab or save the content and then close the currently selected tab. What's the best way to place buttons on each tab ? Is there a way to do it without copying and pasting the buttons and stack panel across all of my data templates ?

    Read the article

  • Using python to play two sine tones at once

    - by Alex
    I'm using python to play a sine tone. The tone is based off the computer's internal time in minutes, but I'd like to simultaneously play one based off the second for a harmonized or dualing sound. This is what I have so far; can someone point me in the right direction? from struct import pack from math import sin, pi import time def au_file(name, freq, dur, vol): fout = open(name, 'wb') # header needs size, encoding=2, sampling_rate=8000, channel=1 fout.write('.snd' + pack('>5L', 24, 8*dur, 2, 8000, 1)) factor = 2 * pi * freq/8000 # write data for seg in range(8 * dur): # sine wave calculations sin_seg = sin(seg * factor) fout.write(pack('b', vol * 127 * sin_seg)) fout.close() t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis * 100 tim = float(ti) tim = tim * 100 if __name__ == '__main__': au_file(name='timeSound1.au', freq = tim, dur=1000, vol=1.0) import os os.startfile('timeSound1.au')

    Read the article

  • JQuery traverse DOM and extract node value

    - by Alex
    I have the following DOM: <div class="qtip qtip-light qtip-active"> <div class="qtip-wrapper"> <div class="qtip-borderTop"></div> <div class="qtip-contentWrapper"> <div class="qtip-title"> <div class="qtip-button"></div> **Text I need to extract** </div> <div class="qtip-content"> <div class="tooltip"> <div class="button-container"> <script type="text/javascript"> var link = null; var link = $('.qtip-active > .qtip-title').val(); $('.qtip-active > #button-container').append('<a href=\"mailto:' + link + '\">' + link + '</a>'); </script> </div> </div> </div> </div> <div class="qtip-borderBottom"></div> </div> </div> But the variable link is always undefined when I would expect it to return the text the node specified. I've been reading the jquery documentation for a few hours but I must be missing something with my logic (or lack there of). Any help appreciated...

    Read the article

  • abstract class NumberFormat - very confused about getInstance()

    - by Alex
    Hi, I'm new to Java and I have a beginner question: NumberFormat is an abstract class and so I assume I can't make an instance of it. But there is a public static (factory?) method getInstance() that allow me to do NumberFormat nf = NumberFormat.getInstance(); I'm quite confuse. I'll be glad if someone could give me hints on: 1) If there is a public method to get an instance of this abstract class, why don't we have also a constructor? 2) This is an abstract class ; how can we have this static method giving us an instance of the class? 3) Why choosing such a design? If I assume it's possible to have an instance of an abstract class (???), I don't get why this class should be abstract at all. Thank you.

    Read the article

  • Undefined symbols for architecture armv7 using route-me

    - by Alex
    I'm trying to compile my project including route-me using armv7 although am struggling with the following error, i have older versions of the same project in git which compiles fine with armv7 so a setting must have changed somewhere to break it, here is the error: Undefined symbols for architecture armv7: "_pj_fwd", referenced from: -[RMProjection latLongToPoint:] in libMapView.a(RMProjection.o) "_pj_inv", referenced from: -[RMProjection pointToLatLong:] in libMapView.a(RMProjection.o) "_pj_init_plus", referenced from: -[RMProjection initWithString:InBounds:] in libMapView.a(RMProjection.o) "_pj_free", referenced from: -[RMProjection dealloc] in libMapView.a(RMProjection.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) Any help would be greatly appreciated.

    Read the article

  • STAThread and Process output capture in c#

    - by alex
    Hi: This is a strange problem I encountered. I have an window application written in c# to do testing. It has a MDI parent form that is hosting a few children forms. One of the forms launch test cripts by creating processes and capture the scripts output to a text box. Another form open serial port and monitoring the status of the device I am working on(like a shell). If I ran both of them together, the output of the script seems only appear in the text box after the test is done. However, If I don't open the serial port form, the output of the script is captured in real time. Does anyone knows what's causing the problem? I notice the onDataReceived even handler for serial port form has a [STAThread] header to it. Will this cause the serial port thread having higher priority than other processes? Thanks in advance.

    Read the article

  • Python: combining making two scripts into one

    - by Alex
    I have two separately made python scripts one that makes a sine wave sound based off time, and another that produces a sine wave graph that is based off the same time factors. I need help combining them into one running file. Here's the first: from struct import pack from math import sin, pi import time def au_file(name, freq, freq1, dur, vol): fout = open(name, 'wb') # header needs size, encoding=2, sampling_rate=8000, channel=1 fout.write('.snd' + pack('>5L', 24, 8*dur, 2, 8000, 1)) factor = 2 * pi * freq/8000 factor1 = 2 * pi * freq1/8000 # write data for seg in range(8 * dur): # sine wave calculations sin_seg = sin(seg * factor) + sin(seg * factor1) fout.write(pack('b', vol * 64 * sin_seg)) fout.close() t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis * 100 tim = float(ti) tim = tim * 100 if __name__ == '__main__': au_file(name='timeSound.au', freq=tim, freq1=tis, dur=1000, vol=1.0) import os os.startfile('timeSound.au') and the second is this: from Tkinter import * import math import time t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis / 100 tim = float(ti) tim = tim / 100 root = Tk() root.title("This very moment") width = 400 height = 300 center = height//2 x_increment = 1 # width stretch x_factor1 = tis x_factor2 = tim # height stretch y_amplitude = 50 c = Canvas(width=width, height=height, bg='black') c.pack() str1 = "sin(x)=white" c.create_text(10, 20, anchor=SW, text=str1) center_line = c.create_line(0, center, width, center, fill='red') # create the coordinate list for the sin() curve, have to be integers xy1 = [] xy2 = [] for x in range(400): # x coordinates xy1.append(x * x_increment) xy2.append(x * x_increment) # y coordinates xy1.append(int(math.sin(x * x_factor1) * y_amplitude) + center) xy2.append(int(math.sin(x * x_factor2) * y_amplitude) + center) sinS_line = c.create_line(xy1, fill='white') sinM_line = c.create_line(xy2, fill='yellow') root.mainloop()

    Read the article

  • c# Windows Service not appearing in services list after install

    - by alex
    I've created a windows service in c#, using Visual Studio 2008 I pretty much followed this: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx I created a setup project, as instructed to in the article, and ran it... it installs my service to c:\program files\product etc.... however, it does not then appear in the services list.. What am i missing?

    Read the article

  • C# WPF XAML Problem with icon in GridViewColumn

    - by Alex
    I've created a ListView with a GridView component in it. Now trying to fill one of the cells with an icon (PNG) like in the code sample below (save_icon.png): <ListView.View> <GridView> <GridViewColumn Header="Date" Width="Auto" DisplayMemberBinding="{Binding Date}" /> <GridViewColumn Header="Time" Width="Auto" DisplayMemberBinding="{Binding Time}" /> <GridViewColumn Header="FriendlyName" Width="Auto" DisplayMemberBinding="{Binding FriendlyName}" /> <GridViewColumn Width="Auto"> <Image Source="save_icon.png" /> </GridViewColumn> </GridView> </ListView.View> Visual Studio gives me an error on the line, where i put the icon into the column (ERROR: "Error 35: The file save_icon.png is not part of the project or its 'Build Action' property is not set to 'Resource'.") I added the icon to the project as a resource and when i start the app, everything works (the icon appears at the right place). But the WPF designer window can't be reloaded and i'm not able to see changes in the designer, when i change the XAML code. Can somebody explain this error or am i doing something wrong? Thanks for every hint in advance!

    Read the article

  • programming logic and design pleas friends i need a flowcharts or pseudocode

    - by alex
    ***the midvile park maintains records containing info about players on it's soccer teams . each record contain a players first name,last name,and team number . the team are team number team name 1 goal getters 2 the force 3 top gun 4 shooting stars 5 midfield monsters design a proggram that accept player data and creates a report that lists each** player a long with his or her team number and team name**

    Read the article

  • ASP-style tags for Perl web development?

    - by Alex R
    I feel like I'm traveling 10 years back in time by asking this, but... Are there any modules, patches, or any "new" version of Perl (released in the last 10 years) to enable writing web-oriented Perl scripts using ASP-style tags? e.g. from ASP/JSP some html <% some code %> more HTML e.g. from PHP some html <? some code ?> more HTML Please don't worry about "why" I'm asking this... It's related to programming language research.

    Read the article

  • More issues with IntelliJ 9.0.1 "Hello World" in Scala - Predef version 5.0 vs 4.1

    - by Alex R
    Any ideas what could cause this? Scala signature Predef has wrong version Expected 5.0 found: 4.1 in .... scala-library.jar I tried both versions 2.7.6 and 2.8 RC1 of scala-*.jar, the result was the same. JDK is 1.6.u20. UPDATE Today uninstalled IntelliJ 9.0.1, and installed 9.0.2 Early Availability, with the 4/14 stable version of the Scala plug-in. Then I setup a project from scratch through the wizards: new project from scratch JDK is 1.6.u20 accept the default (project) instead of global / module accept the download of Scala 2.8.0beta1 into project's lib folder Created a new class: object hello { def main(args: Array[String]) { println("hello: " + args); } } For my efforts, I now have a brand-new error :) Here it is: Scalac internal error: class java.lang.ClassNotFoundException [java.net.URLClassLoader$1.run(URLClassLoader.java:202), java.security.AccessController.doPrivileged(Native Method), java.net.URLClassLoader.findClass(URLClassLoader.java:190), java.lang.ClassLoader.loadClass(ClassLoader.java:307), sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301), java.lang.ClassLoader.loadClass(ClassLoader.java:248), java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:169), org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:72)] Thanks

    Read the article

  • How to merge two xml files in classic asp?

    - by Alex
    hi i using classic asp in my project i wand to merge two xml's together? how i merge xml's togethe? Below is my sample code XML 1 <?xml version="1.0" encoding="ISO-8859-1" ?> <CATALOG> <CD> <TITLE>1</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD> <CD> <TITLE>2</TITLE> <ARTIST>Bonnie Tyler</ARTIST> <COUNTRY>UK</COUNTRY> <COMPANY>CBS Records</COMPANY> <PRICE>9.90</PRICE> <YEAR>1988</YEAR> </CD> <CD> <TITLE>3</TITLE> <ARTIST>Dolly Parton</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>RCA</COMPANY> <PRICE>9.90</PRICE> <YEAR>1982</YEAR> </CD> </CATALOG> XML2 <?xml version="1.0" encoding="ISO-8859-1" ?> <CATALOG> <CD> <TITLE>4</TITLE> <ARTIST>Gary Moore</ARTIST> <COUNTRY>UK</COUNTRY> <COMPANY>Virgin records</COMPANY> <PRICE>10.20</PRICE> <YEAR>1990</YEAR> </CD> <CD> <TITLE>5</TITLE> <ARTIST>Eros Ramazzotti</ARTIST> <COUNTRY>EU</COUNTRY> <COMPANY>BMG</COMPANY> <PRICE>9.90</PRICE> <YEAR>1997</YEAR> </CD> <CD> <TITLE>6</TITLE> <ARTIST>Bee Gees</ARTIST> <COUNTRY>UK</COUNTRY> <COMPANY>Polydor</COMPANY> <PRICE>10.90</PRICE> <YEAR>1998</YEAR> </CD> </CATALOG> This is asp code, now i use <% Dim doc1 'As MSXML2.DOMDocument30 Dim doc2 'As MSXML2.DOMDocument30 Dim doc2Node 'As MSXML2.IXMLDOMNode Set doc1 = createobject("MSXML2.DOMDocument.3.0") Set doc2 = createobject("MSXML2.DOMDocument.3.0") doc1.Load "01.xml" doc2.Load "02.xml" For Each doc2Node In doc2.documentElement.childNodes doc1.documentElement.appendChild doc2Node Next response.write doc1.xml %> Now i getting an error Microsoft VBScript runtime error '800a01a8' Object required: 'documentElement'

    Read the article

  • Is there an online tester for xPath selectors?

    - by alex
    I know there are some online regex evaluators.. very useful, matching in real time. They are like web applications of RegexBuddy. I was wondering if there is a similar thing for xPath selectors? I am just learning them and it would be valuable to me. Is there an online tester that allows you to input XML and then an xPath selector and match (live would be better, but I doubt someone has written a JavaScript interpreter?) them? Thanks

    Read the article

  • How to build n-layered web architecture with PHP?

    - by Alex
    I have a description and design of a website and I need to redesign it to allow for new requirements. The website's purpose is the offering of government's contracts and bidding opportunities for different businesses.I'm dealing with the 3-tier architecture PHP website comprising of the user-interface tier(client's web browser),business logic layer(Apache web server with PHP engine in it and a couple of applications running within a web server as well) and a database layer(local mysql database). Now,i need to redesign it to su???rt distributed n-tier architecture and specify how I would go about it.After long hours of research i came to this solution: business logic should be separated into presentation and purely business logic tier to allow for n-layer architecture(user-interface,presentation tier,b.logic and data tier).I have decided to use ??? just for the presentation(since the original existing website is in PHP) and use it within apache web server.In the business logic i want to use J2?? implementation technology instead of implementing it in PHP(i.e using Zend app.server and smarty template) cz J2EE can provide much more essential container services which are essential for business logic,its robustness,maintainability and different critical business operations which will be carried out by the g?v?rnment's website.So,particularly,i want to use J??ss app.server with ?J? business objects in it which would provide all the b.logic in java and would interact with the database and so forth.In order to connect PHP on a web server with java on app.server i'm gonna use PHP/Java bridge API (or maybe Quercus or SOAP is better?).Finally,i have my data tier with mysql which will communicate with b.logic via JD??.Payment system application in ???.server is gonna use S??? to talk with credit card company. From your professional point of view,does it sound like a good way of redesigning the original website to allow for n-tier architecture considering the specifics of the website and the criticality of its operations?(payment system is included in it)or u would personally prefer to use PHP business objects for business logic as well instead of J2EE?If you have any wiser recommendation or some alternative,please let me know what is right or wrong in my current solution. H??? to hear your professional advice very s??n (I'm new to the area of web development) Thanks in advance

    Read the article

  • Is currying just a way to avoid inheritance?

    - by Alex Mcp
    So my understanding of currying (based on SO questions) is that it lets you partially set parameters of a function and return a "truncated" function as a result. If you have a big hairy function takes 10 parameters and looks like function (location, type, gender, jumpShot%, SSN, vegetarian, salary) { //weird stuff } and you want a "subset" function that will let you deal with presets for all but the jumpShot%, shouldn't you just break out a class that inherits from the original function? I suppose what I'm looking for is a use case for this pattern. Thanks!

    Read the article

  • In Scala, when is (A,A)=>R not equivalent to Function2 ?

    - by Alex R
    I'm trying to define and use my own foreach function. This is in the middle of a larger block of code. But the essence of the error I'm getting is this: test_2.scala:32: error: type mismatch; found : (A, A) = Unit required: Function2 $amount.foreach( (k:A,v:A) = { How is this error conceivably possible? Isn't (A, A) => Unit always a subtype of Function2 regardless of what else might be going on in the code?

    Read the article

  • Is it possible to calculate distance on GeoDjango in a SELECT statement?

    - by alex
    I am using MYSQL. I have a table with 1 column, a Point field. I want to SELECT all rows that have a point with a distance less than 50 meters of my given point. Simple enough, right? Below is how it's done in RAW SQL. But of course, I want to use GeoDjango to do this. cursor.execute("SELECT * FROM project_location WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < 50)\

    Read the article

  • Using python to play two sin tones at once

    - by Alex
    Im using python to a sine tone. the tone is based off the computers internal time in minutes, but id like to simultaneously play one based off the second for a harmonized or dualing sound. This is what I have so far can someone point me in the right direction. from struct import pack from math import sin, pi import time def au_file(name, freq, dur, vol): fout = open(name, 'wb') # header needs size, encoding=2, sampling_rate=8000, channel=1 fout.write('.snd' + pack('>5L', 24, 8*dur, 2, 8000, 1)) factor = 2 * pi * freq/8000 # write data for seg in range(8 * dur): # sine wave calculations sin_seg = sin(seg * factor) fout.write(pack('b', vol * 127 * sin_seg)) fout.close() t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis * 100 tim = float(ti) tim = tim * 100 if name == 'main': au_file(name='timeSound1.au', freq = tim, dur=1000, vol=1.0) import os os.startfile('timeSound1.au')

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >