Search Results

Search found 2672 results on 107 pages for 'michael aquilina'.

Page 77/107 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • code-style: Is inline initialization of JS objects ok?

    - by michael
    I often find myself using inline initialization (see example below), especially in a switch statement when I don't know which case loop will hit. I find it easier to read than if statements. But is this good practice or will it incur side-effects or a performance hit? for (var i in array) { var o = o ? o : {}; // init object if it doesn't exist o[array[i]] = 1; // add key-values } Is there a good website to go to get coding style tips?

    Read the article

  • Hibernate without primary keys generated by db?

    - by Michael Jones
    I'm building a data warehouse and want to use InfiniDB as the storage engine. However, it doesn't allow primary keys or foreign key constraints (or any constraints for that matter). Hibernate complains "The database returned no natively generated identity value" when I perform an insert. Each table is relational, and contains a unique integer column that was previously used as the primary key - I want to keep that, but just not have the constraint in the db that the column is the primary key. I'm assuming the problem is that Hibernate expects the db to return a generated key. Is it possible to override this behaviour so I can set the primary key field's value myself and keep Hibernate happy? -- edit -- Two of the mappings are as follows: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated Jun 1, 2010 2:49:51 PM by Hibernate Tools 3.2.1.GA --> <hibernate-mapping> <class name="com.example.project.Visitor" table="visitor" catalog="orwell"> <id name="id" type="java.lang.Long"> <column name="id" /> <generator class="identity" /> </id> <property name="firstSeen" type="timestamp"> <column name="first_seen" length="19" /> </property> <property name="lastSeen" type="timestamp"> <column name="last_seen" length="19" /> </property> <property name="sessionId" type="string"> <column name="session_id" length="26" unique="true" /> </property> <property name="userId" type="java.lang.Long"> <column name="user_id" /> </property> <set name="visits" inverse="true"> <key> <column name="visitor_id" /> </key> <one-to-many class="com.example.project.Visit" /> </set> </class> </hibernate-mapping> and: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated Jun 1, 2010 2:49:51 PM by Hibernate Tools 3.2.1.GA --> <hibernate-mapping> <class name="com.example.project.Visit" table="visit" catalog="orwell"> <id name="id" type="java.lang.Long"> <column name="id" /> <generator class="identity" /> </id> <many-to-one name="visitor" class="com.example.project.Visitor" fetch="join" cascade="all"> <column name="visitor_id" /> </many-to-one> <property name="visitId" type="string"> <column name="visit_id" length="20" unique="true" /> </property> <property name="startTime" type="timestamp"> <column name="start_time" length="19" /> </property> <property name="endTime" type="timestamp"> <column name="end_time" length="19" /> </property> <property name="userAgent" type="string"> <column name="user_agent" length="65535" /> </property> <set name="pageViews" inverse="true"> <key> <column name="visit_id" /> </key> <one-to-many class="com.example.project.PageView" /> </set> </class> </hibernate-mapping>

    Read the article

  • How to call a specific, unknown Python object attribute?

    - by Michael Morisy
    I'm working to create a simple Python script that will ultimately tell you how many blog entries were posted in a given month, and the pyblog app is proving very helpful. However, when I create the blog object, I don't know how to access it's various attributes. I can print them all out by printing one item from the dictionary, as shown (in excerpts) below: print blog.get_recent_posts(1) 'post_status': 'publish', 'date_created_gmt': <DateTime '20100601T19:27:17' at 2853300>, 'mt_excerpt': '', 'userid': '288', 'dateCreated': <DateTime '20100601T14:27:17' at 2853350>, 'custom_fields': [{'value': '', 'id': '1317', 'key': 'brightcove_code'}, {'value': 'http://bit.ly/d0Rywl', 'id': '1403', But how can I just get it to provide that DateTime information?

    Read the article

  • Use .NET in VB6 or classical ASP

    - by Michael
    Duplicate of Calling .NET methods from VB6 via COM visible DLL Which ways exist to use/call .NET classes/functions/libraries (.net 3.x) in VB6 or classical ASP ? Has anybody experiences with that ? How much effort is necessary to wrap .NET to COM ? Are there tools which help ?

    Read the article

  • Database Structure for CakePHP Models

    - by Michael T. Smith
    We're building a data tracking web app using CakePHP, and I'm having some issues getting the database structure right. We have Companies that haveMany Sites. Sites haveMany DataSamples. Tags haveAndBelongToMany Sites. That is all set up fine. The problem is "ranking" the sites within tags. We need to store it in the database as an archive. I created a Rank model that is setup like this: rank ( id (int), sample_id (int), tag_id (int), site_id (int), rank (int), total_rows) ) So, the question is, how do I create the associations for tag, site and sample to rank? I originally set them as haveMany. But the returned structures don't get me where I'd like to be. It looks like: [Site] => Array ( [Sample] = Array(), [Tag] = Array() ) When I'm really looking for: [Site] => Array ( [Tag] = Array ( [Sample] => Array ( [Rank] => Array ( ...data... ) ) ) ) I think that I may not be structuring the database properly; so if I need to update please let me know. Otherwise, how do I write a find query that gets me where I need to be? Thanks! Thoughts? Need more details? Just ask!

    Read the article

  • What are real-world examples of Gradle's dependency graph?

    - by Michael Easter
    As noted in the documentation, Gradle uses a directed acyclic graph (DAG) to build a dependency graph. From my understanding, having separate cycles for evaluation and execution is a major feature for a build tool. e.g. The Gradle doc states that this enables some features that would otherwise be impossible. I'm interested in real-world examples that illustrate the power of this feature. What are some use-cases for which a dependency graph is important? I'm especially interested in personal stories from the field, whether with Gradle or a similarly equipped tool. I am making this 'community wiki' from the outset, as it will be difficult to assess a 'correct' answer.

    Read the article

  • best way to export data from pdfs

    - by michael
    Hi i work at a news paper and we are lookin a way to make archieve material available. Atm our pages come in pdf format so we need a way to export text and images from the pdf so that they can be added to a database. We've had a look at the News studio plugin for Adobe Acrobat from Iceni Technology, but just wondering if anyone else knows other options for exporting pdf data. thanks

    Read the article

  • Importing Python modules without installing - Sybase ASE

    - by Michael
    I need to use the Sybase Python module but our SA's won't install because it's not in the repo's. I've downloaded it and placed it on the box and would just like to 'import' or 'include' the module without installing it first. - Is this possible? From the looks of it (Sybase ASE) it needs some type of compilation before use. Is it possible for this type of work around?

    Read the article

  • Using static variables in Android

    - by michael
    Hi, In android, are using static variables a recommended practice? E.g, implementing a Singleton pattern in Java, I usually do: private static A the_instance; public static A getInstance() { if (the_instance == null) { the_instance = new A(); } return the_instance; } Also, when does this get cleaned up by the Android JVM? Thank you.

    Read the article

  • Looking for a good C++/.net

    - by Michael Minerva
    I have recently started to feel that I need to greatly improve my C++ skills especially in the realm of .net. I graduated from a good four year university with a degree in computer science about 9 months ago and I have since been doing full time contract work for a small software company in my local area. Most of my work has been done using Java/lisp/cocoa/XML and before that most of my programming in my senior year was in java/C#. I did a decent amount of C++ in my Sophomore year and in my free time before that but I feel that my general knowledge of C++/.net is very lacking for the opportunities that are now coming my way. Can anyone recommend a good book that could help me get up too speed? I feel I do not need a very basic introduction to C++ but something that covers the fundamentals of .net would be good for me. So basically what I need is a book or books that would be good for a .net novice and a C++ developer who is just beyond novice. Also, a book that would help bein an interview by giving me a conversional understanding of C++ would be great. Thanks a lot!.

    Read the article

  • Building NDK app with Android ADT on Windows

    - by Michael Sh
    While there are tons of information on the topic, there is no clear guide on how to compile C++ code in ADT. Is Cygwin is required? Where the build artifacts go? How to confogure the destination folder for the build package? Are there a debug and release versions? Is it possible to debug and step through the C++ code in ADT? Maybe it all is described in a single resource, then a link would be welcome!

    Read the article

  • As a scrum master introducing scrum to an organization, how do avoid also being product owner?

    - by Michael Rosario
    As a scrum master introducing scrum to an organization, how do avoid also being product owner? problem facts: List item I am working on a project as scrum master. Since the organization is new to scrum, I have assumed the role of setting meetings with stakeholders to form their system vision into user stories. At present, the stakeholders are not writing user stories. At present, our team is guessing what the most important stories should be with light confirmation from stakeholders. Is there anything more that I can do to move the product owner role away from myself?

    Read the article

  • How to serialize a graph ?

    - by Michael
    This is an interview question: How to serialize a graph ? I saw this answer but I am not sure if this is enough. It looks like a very confusing "open question" and the candidates are probably expected to ask more questions about the requirements: what the nodes and edges are, how they are serialized themselves, is this graph weighted, directed, etc., how many nodes/edges are in the graph.What about the infrastructure ? Is it a plain file system or we should/can use a database ? So, how would you answer this question ?

    Read the article

  • Cleaning up PHP Code

    - by Michael
    Hi, I've noticed I am a very sloppy coder and do things out of the ordinary. Can you take a look at my code and give me some tips on how to code more efficiently? What can I do to improve? session_start(); /check if the token is correct/ if ($_SESSION['token'] == $_GET['custom1']){ /*connect to db*/ mysql_connect('localhost','x','x') or die(mysql_error()); mysql_select_db('x'); /*get data*/ $orderid = mysql_real_escape_string($_GET['order_id']); $amount = mysql_real_escape_string($_GET['amount']); $product = mysql_real_escape_string($_GET['product1Name']); $cc = mysql_real_escape_string($_GET['Credit_Card_Number']); $length = strlen($cc); $last = 4; $start = $length - $last; $last4 = substr($cc, $start, $last); $ipaddress = mysql_real_escape_string($_GET['ipAddress']); $accountid = $_SESSION['user_id']; $credits = mysql_real_escape_string($_GET['custom3']); /*insert history into db*/ mysql_query("INSERT into billinghistory (orderid, price, description, credits, last4, orderip, accountid) VALUES ('$orderid', '$amount', '$product', '$credits', '$last4', '$ipaddress', '$accountid')"); /*add the credits to the users account*/ mysql_query("UPDATE accounts SET credits = credits + $credits WHERE user_id = '$accountid'"); /*redirect is successful*/ header("location: index.php?x=1"); }else{ /*something messed up*/ header("location: error.php"); }

    Read the article

  • How can I break if gdb is attached, but continue if it is not?

    - by Michael Anderson
    I have some debugging code that if executed while running with GBD attached should break the execution of the application, but if GDB is not running it should continue. The code I'm working with looks something like this in structure: try { if( some_complex_expression ) { gdb_should_berak_here(); do_some_stuff(); throw MyException(); } } catch( const MyException & e ) { handle_exception_and_continue(); } What should gdb_should_break_here be?

    Read the article

  • Error message when compiling while-loop expected identifier

    - by Michael Amici
    When trying to compile an infinite while loop in xcode iphone view based application, it gives me an error that reads expected identifier or '(' before 'while'. I made it as simple as possible. #import "Lockerz_NotifierViewController.h" @implementation Lockerz_NotifierViewController while (1=1) { NSLog(@"Hello? PLEASE HELP ME!!!!!!!!!!"); }

    Read the article

  • Why does Rails with Passenger/nginx only works in development mode? No logs available

    - by Michael W.
    Hey folks, I have a serious problem with one of our webservers... after having an internal alpha-testing with a mongrel/haproxy-cluster that worked well, we wanted to use nginx with passenger for our first production server (customers will access this server). However, I can only run the rails app via development mode with passenger/nginx. The app itself runs perfect with mongrel or webrick in production mode. My biggest problem with this case is that I don't find ANY information in the nginx or rails-logs (only when I use mongrel or webrick). Permissions are correct. Passenger-status shows that the app is running, but I always get the static 500.html-error page... It would be so nice if you guys could give me a hint and help me solve the problem. I put the config at the bottom of the post... This exact config works with rails_env development;but I'd like to use the production mode ;-) Thank you very much for your help! Version: Ubuntu 8.04.2 64bit / nginx-0.7.64 (compiled and installed via passenger-2.2.11) cat /opt/nginx/conf/nginx.conf user www-data; worker_processes 4; error_log logs/error.log; #pid logs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11; passenger_ruby /usr/bin/ruby1.8; passenger_log_level 3; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name <<servername>>; root /srv/app01/public; passenger_enabled on; }

    Read the article

  • How to extract ALL typedefs and structs and unions from c++ source

    - by Michael Wells
    I have inherited a Visual Studio project that contains hundreds of files. I would like to extract all the typedefs, structs and unions from each .h/.cpp file and put the results in a file). Each typdef/struct/union should be on one line in the results file. This would make sorting much easier. typdef int myType; struct myFirstStruct { char a; int b;...}; union Part_Number_Serial_Number_Part_2_Response_Message_Type {struct{Message_Response_Head_Type Head; Part_Num_Serial_Num_Part_2_Report_Array Part_2_Report; Message_Tail_Type Tail;} Data; BYTE byData[140];}myUnion; struct { bool c; int d;...}mySecondStruct; My problem is, I do not know what to look for (grammar of typedef/structs/unions) using a regular expression. I cannot believe that nobody has done this before (I googled and have not found anything on this). Does anyone know the regular expressions for these? (Note some are commented out using // others /* */) Or a tool to accomplish this. Edit: I am toying with the idea of autogenerating source code and/or dialogs for modifying messages that use the underlying typedef/struct/union. I was going to use the output to generate an XML file that could be used for this reason. The source for these are in C/C++ and used in almost all my projects. These projects are usually NOT in C/C++. By using the XML version I would only need to update/add the typedef/struct/union only in one place and all the projects would be able to autogen the source and/or dialogs.

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >