Search Results

Search found 2396 results on 96 pages for 'alex zylman'.

Page 65/96 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Implement loops for python 3

    - by Alex
    Implement this loop: total up the product of the numbers from 1 to x. Implement this loop: total up the product of the numbers from a to b. Implement this loop: total up the sum of the numbers from a to b. Implement this loop: total up the sum of the numbers from 1 to x. Implement this loop: count the number of characters in a string s. i'm very lost on implementing loops these are just some examples that i am having trouble with-- if someone could help me understand how to do them that would be awesome

    Read the article

  • How can I transform a DataTable in a group-by date DataTable with LINQ?

    - by alex
    I have a untyped DataTable that looks like this (srcTbl): date col_1 col_2 ... col_n 1.3.2010 00:00 12.5 0 ... 100 1.3.2010 01:00 0 0 ... 100 1.3.2010 22:00 0 0 ... 100 1.3.2010 23:00 12.5 0 ... 100 ... 31.3.2010 00:00 2 0 ... 100 31.3.2010 01:00 2 0 ... 200 I need to sum up the rows grouped by dates to get a DataTable like that (dstTbl): date, col_1 col_2 ... col_n 1.3.2010 15 0 ... 400 ... 31.3.2010 4 0 ... 300 Is this possible by using LINQ and if then how?

    Read the article

  • Java convert JSONObject to URL parameter

    - by Alex Ivasyuv
    What is the elegant way to convert JSONObject to URL parameters. For example, JSONObject: {stat: {123456: {x: 1, y: 2}, 123457: {z: 5, y: 2}}}} this should be like: stat[123456][x]=1&stat[123456][y]=2&stat[123457][z]=5&stat[123457][y]=2 of course with escaped symbols, and of course JSON object could be more complicated.. Maybe there already exist some mechanisms for that? Thanks,

    Read the article

  • Linq ChangeConflictException occurs when submitting DataContext changes

    - by Alex
    System.Data.Linq.ChangeConflictException: 2 of X updates failed. at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) at PROJECT.Controllers.HomeController.ClickProc(Int32 id, String code, String n) This is what I get very often. This action is done thousands of times a day, and I get this exception about once every 5 seconds. From what I understand it happens when something changes in the database in the period between creating DataContext and updating it. Am I right? How can I fix it? Update I just debugged the error and found the following: Table name: dbo.Stats current value: 9852039 original value: 9852038 database value: 9852039 The Stats table is updated constantly. So how can I still make LINQ save the changes. With "classical" SQL Server access through SqlDataCommand I never had problems like that.

    Read the article

  • How to use the vtable to determine class type

    - by Alex Silverman
    I was recently on an interview for a position where C/C++ is the primary language and during one question I was told that it's possible to use the vtable to determine which class in a hierarchy a base pointer actually stores. So if, for example you have class A { public: A() {} virtual ~A() {} virtual void method1() {} }; class B : public A { public: B() {} virtual ~B() {} virtual void method1() {} }; and you instantiate A * pFoo = new B(), is it indeed possible to use the vtable to determine whether pFoo contains a pointer to an instance of A or B?

    Read the article

  • Distributing a function over a single dimension of an array in MATLAB?

    - by Alex Feinman
    I often find myself wanting to collapse an n-dimensional matrix across one dimension, and can't figure out if there is a concise incantation I can use to do this. For example, when parsing an image, I often want to do something like this. (Note! Illustrative example only. I know about rgb2gray for this specific case.) img = imread('whatever.jpg'); s = size(img); for i=1:s(1) for j=1:s(2) bw_img = mean(img(i,j,:)); end end I would love to express this as something like: bw = on(color, 3, @mean); or bw(:,:,1) = mean(color); Is there a short way to do this?

    Read the article

  • Simple Scala syntax - trying to define "==" operator - what am I missing?

    - by Alex R
    While experimenting with some stuff on the REPL, I got to a point where I needed something like this: scala class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } Just a simple class with an "==" operator. Why doesn't it work??? Here's the result: :10: error: type mismatch; found : A required: ?{val x: ?} Note that implicit conversions are not applicable because they are ambiguous: both method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A] and method any2Ensuring in object Predef of type [A](x: A)Ensuring[A] are possible conversion functions from A to ?{val x: ?} class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } ^ This is scala 2.8 RC1. Thanks

    Read the article

  • Can't install a ruby gem because of an error?

    - by Alex
    Hey there, trying to install a ruby gem but I keep getting the following error: ERROR:failed to build gem native extension /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at/System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h I'm not exactly sure what is happening here. Is there anyone that knows what is going on and how to fix it? Thanks!

    Read the article

  • The question about the basics of LINQ to SQL working

    - by Alex
    I just started learning LINQ to SQL, and so far I'm impressed with the easy of use and good performance. I used to think that when doing LINQ queries like from Customer in DB.Customers where Customer.Age > 30 select Customer Get all customers from the database ("SELECT * FROM Customers"), move them to the Customers array and then make a search in that Array using .NET methods. This is very inefficient, what if there are hundreds of thousands of customers in the database? Making such big SELECT queries would kill the web application. Now after experiencing how actually fast LINQ to SQL is, I start to suspect that when doing that query I just wrote, LINQ somehow converts it to a SQL Query string SELECT * FROM Customers WHERE Age > 30 And only when necessary it will run the query. So my question is: am I right? And when is the query actually run? The reason why I'm asking is not only because I want to understand how it works in order to build good optimized applications, but because I came across the following problem. I have 2 tables, one of them is Books, the other has information on how many books were sold on certain days. My goal is to select books that had at least 50 sales/day in past 10 days. It's done with this simple query: from Book in DB.Books where (from Sale in DB.Sales where Sale.SalesAmount >= 50 and Sale.DateOfSale >= DateTime.Now.AddDays(-10) select Sale.BookID).Contains(Book.ID) select Book The point is, I have to use the checking part in several queries and I decided to create an array with IDs of all popular books: var popularBooksIDs = from Sale in DB.Sales where Sale.SalesAmount >= 50 and Sale.DateOfSale >= DateTime.Now.AddDays(-10) select Sale.BookID; BUT when I try to do the query now: from Book in DB.Books where popularBooksIDs.Contains(Book.ID) select Book It doesn't work! That's why I think that we can't use thins kinds of shortcuts in LINQ to SQL queries, like we can't use them in real SQL. We have to create straightforward queries, am I right?

    Read the article

  • In MS Access is there a way to allow forms to update while maintaning Read Only

    - by Alex
    I have several forms linked tables via queries. The form pull data such as sales and ratios by selecting a product from the main's form's combo box. I am however having to issues: 1- I would ultimately prefer the combo box to be a free entry; however by just entering in the box and hitting enter (not a button called “enter on a screen” which would initiate recalcs, just normal enter), while it does bring the new information in sub-forms it also changes the information in the original table. If I make the table read only that it just doesn't allow the form to work by saying that the table is read only. 2- The same Read only issue occurs when another user with read only rights tries to use the database. I understand that ready only is functioning as intended, however I am wondering if there is way to make some functions work while disallowing the updating. I am unfortunately learning on the go, so go easy plz. Thank you

    Read the article

  • Trying to start a service on boot on Android

    - by Alex
    I've been trying to start a service when a device boots up on android, but I cannot get it to work. I've looked a number of links online but none of the code is working. Am I forgetting something? This is my code. Manifest <receiver android:name=".StartServiceAtBootReceiver" android:enabled="true" android:exported="false" android:label="StartServiceAtBootReceiver"> <intent-filter> <action android:name="android.intent.action._BOOT_COMPLETED"/> </intent-filter> </receiver> <service android:enabled="true" android:name="com.test.RunService"/> Receiver OnReceive public void onReceive(Context context, Intent intent) { if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { Intent serviceLauncher = new Intent(context, RunService.class); context.startService(serviceLauncher); Log.v("TEST", "Service loaded at start"); } } Thanks,

    Read the article

  • Reinstantiating a GUI (JFrame) object

    - by Alex
    Hi guys, basically I want my JFrame to become a completely new JFrame object when an event is triggered. I have some code that basically calls [CODE]GUI gui = new GUI(x, y)[/CODE] the only problem I'm having is that as well as creating the new GUI object, it is not deleting the old window. Can anyone tell me how to get rid of the old window. Thanks.

    Read the article

  • Log information inside a JUnit Suite

    - by Alex Marinescu
    I'm currently trying to write inside a log file the total number of failed tests from a JUnite Suite. My testsuite is defined as follows: @RunWith(Suite.class) @SuiteClasses({Class1.class, Class2.class etc.}) public class SimpleTestSuite {} I tried to define a rule which would increase the total number of errors when a test fails, but apparently my rule is never called. @Rule public MethodRule logWatchRule = new TestWatchman() { public void failed(Throwable e, FrameworkMethod method) { errors += 1; } public void succeeded(FrameworkMethod method) { } }; Any ideas on what I should to do to achieve this behaviour?

    Read the article

  • Multiple Input From Keyboard C# WPF

    - by Alex
    I am writing a Tetris clone in WPF. If I hold down the right arrow key, the current piece shifts right. For playability, I want to allow the user to press another key (i.e. F-key) and rotate the moving piece without having to let go of the right arrow key first. Currently when I do this, the piece stops shifting. My first basic attempt at this was hooking into Window_PreviewKeyDown(object sender, KeyEventArgs e) and then sending a message to the controller layer. How do I structure my input-listening code to allow this? My current code Here

    Read the article

  • How to cancel a touch sequence

    - by Alex
    I have an UIImage view that responds to touch events. I want to cancel the touch sequence if the touch goes outside of certain bounds. How can I do that? I know that I can inspect the coordinates of the touch object, what I don't know is how to cancel the sequence. I don't see any event in the API that allows for that.

    Read the article

  • Incremental Compilation in Eclipse. ASTNode-s and SVN versioning

    - by Alex
    Hi there, I am building up some statistics after analyzing the source code in eclipse. But the overall process is too slow because i rebuild my model every time from scratch after each compilation. I am looking for a way to get only the changed parts of the code (as ASTNodes) and to rebuild just that part of my model. I suppose that even the changed compilation units and not the exact code elements would be enough after the user compiles and still would be a nice optimization. I am sure eclipse is capable of knowing what code elements are changed (and even to know their semantics), because when I use the subclipse plugin my changes are ordered by a code element (an import, a method, a variable declaration, etc). Well.. at least that plugin is capable of knowing that info. Thanks in advance

    Read the article

  • C# Get Keys from a Dictionary<string, Stream>

    - by alex
    Suppose I have a Dictionary like so: Dictionary<string, Stream> How can I get a list (or IEnumerable or whatever) of JUST the Keys from this dictionary? Is this possible? I could enumerate the dictionary, and extract the keys one by one, but I was hoping to avoid this. In my instance, the Dictionary contains a list of filenames (file1.doc, filex.bmp etc...) and the stream content of the file from another part of the application.

    Read the article

  • Using Time datatype in MySQL without seconds

    - by Alex
    I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?

    Read the article

  • ASP.NET MVC Route based on Web Browser/Device (e.g. iPhone)

    - by Alex
    Is it possible, from within ASP.NET MVC, to route to different controllers or actions based on the accessing device/browser? I'm thinking of setting up alternative actions and views for some parts of my website in case it is accessed from the iPhone, to optimize display and functionality of it. I don't want to create a completely separate project for the iPhone though as the majority of the site is fine on any device. Any idea on how to do this?

    Read the article

  • Errors/Warnings/Debug Info no longer appears in Debug Console

    - by Alex L
    Hi Guys: This one is driving me crazy. When I run my App and open the Debug Console there is nothing there! Nope, not even the output from my NSLog statements. Before I would see a bunch of debug information starting with [Session Started ...] and ending with 'Terminating in response to SpringBoard's termination'. The Status Bar at the bottom of the Console says my App was successfully launched. Even Errors and Warnings from my code no longer appear. How do I get this to show up again? Any help would be greatly appreciated.

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >