Search Results

Search found 1545 results on 62 pages for 'manipulation'.

Page 51/62 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Getting started with SQLite (Android)

    - by Tarmon
    Hey Everyone, I have limited SQL background, basically a small amount of manipulation through HTML and mostly with pre-existing databases. What I am trying to do is set up a database that will store time information for bus routes. So basically I have different routes with stops for each route and then a list of times that the bus arrives at each stop. Here is an example of a table of times from their website: Link. I am wondering what would be the best way to layout my database/tables? Also what is the purpose of the _id field in each table? Thanks, Rob! P.S. Sorry if my lack of knowledge on the subject has caused me to post a duplicate question.

    Read the article

  • user height and weight in sql

    - by Samuel
    We are planning to capture a user's height and weight and am looking for ideas on representing them in sql. I have the following questions in mind weight can be expressed in kilograms and grams and height in meters and centimeters, so should I capture them as a BigDecimal with an appropriate precision and scale or capture them as vanilla strings and do the manipulation in the user interface. Note: I am planning to capture the kilograms and grams separately in the user interface. should the metric of measurement be part of the sql (i.e. the end user might want to view this information in pounds, inches according to his preference) OR Should I just support kilograms / meters in the database and do the conversion while showing this in the user interface

    Read the article

  • Fast image coordinate lookup in Numpy

    - by victor
    I've got a big numpy array full of coordinates (about 400): [[102, 234], [304, 104], .... ] And a numpy 2d array my_map of size 800x800. What's the fastest way to look up the coordinates given in that array? I tried things like paletting as described in this post: http://opencvpython.blogspot.com/2012/06/fast-array-manipulation-in-numpy.html but couldn't get it to work. I was also thinking about turning each coordinate into a linear index of the map and then piping it straight into my_map like so: my_map[linearized_coords] but I couldn't get vectorize to properly translate the coordinates into a linear fashion. Any ideas?

    Read the article

  • How to prevent CAST errors on SSIS ?

    - by manitra
    Hello, The question Is it possible to ask SSIS to cast a value and return NULL in case the cast is not allowed instead of throwing an error ? My environment I'm using Visual Studio 2005 and Sql Server 2005 on Windows Server 2003. The general context Just in case you're curious, here is my use case. I have to store data coming from somewhere in a generic table (key/value structure with history) witch contains some sort of value that can be strings, numbers or dates. The structure is something like this : table Values { Id int, Date datetime, -- for history Key nvarchar(50) not null, Value nvarchar(50), DateValue datetime, NumberValue numeric(19,9) } I want to put the raw value in the Value column and try to put the same value in the DateValue column when i'm able to cast it to Datetime in the NumberValue column when i'm able to cast it to a number Those two typed columns would make all sort of aggregation and manipulation much easier and faster later. That's it, now you know why i'm asking this strange question. ============ Thanks in advance for your help.

    Read the article

  • c++ strings and file input

    - by Dalton Conley
    Ok, its been a while since I've done any file input or string manipulation but what I'm attempting to do is as follows while(infile >> word) { for(int i = 0; i < word.length(); i++) { if(word[i] == '\n') { cout << "Found a new line" << endl; lineNumber++; } if(!isalpha(word[i])) { word.erase(i); } if(islower(word[i])) word[i] = toupper(word[i]); } } Now I assume this is not working because skips the new line character?? If so, whats a better way to do this.

    Read the article

  • Question about regex in linux commands.

    - by smwikipedia
    I ran the following command at linux bash: apt-cache search hex.*(view|edit) My intention was to find any software packages whose name/description contains the pattern 'hex.*(view|edit)'. But among the results I got this: kipi-plugins - image manipulation/handling plugins for KIPI aware programs How could this be in the results list? I didn't see any matching string in this result. Is this a bug of the apt-cache search command? Or do I mis-understand how the regex is used by this command? Many thanks.

    Read the article

  • Java Or C++ Or What???

    - by Kronass
    Hi, My friends and I are starting a new project and we are shifting from windows to linux (for some reasons) and all of us are .Net background. for the new platform I decided to go with Java since many parts are similar with .Net but my friend is insisting on C++ saying it is much faster very mature and working with it will not effect on the productivity and development speed. The project that we will work on it will have threading, extensive string and datetime manipulation, some socket programing and of-course work with RDBMS (MySql Or Postgre not decided yet). I have some fears with java since oracle acquired sun and these people will do anything to make money out of it. some have advised in python and ruby and I like python but don't know should I make it the default language in this project. the project is not web application and we will make services and executables. what do you think, if you have other opinion you very welcome. Hint: Mono is not an option

    Read the article

  • Good ACL implementation in Java

    - by yonconf
    Hi All. I'm implementing a web based document management system and I'd like to implement ACLs in my system. My formal requirements are hierarchal permissions (documents inherit permissions from their folders) user groups (users can dynamically create groups and associate users with groups). Such groups can have permissions on objects in the system. My code will query permission on objects in two cases: 1. Manipulating a single document 2. Listing all documents where a manipulation is possible The latter requirement seems the achilles heel for Spring Security ACLs (their method seems likely to incur multiple DB hits for each document I manage) Anyone know of another ACL implementation? Thanks!

    Read the article

  • Is there another way to integrate PDF viewing in a Flex application?

    - by BCunningham
    I'm looking at ways to embed PDF viewing in a Flex application. Currently the only option I've seen is by using the flash.html.HTMLLoader class, which only works if you're using AIR. This isn't a big deal -- I'm willing to use AIR if I have to -- but based on my experimentation with viewing a PDF this way it appears that AIR simply integrates the embedded Adobe PDF browser Plug-in for viewing, which not only shows the PDF page(s), but provides all of the manipulation controls as well (zooming, printing, etc.) which I don't want to see. I'm looking for something that works somewhat along the lines of the JPedal library for Java -- an embedded component that simply renders the PDF alone. Has anyone found a way to do this with either AIR's built-in component or via some other method?

    Read the article

  • jQuery model-view-controller vs Spring MVC

    - by user1515968
    my question is what potential problems or difficulties would be with implementing usual web app with somewhat reach user interface (multiple dynamic tabs, accordians and so on) using jQuery MVC approach with Spring REST vs using Spring MVC. Problems what I can think of could be: I will not be able to use Spring security fully, JavaScript coding could become hard to manage, any form verification becomes not easy to manage... what else? and does jQuery MVC with REST make sense at all? On other side jQuery with MVC and REST move all GUI concerns to JavaScript side (whether it is bad or not) and leave all data manipulation to server side.

    Read the article

  • Grails unit testing and bootstrap

    - by tbruyelle
    I wrote an unit test for a controller. I have a Bootstrap file which alter the metaclass of domain classes by adding a method asPublicMap(). I use this method in the controller to return domain classes as json but only some selected public fields. My unit test failed because of MissingMethodException for asPublicMap(). As I understood, bootstrap classes are not loaded for unit tests, only for integration tests. That's why I got this error. My question is : Is there another place to put metaclass manipulation in order to take them into account during unit tests ?

    Read the article

  • How to ensure consistency of enums in Java serialization?

    - by Uri
    When I serialize an object, I can use the serialVersionUID mechanism at the class level to ensure the compatibility of the two types. However, what happens when I serialize fields of enum values? Is there a way to ensure that the enum type has not been manipulated between serialization and deserialization? Suppose that I have an enum like OperationResult {SUCCESS, FAIL}, and a field called "result" in an object that is being serialized. How do I ensure, when the object is deserialized, that result is still correct even if someone maliciously reversed the two? (Suppose the enum is declared elsewhere as a static enum) I am wondering out of curiosity - I use jar-level authentication to prevent manipulation.

    Read the article

  • What's the most auditable way to organize database maintenance scripting/scheduling?

    - by RenderIn
    I'm using PHP, Oracle and crontab. Crontab is invoking a php script, which is going to synchronize some data between a local and remote database. First I thought about putting this all in one large, anonymous inline PL/SQL block and executing it in PHP. The problem is that without creating a table to audit the procedure it's really opaque to my PHP code until it returns. And then when it does return, the best I can do is receive a string in an out parameter which I've concatenated together as an audit log. Then I considered breaking it up into several SQL statements and have PHP do some intermediate auditing/logging and manipulation of the data between each of them. I'm not really satisfied with either of these. How do you organize maintenance code that is called in a cronjob?

    Read the article

  • dealing with IO vs pure code in haskell

    - by Drakosha
    I'm writing a shell script (my 1st non-example in haskell) which is supposed to list a directory, get every file size, do some string manipulation (pure code) and then rename some files. I'm not sure what i'm doing wrong, so 2 questions: How should i arrange the code in such program? I have a specific issue, i get the following error, what am i doing wrong? error: Couldn't match expected type [FilePath]' against inferred typeIO [FilePath]' In the second argument of mapM', namelyfileNames' In a stmt of a 'do' expression: files <- (mapM getFileNameAndSize fileNames) In the expression: do { fileNames <- getDirectoryContents; files <- (mapM getFileNameAndSize fileNames); sortBy cmpFilesBySize files } code: getFileNameAndSize fname = do (fname, (withFile fname ReadMode hFileSize)) getFilesWithSizes = do fileNames <- getDirectoryContents files <- (mapM getFileNameAndSize fileNames) sortBy cmpFilesBySize files

    Read the article

  • Modify input stream data on the fly

    - by Frizi
    I would like to implement a std::stream modifier/parser, that is doing data manipulation on the fly. Is it possible to create it in form of stream manipulator? For example, i want to strip all the line comments (from any // to the end of line) out of the stdin and pass it to stdout. string str; istream strippingCin = cin >> stripcomments; while(strippingCin.good()) { strippingCin >> str; cout << str; } There may be also a large file input instead of cin, so i don't want to load full stream data into memory at once. Is it possible without writing my own stream class? Maybe is there another route i should take instead?

    Read the article

  • Method for SharePoint list/item locking across processes/machines?

    - by Steve
    In general, is there a decent way in SharePoint to control race conditions due to two processes or even two machines in the farm operating on the same list or list item at the same time? That is, is there any mechanism either built in or that can be fabricated via the Object Model for doing cross-process or cross-machine locking of individual list items? I want to write a timer job that performs a bunch of manipulations on a list. This list is written to by the SharePoint UI and then read by the UI. I want to be able to make sure that the UI doesn't either write to or read from the list when it is in an inconsistent state due to the timer job being in the middle of a manipulation. Is there any way to do this? Also, I want to allow for multiple instances of the timer job to run simultaneously. This, again, will require a lock to be sure that the two jobs don't attempt to operate on the same list/item at the same time. TIA for any help!

    Read the article

  • What's the most efficient way to manage large datasets with Javascript/jQuery in IE?

    - by RenderIn
    I have a search that returns JSON, which I then transform into a HTML table in Javascript. It repeatedly calls the jQuery.append() method, once for each row. I have a modern machine, and the Firefox response time is acceptable. But in IE 8 it is unbearably slow. I decided to move the transformation from data to HTML into the server-side PHP, changing the return type from JSON to HTML. Now, rather than calling the jQuery.append() time repeatedly, I call the jQuery.html() method once with the entire table. I noticed Firefox got faster, but IE got slower. These results are anecdotal and I have not done any benchmarking, but the IE performance is very disappointing. Is there something I can do to speed up the manipulation of large amounts of data in IE or is it simply a bad idea to process very much data at once with AJAX/Javascript?

    Read the article

  • TSQL - create a stored proc inside a transaction statement

    - by Chris L
    I have a sql script that is set to roll to production. I've wrapped the various projects into separate transactions. In each of the transactions we created stored procedures. I'm getting error messages Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'procedure'. I created this example script to illustrate Begin Try Begin Transaction -- do a bunch of add/alter tables here -- do a bunch of data manipulation/population here -- create a stored proc create procedure dbo.test as begin select * from some_table end Commit End Try Begin Catch Rollback Declare @Msg nvarchar(max) Select @Msg=Error_Message(); RaisError('Error Occured: %s', 20, 101,@Msg) With Log; End Catch The error seems to imply that I can't create stored procs inside of transaction, but I'm not finding any docs that say otherwise(maybe google isn't being freindly today).

    Read the article

  • Are sessions modifiable by the client/user?

    - by Sev
    In my PHP Web-App I use sessions to store the user's data. For exmaple, if a user logs in, then an instance of the User class is generated and stored in a Session. I have access levels associated with each user to determine their privileges. Store the user in a session by: $_SESSION['currentUser'] = new User($_POST['username']); For example: if($_SESSION['currentUser'] -> getAccessLevel() == 1) { //allow administration functions } where getAccessLevel() is simply a get method in the User class that returns the _accesslevel member variable. Is this secure? Or can the client somehow modify their access level through session manipulation of some sort?

    Read the article

  • Array-size macro that rejects pointers

    - by nneonneo
    The standard array-size macro that is often taught is #define ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0])) or some equivalent formation. However, this kind of thing silently succeeds when a pointer is passed in, and gives results that can seem plausible at runtime until things mysteriously fall apart. It's all-too-easy to make this mistake: a function that has a local array variable is refactored, moving a bit of array manipulation into a new function called with the array as a parameter. So, the question is: is there a "sanitary" macro to detect misuse of the ARRAYSIZE macro in C, preferably at compile-time? In C++ we'd just use a template specialized for array arguments only; in C, it seems we'll need some way to distinguish arrays and pointers. (If I wanted to reject arrays, for instance, I'd just do e.g. (arr=arr, ...) because array assignment is illegal).

    Read the article

  • Are there any real life uses for the Java byte primitive type?

    - by Thorbjørn Ravn Andersen
    For some inexplicable reason the byte primitive type is signed in Java. This mean that valid values are -128..127 instead of the usual 0..255 range representing 8 significant bits in a byte (without a sign bit). This mean that all byte manipulation code usually does integer calculations and end up masking out the last 8 bits. I was wondering if there is any real life scenario where the Java byte primitive type fits perfectly or if it is simply a completely useless design decision? EDIT: The sole actual use case was a single-byte placeholder for native code. In other words, not to be manipulated as a byte inside Java code.

    Read the article

  • Will Haskell be a good choice for my task?

    - by Narzanka
    I'm starting a new project and don't know which language to use. My 'must have' requirements are: Be able to run on Windows/LinuxMacOs natively (native executable) - user should be able to just run the exe (when on Windows for example) and see the results. No runtimes/interpreters (no jvm, clr, etc) - one file download should be enough to run the application. Full unicode support. Be able to manipulate OS threads (create them, run multiple tasks in parallel on multi-core CPUs, etc). Be reasonably fast (Python level performance and better). To have some kind of standard library that does low-level, mundane tasks. Not very niche and have some community behind it to be able to ask questions. My 'nice to have' requirements are: Language should be functional It should have good string manipulation capabilities (not necessarily regex) Not extremely hard to learn I'm thinking about Haskell now but keeping in mind OCaml as well. Please advice if my choice is correct.

    Read the article

  • Javascript Image object without instantiating

    - by user276027
    This question is about javascript performance. Consider 3 examples for illustration: function loadImgA() { new Image().src="http://example.com/image.gif" } function loadImgA1() { Image().src="http://example.com/image.gif" } function loadImgB() { var testImg = new Image(); testImg.src="http://example.com/image.gif" } Now the point is I don't really need to manipulate the the image object after it was created, hence loadImgA(). The question is, what happens if nothing is assigned to the return value of the new Image() constructor - in that case I can actually skip the 'new' keyword as in loadImgA1()? Does the object then live outside the function or somehow affects memory usage? Other implications, differences? I reckon not, as no real instance was actually created? To put this into perspective, I only need to get the http request for image through. No preloading or other advanced image manipulation. What would be the preferred method from the above?

    Read the article

  • Number 0 is not saving to database as a prefix in SQL Server of CHAR data type column

    - by gmhk
    I am trying to insert an value as '019393' into a table with a CHAR(10) column. It is inserting only '19393' into the database I am implementing this feature in a stored procedure, doing some manipulation like incrementing that number by 15 and saving it back with '0' as the prefix I am using SQL Server database Note: I tried CASTING that value as VARCHAR before saving to the database, but even that did not get the solution Code SELECT @fromBSB = fromBSB, @toBSB = toBSB, @type = Type FROM [dbo].[tbl_REF_SpecialBSBRanges] WHERE CAST(@inputFromBSB AS INT) BETWEEN fromBSB AND toBSB SET @RETURNVALUE = @fromBSB IF(@fromBSB = @inputFromBSB) BEGIN PRINT 'Starting Number is Equal'; DELETE FROM tbl_REF_SpecialBSBRanges WHERE Type = @type AND fromBSB = @fromBSB AND toBSB = @toBSB INSERT INTO [tbl_REF_SpecialBSBRanges] ([Type], [fromBSB], [toBSB]) VALUES(@type, CAST('0' + @fromBSB + 1 AS CHAR), @toBSB) INSERT INTO [tbl_REF_SpecialBSBRanges] ([Type], [fromBSB], [toBSB]) VALUES(@inputBSBName, @inputFromBSB, @inputToBSB) END

    Read the article

  • Trimming strings in Go

    - by user1263980
    I'm trying to read an entire line from the console (including whitespace), then process it. Using bufio.ReadString, the newline character is read together with the input, so I came up with the following code to trim the newline character: input,_:=src.ReadString('\n') inputFmt:=input[0:len(input)-2]+"" Is there a more idiomatic way to do this? That is, is there already a library that takes care of the ending null byte when extracting substrings for you? (Yes, I know there is already a way to read a line without the newline character in go readline -> string but I'm looking more for elegant string manipulation.)

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >