Daily Archives

Articles indexed Wednesday April 7 2010

Page 4/131 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • compilation error: request member in something not a structure of union

    - by Fantastic Fourier
    Hi everybody, I'm having the above error request member rv in something not a structure of union. I've googled it and several answers told me it's when working with a pointer but tries to access it as a struct, where I should be using -> instead of . int foo(void * arg, struct message * msg) { struct fd_info * info = (struct something *) arg; int * socks[MAX_CONNECTION]; socks = &(info->_socks); // where int * _socks[MAX_CONNECTION] in struct info // do other things rv = sendto(socks[i], &msg, sizeof(&msg), NULL, &(csys->client_address), sizeof(csys->client_address)); ... } The problem is all of the arguments i have are pointers. i'm confused as to what is wrong. thanks to any comments/thoughts.

    Read the article

  • undefined C/C++ symbol as operator

    - by uray
    I notice that the character/symbol '`' and '@' is not used as an operator in C/C++, does anyone know the reason or historically why its so? if its really not used, is it safe to define those symbols as another operator/statement using #define?

    Read the article

  • C++ and,or,not,xor keywords [closed]

    - by uray
    Possible Duplicate: The written versions of the logical operators. I notice that C++ define keyword and, or, not, xor, and_eq, or_eq, not_eq and xor_eq as an alternative to &&, ||, !, ^, &=, |=, != and |=. and they're rarely used! What's wrong? Are they not portable?

    Read the article

  • Reports in MS Access after compiling into MDE file

    - by devnet
    I am currently working on a MS Access 2003 mdb file which is converted to an mde file before being published. How do I go about enabling the reports function of MS Access once this is converted? or better still is there a alternative to the reporting in MS Access? opensouce or free? Thanks in advnace. MB

    Read the article

  • Need a jQuery Lightbox plugin that supports $.live() and grouping

    - by Throlkim
    I'm bringing in all of my images via Ajax, and I'm looking for a quick fix for the front-end of this project. I've tried a couple of jQuery lightbox plugins, but I can't seem to get them to perform in a live function (correct me if I'm wrong in thinking I need to do this). Currently attempting to use Balupton's Lightbox Plugin (can't link because of my being a new user), and after trying all of the examples to no avail, I've attempted it with this (also not working): $('a.lightbox-gallery').live('click', function(){ $(this).lightbox(); }); Any help is much appreciated!

    Read the article

  • Usage of ||, OR in PHP

    - by shin
    I have the following code which redirect pages depends on $path. ... $path = $this->uri->segment(3); $pathid = $this->uri->segment(4); if($path=='forsiden'){ redirect('','refresh'); }elseif($path =='contact'){ redirect('welcome/kontakt','refresh'); }elseif($path =='illustration'){ $this->_gallery($path,$pathid); }elseif($path =='webdesign'){ redirect('welcome/webdesign','refresh'); }elseif($path==('web_tjenester' || 'webdesigndetails' || 'vismahjemmeside' || 'joomla' || 'vismanettbutikk' || 'vpasp' || 'artportfolio')){ ... CODE A ... }else{ ... CODE B ... } I am not getting right results with $path==('web_tjenester' || 'webdesigndetails' || 'vismahjemmeside' || 'joomla' || 'vismanettbutikk' || 'vpasp' || 'artportfolio') contact, illustration, gallery and webdesign are redirected and working alright. However all other pages are added CODE A. I am expecting CODE A only when $path is web_tjenester', 'webdesigndetails', 'vismahjemmeside', 'joomla', 'vismanettbutikk', 'vpasp' or 'artportfolio'. Could anyone point out my mistake and correct me please? Thanks in advance. --UPDATE-- The following works, but is there any ways shorten the code? I am repeating ($path==..). elseif(($path=='web_tjenester') || ($path=='webdesigndetails') || ($path=='vismahjemmeside') || ($path=='joomla') || ($path=='vismanettbutikk') || ($path=='vpasp') || ($path=='artportfolio')){

    Read the article

  • Native (non-jqueryui) way to set prompt() input field inline.

    - by Anthony
    I might just be using the wrong keywords on Google, but what I have in mind is: -------------------------------- | What is your mailbox? | | | | [ ]@mail.example.org | | | | [OK] [Cancel] | -------------------------------- The idea being that the input field is followed right behind by the mail server name, to help avoid instances where: If I don't make it follow right behind, the user puts in the whole thing, If I default it to "[email protected]" they delete the server name. In either case, it's not too big a deal, as I will know that if the returned value does have the server, to remove it and if doesn't, I know what server it belongs to, but I think this visual aid will be a better user experience and lower the amount of validation worries I tend to get.

    Read the article

  • Adjust CSS of all cells of a specific table without giving each cell a unique id?

    - by javanix
    Is there any way to modify the CSS properties of one table's cells based on the table's ids, rather than specific child ids? I would like to change one table's appearance (giving each cell a colored border, for instance) one way, and another table another way, but I'd like to avoid specifying an id for each cell. To be clear, I don't need to individually access each cell in the table - I just want to set all of the properties of "child" cells of various tables.

    Read the article

  • Order Multidimensional Arrays PHP

    - by ronsandova
    Hi everyone I have some problem to order an array by a field of this, here i leave the example foreach($xml as $site){ echo '<div><a href="'.$site->loc.'">'.$site->loc.'</a>' .$site->padre.'</div>'; } Some times the filed $site->padre is empty but i'd like to order by $site->padre alphabetical i saw example with usort but i don't understand how to work it. Thanks in advance. Cheers

    Read the article

  • Php plugin to replace '->' with '.' as the member access operator ? Or even better: alternative synt

    - by Gigi
    Present day usable solution: Note that if you use an ide or an advanced editor, you could make a code template, or record a macro that inserts '->' when you press Ctrl and '.' or something. Netbeans has macros, and I have recorded a macro for this, and I like it a lot :) (just click the red circle toolbar button (start record macro),then type -> into the editor (thats all the macro will do, insert the arrow into the editor), then click the gray square (stop record macro) and assign the 'Ctrl dot' shortcut to it, or whatever shortcut you like) The php plugin: The php plugin, would also have to have a different string concatenation operator than the dot. Maybe a double dot ? Yea... why not. All it has to do is set an activation tag so that it doesnt replace / interpreter '.' as '->' for old scripts and scripts that dont intent do use this. Something like this: <php+ $obj.i = 5 ?> (notice the modified '<?php' tag to '<?php+' ) This way it wouldnt break old code. (and you can just add the '<?php+' code template to your editor and then type 'php tab' (for netbeans) and it would insert '<?php+' ) With the alternative syntax method you could even have old and new syntax cohabitating on the same page like this (I am illustrating this to show the great compatibility of this method, not because you would want to do this): <?php+ $obj.i = 5; ?> <?php $obj->str = 'a' . 'b'; ?> You could change the tag to something more explanatory, in case somebody who doesnt know about the plugin reads the script and thinks its a syntax error <?php-dot.com $obj.i = 5; ?> This is easy because most editors have code templates, so its easy to assign a shortcut to it. And whoever doesnt want the dot replacement, doesnt have to use it. These are NOT ultimate solutions, they are ONLY examples to show that solutions exist, and that arguments against replacing '->' with '.' are only excuses. (Just admit you like the arrow, its ok : ) With this potential method, nobody who doesnt want to use it would have to use it, and it wouldnt break old code. And if other problems (ahem... excuses) arise, they could be fixed too. So who can, and who will do such a thing ?

    Read the article

  • Interoperability between Weblogic 10.3.1 and Oracle BPM 10.3.1

    - by alfredozn
    Hi, Im migrating an ALBPM 6.5 running on a WLS 10.0 to an Oracle BPM 10.3.1 running on WLS 10.3.1 I got some problems with the Oracle driver because the old driver (weblogic.jdbcx.oracle.OracleDataSource) was definitely removed from the server and is not longer supported. Instead I used the thin driver (oracle.jdbc.xa.OracleXADataSource), the database migration was executed succesfully but after that, when I try to deploy the engine ear in WebLogic I got exceptions asociated to the driver: [ (cont) ] Main: Caused by: weblogic.application.ModuleException: [HTTP:101216]Servlet: "engineStartup" failed to preload on startup in Web application: "/albpmServices/albpm_engine". [ (cont) ] Main: fuego.directory.DirectoryRuntimeException: Exception [java.sql.SQLException: Invalid column type]. [ (cont) ] Main: at fuego.directory.DirectoryRuntimeException.wrapException(DirectoryRuntimeException.java:85) [ (cont) ] Main: at fuego.directory.provider.jdbc.oracle.OraclePersistenceManager.mapSQLException(OraclePersistenceManager.java:145) [ (cont) ] Main: at fuego.directory.provider.jdbc.datadirect.oracle.DataDirectOraclePersistenceManager.mapSQLException(DataDirectOraclePersistenceManager.java:51) [ (cont) ] Main: at fuego.directory.provider.jdbc.JDBCServiceAccessor.mapSQLException(JDBCServiceAccessor.java:78) [ (cont) ] Main: at fuego.directory.provider.jdbc.JDBCObjectPropertiesAccessor.fetchAllDirectoryProperties(JDBCObjectPropertiesAccessor.java:442) [ (cont) ] Main: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) I was looking around for a solution but all is pointing to use the old driver, I think isn't a good practice to force the server to use this driver after Oracle remove it completely. Any suggestions or similar experiences??

    Read the article

  • Which namespace does operator<< (stream) go to?

    - by aaa
    If I have have some overloaded ostream operators, defined for library local objects, is its okay for them to go to std namespace? If I do not declare them in std namespace, then I must use using ns:: operator <<. As a possible follow-up question, are there any operators which should go to standard or global namespace?

    Read the article

  • mysql index optimization for a table with multiple indexes that index some of the same columns

    - by Sean
    I have a table that stores some basic data about visitor sessions on third party web sites. This is its structure: id, site_id, unixtime, unixtime_last, ip_address, uid There are four indexes: id, site_id/unixtime, site_id/ip_address, and site_id/uid There are many different types of ways that we query this table, and all of them are specific to the site_id. The index with unixtime is used to display the list of visitors for a given date or time range. The other two are used to find all visits from an IP address or a "uid" (a unique cookie value created for each visitor), as well as determining if this is a new visitor or a returning visitor. Obviously storing site_id inside 3 indexes is inefficient for both write speed and storage, but I see no way around it, since I need to be able to quickly query this data for a given specific site_id. Any ideas on making this more efficient? I don't really understand B-trees besides some very basic stuff, but it's more efficient to have the left-most column of an index be the one with the least variance - correct? Because I considered having the site_id being the second column of the index for both ip_address and uid but I think that would make the index less efficient since the IP and UID are going to vary more than the site ID will, because we only have about 8000 unique sites per database server, but millions of unique visitors across all ~8000 sites on a daily basis. I've also considered removing site_id from the IP and UID indexes completely, since the chances of the same visitor going to multiple sites that share the same database server are quite small, but in cases where this does happen, I fear it could be quite slow to determine if this is a new visitor to this site_id or not. The query would be something like: select id from sessions where uid = 'value' and site_id = 123 limit 1 ... so if this visitor had visited this site before, it would only need to find one row with this site_id before it stopped. This wouldn't be super fast necessarily, but acceptably fast. But say we have a site that gets 500,000 visitors a day, and a particular visitor loves this site and goes there 10 times a day. Now they happen to hit another site on the same database server for the first time. The above query could take quite a long time to search through all of the potentially thousands of rows for this UID, scattered all over the disk, since it wouldn't be finding one for this site ID. Any insight on making this as efficient as possible would be appreciated :) Update - this is a MyISAM table with MySQL 5.0. My concerns are both with performance as well as storage space. This table is both read and write heavy. If I had to choose between performance and storage, my biggest concern is performance - but both are important. We use memcached heavily in all areas of our service, but that's not an excuse to not care about the database design. I want the database to be as efficient as possible.

    Read the article

  • CodeIt.Right Code File Header Template For StyleCop Rules

    - by Paulo Morgado
    I like to use both StyleCop and CodeIt.Right to validate my code – StyleCop because it’s free and CodeIt.Right because it’s really good. While StyleCop provides only validation, CodeIt.Righ provides both validation and correction of violations. Unfortunately, CodeIt.Right’s supplied template for code file headers does not conform to StyleCop rules. Fortunately, CodeIt.Right allows us to define our own template. Here’s the one I use: <#@ template language="C#" #> //----------------------------------------------------------------------- // <copyright file="<#= System.IO.Path.GetFileName(Context.DestinationFile) #>" // project="<#= Context.ProjectName #>" // assembly="<#= Context.AssemblyName #>" // solution="<#= Context.SolutionName #>" // company="<#= Context.GetGlobalProperty("CompanyName") #>"> // Copyright (c) <#= Context.GetGlobalProperty("CompanyName") #>. All rights reserved. // </copyright> // <author id="<#= Context.GetGlobalProperty("UserID") #>"><#= Context.GetGlobalProperty("UserName") #></author> // <summary></summary> //-----------------------------------------------------------------------

    Read the article

  • Use the Cassia .NET Library to Detect Users Connected to Windows Server

    Thanks to the Cassia .NET Library, you can programmatically detect the users connected to Windows Server without using PInvoke to call the Windows Terminal Services API....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Use the Cassia .NET Library to Detect Users Connected to Windows Server

    Thanks to the Cassia .NET Library, you can programmatically detect the users connected to Windows Server without using PInvoke to call the Windows Terminal Services API....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • No OS will boot, all freeze

    - by Gyan
    This is for a computer with the following configuration: Asus P5KPL-AM/PS motherboard Pentium D 820 (dual core 2.8 GHz) 1 x 2 GB DDR2-800 Transcend RAM 1 SATA2 Samsung 160 GB HDD 1 PATA LG CD/DVD Writer PS/2 generic Keyboard USB Razer mouse The computer was working fine till a month ago with a Hitachi HDD in place of the Samsung. But that drive died and I sent it in for warranty replacement. Since then and till last week, the computer had not been turned on. I then got hold of a spare but XPSP2-loaded Samsung drive from another computer and decided to get this computer temporarily running. However, when I tried to boot into XP, it didn't load. It got stuck at the first graphical screen. When trying Safe Mode, the file list would be updated up to diskio.sys and then freeze. If I tried to boot Kubuntu off a CD, I would get past the first menu, but then get stuck at the subsequent graphical interface in the loading process. A similar thing happend with a friend's Windows XP-on-a-pen-drive. I switched the RAM into the other slot, but no luck. Then I booted the Ultimate Boot CD and ran Memtest86+ and a couple of the bundled CPU stress tests but these detected no errors. Some searching on the Internet brought up the notion of the CPU failing to switch from "real" to "protected mode". I'm hoping to get a fix on what the problem is and what I can do about it. Edit: I've flashed to the latest BIOS, but that doesn't help. Also, Knoppix LiveCD also freezes. I notice that the LED in my mouse goes off at the time of freeze, but trying to boot without the mouse connected produces the same result.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >