Search Results

Search found 79 results on 4 pages for 'gerardo rodriguez'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • How to maintain the log source host using logstash

    - by Ray Rodriguez
    I am following the steps in this blog to set up rsyslog + logstash + graylog2 and I can't figure out how to replace the @source_host attribute in logstash using the mutate - replace filter. In the exmaple the author replaces his @source_host with a string value but I'd like to use the actual value that is parsed from in this case a syslog. mutate { type => loc1 replace => ["@source_host", "loc1"] } mutate { type => loc2 replace => ["@source_host", "loc2"] } How do I actually maintain the original source host in my logs?

    Read the article

  • Installing VS2010 components with SP1 beta

    - by Jesus Rodriguez
    Hello, I hope this is the place for this kind of question. I have VS2010 ult with the Service Pack 1 beta installed. I want to play with F# and I need to install it. The problem is that because I have the SP1 installed, the VS DVD can't install the F# compiler. I click on add new feature, I click on F#, the installer says: "A selected drive is not longer valid. Please review your installation path settings before continuing with setup." Of course the path is correct and I can't change it anyway... I think that problem is because I have the SP1. I had the same problem in the past with VS2008 + SP1. What can I do? Uninstalling VS2010 is not an option, it take ages. Thank you.

    Read the article

  • One-Way Backup Service? [closed]

    - by Jon Rodriguez
    Up until a month ago, my girlfriend has used MobileMe to backup all the files on her MacBook. This turned out terribly when a quirk of MobileMe caused it to erase all of her files on MobileMe, and then sync the newly-erased MobileMe down to her computer, erasing everything. A week's worth of college essays and CS homework were gone. Now, I am terrified of any commercial cloud-backup solutions because of the possibility of this happening. Going off the list provided in these answers, could you please help me find a good backup service that is completely one-way? I want a service where there is literally not a single line of code that has the possibility of writing to my computer's drive. I want a pure one-way backup service.

    Read the article

  • Linking Listbox child categories

    - by Gerardo Abdo
    Hello I have few monhts working with aspx, and now I'm developing a shopping cart website. For the employee to upload the products on the DB, every product needs to be linked to a category and sub category, and sub-sub category, and so on. Sometimes the sub-sub categories are up to 5. For example Electronics-TV-LCD-Samsung-40 inches. First, What I would like to identify is if the SQL table has the apporpiate structure. I have 3 columns Id, Description, Parent_Id. Categories with Parent Id=0 is used for the top ones. Is this the best way to do it? Then I want to use the ListBox control to select main Categories, and once it is selected, filled a second listbox with its childs and so on. Do I need to query SQL DB everytime the change event happens? I heard about linq but have not used yet, What would be your suggestion to do this. If you have seen a sample to understand it better will be appreciated. Thank you

    Read the article

  • Mysqli connection trying with different users

    - by gerardo
    I'm trying to create a PHP class extending mysqli that is capable of connecting with another user if the connection fails. It is probably easier to explain with code: public function __construct() { $users = new ArrayObject(self::$user); $passwords = new ArrayObject(self::$pass); $itUser = $users->getIterator(); $itPass = $passwords->getIterator(); parent::__construct(self::$host, $itUser->current(), $itPass->current(), self::$prefix.self::$db); while($this->connect_errno && $itUser->valid()){ $itUser->next(); $itPass->next(); $this->change_user($itUser->current(), $itPass->current(), self::$prefix.self::$db); } if($this->connect_errno) throw new Exception("Error", $this->connect_errno); } $user and $pass are static variables containing arrays of users and passwords. If the first user fails to connect, I try with the next one. The problem here is with $this->connect_errno. It says it cannot find Mysqli. Is there any solution to this or should I create a Factory class?

    Read the article

  • Retrieve part of a MySQL column with PHP

    - by Gerardo Marset
    For instance, if I have the following table: +----+---+----------+ | id | a | position | +----+---+----------+ | 0 | 0 | 0 | | 1 | 0 | 1 | | 2 | 1 | 4 | | 3 | 1 | 9 | | 4 | 1 | 6 | | 5 | 1 | 1 | +----+---+----------+ and I want to get an array that contains the first 100 values from position where a is 1 in ascending order, what would I do? Im guessing something like this: $col = mysql_fetch_array( mysql_query(' SELECT `position` FROM `table` WHERE `a`="1" ORDER BY `position` ASC LIMIT 100 ')); I'd expect to get the following array: +-------+-------+ | index | value | +-------+-------+ | 0 | 1 | | 1 | 4 | | 2 | 6 | | 3 | 9 | +-------+-------+ but it doesn't work. ¿What should I do to make it work? Thanks

    Read the article

  • Optimize MySQL query (ngrams, COUNT(), GROUP BY, ORDER BY)

    - by Gerardo
    I have a database with thousands of companies and their locations. I have implemented n-grams to optimize search. I am making one query to retrieve all the companies that match with the search query and another one to get a list with their locations and the number of companies in each location. The query I am trying to optimize is the latter. Maybe the problem is this: Every company ('anunciante') has a field ('estado') to make logical deletes. So, if 'estado' equals 1, the company should be retrieved. When I run the EXPLAIN command, it shows that it goes through almost 40k rows, when the actual result (the reality matching companies) are 80. How can I optimize this? This is my query (XXX represent the n-grams for the search query): SELECT provincias.provincia AS provincia, provincias.id, COUNT(*) AS cantidad FROM anunciantes JOIN anunciante_invertido AS a_i0 ON anunciantes.id = a_i0.id_anunciante JOIN indice_invertido AS indice0 ON a_i0.id_invertido = indice0.id LEFT OUTER JOIN domicilios ON anunciantes.id = domicilios.id_anunciante LEFT OUTER JOIN localidades ON domicilios.id_localidad = localidades.id LEFT OUTER JOIN provincias ON provincias.id = localidades.id_provincia WHERE anunciantes.estado = 1 AND indice0.id IN (SELECT invertido_ngrama.id_palabra FROM invertido_ngrama JOIN ngrama ON ngrama.id = invertido_ngrama.id_ngrama WHERE ngrama.ngrama = 'XXX') AND indice0.id IN (SELECT invertido_ngrama.id_palabra FROM invertido_ngrama JOIN ngrama ON ngrama.id = invertido_ngrama.id_ngrama WHERE ngrama.ngrama = 'XXX') AND indice0.id IN (SELECT invertido_ngrama.id_palabra FROM invertido_ngrama JOIN ngrama ON ngrama.id = invertido_ngrama.id_ngrama WHERE ngrama.ngrama = 'XXX') AND indice0.id IN (SELECT invertido_ngrama.id_palabra FROM invertido_ngrama JOIN ngrama ON ngrama.id = invertido_ngrama.id_ngrama WHERE ngrama.ngrama = 'XXX') AND indice0.id IN (SELECT invertido_ngrama.id_palabra FROM invertido_ngrama JOIN ngrama ON ngrama.id = invertido_ngrama.id_ngrama WHERE ngrama.ngrama = 'XXX') GROUP BY provincias.id ORDER BY cantidad DESC And this is the query explained (hope it can be read in this format): id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY anunciantes ref PRIMARY,estado estado 1 const 36669 Using index; Using temporary; Using filesort 1 PRIMARY domicilios ref id_anunciante id_anunciante 4 db84771_viaempresas.anunciantes.id 1 1 PRIMARY localidades eq_ref PRIMARY PRIMARY 4 db84771_viaempresas.domicilios.id_localidad 1 1 PRIMARY provincias eq_ref PRIMARY PRIMARY 4 db84771_viaempresas.localidades.id_provincia 1 1 PRIMARY a_i0 ref PRIMARY,id_anunciante,id_invertido PRIMARY 4 db84771_viaempresas.anunciantes.id 1 Using where; Using index 1 PRIMARY indice0 eq_ref PRIMARY PRIMARY 4 db84771_viaempresas.a_i0.id_invertido 1 Using index 6 DEPENDENT SUBQUERY ngrama const PRIMARY,ngrama ngrama 5 const 1 Using index 6 DEPENDENT SUBQUERY invertido_ngrama eq_ref PRIMARY,id_palabra,id_ngrama PRIMARY 8 func,const 1 Using index 5 DEPENDENT SUBQUERY ngrama const PRIMARY,ngrama ngrama 5 const 1 Using index 5 DEPENDENT SUBQUERY invertido_ngrama eq_ref PRIMARY,id_palabra,id_ngrama PRIMARY 8 func,const 1 Using index 4 DEPENDENT SUBQUERY ngrama const PRIMARY,ngrama ngrama 5 const 1 Using index 4 DEPENDENT SUBQUERY invertido_ngrama eq_ref PRIMARY,id_palabra,id_ngrama PRIMARY 8 func,const 1 Using index 3 DEPENDENT SUBQUERY ngrama const PRIMARY,ngrama ngrama 5 const 1 Using index 3 DEPENDENT SUBQUERY invertido_ngrama eq_ref PRIMARY,id_palabra,id_ngrama PRIMARY 8 func,const 1 Using index 2 DEPENDENT SUBQUERY ngrama const PRIMARY,ngrama ngrama 5 const 1 Using index 2 DEPENDENT SUBQUERY invertido_ngrama eq_ref PRIMARY,id_palabra,id_ngrama PRIMARY 8 func,const 1 Using index

    Read the article

  • Custom Filter on Dynamic Data Website

    - by Gerardo Gala
    Hi All! I want to able to search on a column that is a foreign key to another table. I don't want to type in the ID (which is the foreign key). I want to search by name. For example, you have a Product Table and a Manufacturer Table. On the Products gridview, I want to be able to search the Manufacturer Name - not Manufacturer Id. But the Products gridview has ProductID. Thanks!

    Read the article

  • Does the concept of "magic number" change from language to language?

    - by Gerardo Marset
    Take the following code in C/C++, for example: int foo[] = {0, 0, 0, 0}; No magic numbers, right? Now, the Python "equivalent" of that would be: foo = [0, 0, 0, 0] Still no magic numbers. However, in Python, that same thing can be written like this: foo = [0] * 4 And now we DO have a magic number. Or do we? I'm guessing this and other similar things are present on these and other languages.

    Read the article

  • SQL Server Update Group by

    - by Gerardo Abdo
    I'm trying to execute this on MS-SQL but returns me an error just at the Group by line update #temp Set Dos=Count(1) From Temp_Table2010 s where Id=s.Total and s.total in (Select Id from #temp) group by s.Total Do anyone knows how can I solve this problem having good performance.

    Read the article

  • Can't access to a iSCSI volume

    - by jmiguel.rodriguez
    I have a iSCSI target on a customer place I'm using from an old Fedora (Core6) server. I configured it and formatted as ext3 (mistake, now I know) and I've been working with it for some time. Now I need to access this volume from other machine. As far as I've read, I can't do it safely from two machines at the same time (yep, that's the first thing I tried). So I've umount it from original server and tried to mount it on the new server (I did it at first with Ubuntu 10 LTS but when I was unable to do it I installed another Fedora with the same configuration) with no success. The problem: I can see all target on NAS but when I do a "fdisk -l" to see all devices and know which mount I see all targets as SFS filesystem. From the original server I see all SFS (after all, they belong to my customer and don't know what he have in) except the one I manage which I see as 'Linux'. What can I do? Thank you in advanced, regards, jmiguel

    Read the article

  • Silverlight Cream for April 30, 2010 -- #852

    - by Dave Campbell
    In this Issue: Michael Washington, Tim Greenfield, Jaime Rodriguez, and The WP7 Team. Shoutouts: Mike Taulty has a pretty complete set of links up for information about VS2010, Silverlight, Blend, Phone 7 Upgrade Christian Schormann announced Blend for Windows Phone: Update Available, and has other links up as well. From SilverlightCream.com: Silverlight Simplified MVVM Modal Popup Michael Washington is demonstrating a modal popup in MVVM and also shows the implementation of a value converter XPath support in Silverlight 4 + XPathPad Tim Greenfield blogged about XPath support in Silverlight 4 and his XPathPad tool... check out what all you can do with it... then go grab it, or the source too! Windows phone capabilities security model Jaime Rodriguez is discussing the WP7 capabilities exposed with the latest refresh such as location services, microphone, media library, gamer services, phone dialoer, push notification... how to code for them and other tips. Windows Phone 7 Series Developer Training Kit The WP7 Team is discussing the WP7 capabilities exposed with the latest refresh such as location services, microphone, media library, gamer services, phone dialoer, push notification... how to code for them and other tips. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Linq to SQL not inserting data onto the DB

    - by Jesus Rodriguez
    Hello! I have a little / weird behaviour here and Im looking over internet and SO and I didn't find a response. I have to admit that this is my first time using databases, I know how to use them with SQL but never used it actually. Anyway, I have a problem with my app inserting data, I just created a very simple project for testing that and no solution yet. I have an example database with Sql Server Id - int (identity primary key) Name - nchar(10) (not null) The table is called "Person", simple as pie. I have this: static void Main(string[] args) { var db = new ExampleDBDataContext {Log = Console.Out}; var jesus = new Person {Name = "Jesus"}; db.Persons.InsertOnSubmit(jesus); db.SubmitChanges(); var query = from person in db.Persons select person; foreach (var p in query) { Console.WriteLine(p.Name); } } As you can see, nothing extrange. It show Jesus in the console. But if you see the table data, there is no data, just empty. I comment the object creation and insertion and the foreach doesn't print a thing (normal, there is no data in the database) The weird thing is that I created a row in the database manually and the Id was 2 and no 1 (Was the linq really playing with the database but it didn't create the row?) There is the log: INSERT INTO [dbo].Person VALUES (@p0) SELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value] -- @p0: Input NChar (Size = 10; Prec = 0; Scale = 0) [Jesus] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.30729.4926 SELECT [t0].[Id], [t0].[Name] FROM [dbo].[Person] AS [t0] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.30729.4926 I am really confused, All the blogs / books use this kind of snippet to insert an element to a database. Thank you for helping.

    Read the article

  • ADO.NET Known Issues?

    - by Israel Rodriguez
    So, I'm starting a new Project in my company, and it's kinda big. We are going to use .NET 3.5, and I wish to known if there are any know bugs or perfomance issues that could give weird behaviour for my project? I'm reading some things about EFv4 and all they say is that EFv3.5 have too many problems. After all, what's the best and fastest way, ADO.NET Entities or extract the data from my DB directly to a DataReader? The EF Oracle provider is stable? The project will be .NET 3.5 and Oracle.

    Read the article

  • "SELECT ... FOR UPDATE" not working for Hibernate and MySQL

    - by Andres Rodriguez
    Hi, We have a system in which we must use pessimistic locking in one entity. We are using hibernate, so we use LockMode.UPGRADE. However, it does not lock. The tables are InnoDB We have checked that locking works correctly in the database (5.0.32), so this bug http://bugs.mysql.com/bug.php?id=18184 seems to be no problem. We have checked that datasource includes the autoCommit = false parameter. We have checked that the SQL hibernate (version 3.2) generates includes the " FOR UPDATE". Thanks,

    Read the article

  • Client connections with epoll

    - by Andres Rodriguez
    Hi, I'm programming an application(client/server) in C++ for linux using epoll y pthreads but I don't know how to handle the connect() calls for attach a new connection in the descriptor list if a loop with epoll_wait() is running(Edge-triggered), How to can I do it?... I could to use a dummy file descriptor to trigger an event and scape of wait?, or a simple call to connect() could fire the event??... Sorry for my bad english...

    Read the article

  • Unknown error when submit a REST request to Liferay json API

    - by r.rodriguez
    I'm writing an script in Python to automatically update the structures in my Liferay portal and I want to do it via the json REST API. I make a request to get an structure (method getStructure), and it worked. But when I try to do an structure update in the portal it shows me the following error: ValueError: Content-Length should be specified for iterable data of type class 'dict' {'serviceContext': "{'prueba'}", 'serviceClassName': 'com.liferay.portlet.journal.service.JournalStructureServiceUtil', 'name': 'FOO', 'xsd': '... THE XSD OBTAINED VIA JSON ...', 'serviceParameters': '[groupId,structureId,parentStructureId,name,description,xsd,serviceContext]', 'description': 'FOO Structure', 'serviceMethodName': 'updateStructure', 'groupId': '10133'} What I'm doing is the next: urllib.request.Request(url = URL, data = data_update, headers = headers) URL is http://localhost:8080/tunnel-web/secure/json The headers are configured with basic authentication (it works, it is tested with the getStructure method). Data is: data_update = { "serviceClassName" : "com.liferay.portlet.journal.service.JournalStructureServiceUtil", "serviceMethodName" : "updateStructure", "serviceParameters" : "[groupId,structureId,parentStructureId,name,description,xsd,serviceContext]", "groupId" : 10133, "name" : FOO, "description" : FOO Structure, "xsd" : ... THE XSD OBTAINED VIA JSON ..., "serviceContext" : "{}" } Does anybody know the solution? Have I to specify the length for the dictionary and how? Or this is a bug?

    Read the article

  • May volatile be in user defined types to help writing thread-safe code

    - by David Rodríguez - dribeas
    I know, it has been made quite clear in a couple of questions/answers before, that volatile is related to the visible state of the c++ memory model and not to multithreading. On the other hand, this article by Alexandrescu uses the volatile keyword not as a runtime feature but rather as a compile time check to force the compiler into failing to accept code that could be not thread safe. In the article the keyword is used more like a required_thread_safety tag than the actual intended use of volatile. Is this (ab)use of volatile appropriate? What possible gotchas may be hidden in the approach? The first thing that comes to mind is added confusion: volatile is not related to thread safety, but by lack of a better tool I could accept it. Basic simplification of the article: If you declare a variable volatile, only volatile member methods can be called on it, so the compiler will block calling code to other methods. Declaring an std::vector instance as volatile will block all uses of the class. Adding a wrapper in the shape of a locking pointer that performs a const_cast to release the volatile requirement, any access through the locking pointer will be allowed. Stealing from the article: template <typename T> class LockingPtr { public: // Constructors/destructors LockingPtr(volatile T& obj, Mutex& mtx) : pObj_(const_cast<T*>(&obj)), pMtx_(&mtx) { mtx.Lock(); } ~LockingPtr() { pMtx_->Unlock(); } // Pointer behavior T& operator*() { return *pObj_; } T* operator->() { return pObj_; } private: T* pObj_; Mutex* pMtx_; LockingPtr(const LockingPtr&); LockingPtr& operator=(const LockingPtr&); }; class SyncBuf { public: void Thread1() { LockingPtr<BufT> lpBuf(buffer_, mtx_); BufT::iterator i = lpBuf->begin(); for (; i != lpBuf->end(); ++i) { // ... use *i ... } } void Thread2(); private: typedef vector<char> BufT; volatile BufT buffer_; Mutex mtx_; // controls access to buffer_ };

    Read the article

  • Using local classes with STL algorithms

    - by David Rodríguez - dribeas
    I have always wondered why you cannot use locally defined classes as predicates to STL algorithms. In the question: Approaching STL algorithms, lambda, local classes and other approaches, BubbaT mentions says that 'Since the C++ standard forbids local types to be used as arguments' Example code: int main() { int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; std::vector<int> v( array, array+10 ); struct pair : public std::unary_function<int,bool> { bool operator()( int x ) { return !( x % 2 ); } }; std::remove_if( v.begin(), v.end(), pair() ); // error } Does anyone know where in the standard is the restriction? What is the rationale for disallowing local types?

    Read the article

  • Project tracking/management tool

    - by Alvaro Rodriguez
    Which project tracking tool do you use? Does it allow programmers to bill hours worked to projects/tasks? Does it allow to track items promised vs. items delivered? Does it allow to forecast personnel needs when you have only a ballpark estimate of how many hours you are going to need for different task types? Does it integrate with your bug tracker? [Mantis] Does it integrate with your source control tool? [Subversion] Does it allow you to easily publish your schedule and current priorities to team members? Does it produce reports on any or all of the above? Am I even right in calling a tool that does those things a "Project tracking/management tool"? What does your tool have that makes you love it and use it every day? I don't really care about Gantt charts. I find Microsoft Project quite clunky for this needs (although I'm hardly an expert user).

    Read the article

  • Join + IEqualityComparer<T> and HashCode

    - by Jesus Rodriguez
    Im writing my own LINQ reference but Im getting troubles with some of the more complicated operators implementations. There is a Join implementation that takes a IEqualityComparer Im getting just crazy. Im trying to understand it first before I write (obviously) Image this two lists: List<string> initials = new List<string> {"A", "B", "C", "D", "E"}; List<string> words = new List<string> {"Ant", "Crawl", "Pig", "Boat", "Elephant", "Arc"}; Nothing weird here. I want to join both lists by the Initial, something like: Initial=A Word=Ant Initial=A Word=Arc Initial=B Word=Boat ... I need a comparator, I wrote this: public class InitialComparator : IEqualityComparer<string> { public bool Equals(string x, string y) { return x.StartsWith(y); } public int GetHashCode(string obj) { return obj[0].GetHashCode(); } } The Join itself: var blah = initials.Join(words, initial => initial, word => word, (initial, word) => new {Initial = initial, Word = word}, new InitialComparator()); It's the first time Im using HashCodes, after a good session of debugging I see that every word go to the comparator and look at its HashCode, if another word has the same HashCode it calls equals. Since I want to compare just the initial I though that I just need the first letter Hash (Am I wrong?) The thing is that this is not working correctly. Its says that "Ant" and "Arc" are equals, Ok, its comparing every word in the same list or not, But it adds only the last word it finds, in this case Arc, ignoring Ant and Ant is equals to "A" too... If I put "Ant" and "Ant" it add both. In short, What is the way of doing something like that? I know that Im doing something wrong. Thank you.

    Read the article

  • Why does virtual assignment behave differently than other virtual functions of the same signature?

    - by David Rodríguez - dribeas
    While playing with implementing a virtual assignment operator I have ended with a funny behavior. It is not a compiler glitch, since g++ 4.1, 4.3 and VS 2005 share the same behavior. Basically, the virtual operator= behaves differently than any other virtual function with respect to the code that is actually being executed. struct Base { virtual Base& f( Base const & ) { std::cout << "Base::f(Base const &)" << std::endl; return *this; } virtual Base& operator=( Base const & ) { std::cout << "Base::operator=(Base const &)" << std::endl; return *this; } }; struct Derived : public Base { virtual Base& f( Base const & ) { std::cout << "Derived::f(Base const &)" << std::endl; return *this; } virtual Base& operator=( Base const & ) { std::cout << "Derived::operator=( Base const & )" << std::endl; return *this; } }; int main() { Derived a, b; a.f( b ); // [0] outputs: Derived::f(Base const &) (expected result) a = b; // [1] outputs: Base::operator=(Base const &) Base & ba = a; Base & bb = b; ba = bb; // [2] outputs: Derived::operator=(Base const &) Derived & da = a; Derived & db = b; da = db; // [3] outputs: Base::operator=(Base const &) ba = da; // [4] outputs: Derived::operator=(Base const &) da = ba; // [5] outputs: Derived::operator=(Base const &) } The effect is that the virtual operator= has a different behavior than any other virtual function with the same signature ([0] compared to [1]), by calling the Base version of the operator when called through real Derived objects ([1]) or Derived references ([3]) while it does perform as a regular virtual function when called through Base references ([2]), or when either the lvalue or rvalue are Base references and the other a Derived reference ([4],[5]). Is there any sensible explanation to this odd behavior?

    Read the article

  • how to link table to table

    - by Niño Seymour L. Rodriguez
    I am a comsci student and I'm taking up database now. I got a problem in or should I say I dont know how to link table to table. It is not like you'll just use a foreign key and connect it to the primary key. The outcome should be like this: In the table Course there are three fields namely "course_id", "Description" and "subjects". When you click the name field Subject, a table named Subject should appear. Can you help me with this? hope you understnd my grammar, hehe..im not good in english......it will be a big help if you can answer it.........thank you po..............

    Read the article

< Previous Page | 1 2 3 4  | Next Page >