Search Results

Search found 2995 results on 120 pages for 'logical operators'.

Page 10/120 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Problem with APTonCD application

    - by Harikrishnan
    I created a iso image using aptoncd & burned it to a dvd. now when i tried to restore, the program does not detect the dvd in the drive. It shows "Please insert a disc in the drive." and if we click "ok" it shows "E: Failed to mount the cdrom.". The dvd is in the drive itself. I tried "sudo lshw -C disk" and the out put is: *-cdrom description: DVD-RAM writer product: DVDRAM GH22NS50 vendor: HL-DT-ST physical id: 1 bus info: scsi@1:0.0.0 logical name: /dev/cdrom logical name: /dev/cdrw logical name: /dev/dvd logical name: /dev/dvdrw logical name: /dev/scd0 logical name: /dev/sr0 logical name: /media/APTonCD logical name: /media/apt version: TN02 capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram configuration: ansiversion=5 mount.fstype=iso9660 mount.options=ro,relatime,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500 state=mounted status=ready *-medium physical id: 0 logical name: /dev/cdrom logical name: /media/APTonCD logical name: /media/apt configuration: mount.fstype=iso9660 mount.options=ro,relatime,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500 state=mounted Then i checked in disk utility application. in that dvd rom is shown as "/dvd/sr0". my ubuntu version is 10.10. please help me to solve the problem.

    Read the article

  • Why don't languages include implication as a logical operator?

    - by Maciej Piechotka
    It might be a strange question, but why there is no implication as a logical operator in many languages (Java, C, C++, Python Haskell - although as last one have user defined operators its trivial to add it)? I find logical implication much clearer to write (particularly in asserts or assert-like expressions) then negation with or: encrypt(buf, key, mode, iv = null) { assert (mode != ECB --> iv != null); assert (mode == ECB || iv != null); assert (implies(mode != ECB, iv != null)); // User-defined function }

    Read the article

  • Can I install fresh Linux accross partitions (LUKS & LVM) and preserve/use existing home user?

    - by xtian
    With an existing LUKS encrypted logical volume partitioned hard disk dual boot to Windoz and Linux (Fedora 15), is it necessary to "start over" with the LUKS setup when upgrading the system? I recall some note about dividing the Linux installation over different partitions would help to preserve the home data in future update (I can't find this now) Before I try it, is this possible and intended use case for partitioning a Linux installation? # lsblk -fa NAME FSTYPE LABEL MOUNTPOINT sda [80G] +-sda1 [system W95 FAT 32] vfat +-sda2 ext4 /boot +-sda3 [52.4G] crypto_LUKS +-luks-de25ac97-6a32-4b79-a6a0-296a39376b3b (dm-0) LVM2_member +-cryptVG-root (dm-1) [21.5G] ext4 / +-cryptVG-swap (dm-2) [5.4MB] swap [SWAP] +-cryptVG-data (dm-3) [25.6G] ext4 /home

    Read the article

  • VIM: created syntax not showing up?

    - by joxnas
    HI people I recently changed to VIM for coding in C. I'd like to hightlight the operators +-<=& ... etc I searched in google how should i do it, and i found the answer in this website: I was suppose to do something like: syntax match Operadores /[][><()&!|+*={}-]/ hi Operadores guifg=#000000 gui=BOLD Those characters were supposed to appear as black, bold characters. However, that doesn't happen when I open my .C files. However, if I create a newfile, (where there the C syntax doesn't show up), I am able to see the black, bolded operators. How can i correct this situation, and why is this happening (it seams like if my syntax is beeing overwrided by the C syntax). I'm using gvim, and this is my vimrc: colorscheme nicotine set smartindent set number set guifont=Inconsolata\ Medium\ 11 set numberwidth=5 noremap j jzz noremap k kzz Thanks, any help is appreciated. (And dont forget I'm a novice in VIM, and ..sorry for my English)

    Read the article

  • Consistency in placing operator functions

    - by wrongusername
    I have a class like this: class A { ...private functions, variables, etc... public: ...some public functions and variables... A operator * (double); A operator / (double); A operator * (A); ...and lots of other operators } However, I want to also be able to do stuff like 2 * A instead of only being allowed to do A * 2, and so I would need functions like these outside of the class: A operator * (double, A); A operator / (double, A); ...etc... Should I put all these operators outside of the class for consistency, or should I keep half inside and half outside?

    Read the article

  • lshw tells me my processor is a 64 bits but my motherboard has a 32 bits width

    - by bpetit
    Recently I noticed lshw tells me a strange thing. Here is the first part of my lshw output: bpetit-1025c description: Notebook product: 1025C (1025C) vendor: ASUSTeK COMPUTER INC. version: x.x serial: C3OAAS000774 width: 32 bits capabilities: smbios-2.7 dmi-2.7 smp-1.4 smp configuration: boot=normal chassis=notebook cpus=2 family=Eee PC... *-core description: Motherboard product: 1025C vendor: ASUSTeK COMPUTER INC. physical id: 0 version: x.xx serial: EeePC-0123456789 slot: To be filled by O.E.M. *-firmware description: BIOS vendor: American Megatrends Inc. physical id: 0 version: 1025C.0701 date: 01/06/2012 size: 64KiB capacity: 1984KiB capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd... *-cpu:0 description: CPU product: Intel(R) Atom(TM) CPU N2800 @ 1.86GHz vendor: Intel Corp. physical id: 4 bus info: cpu@0 version: 6.6.1 serial: 0003-0661-0000-0000-0000-0000 slot: CPU 1 size: 798MHz capacity: 1865MHz width: 64 bits clock: 533MHz capabilities: x86-64 boot fpu fpu_exception wp vme de pse tsc ... configuration: cores=2 enabledcores=1 id=2 threads=2 *-cache:0 description: L1 cache physical id: 5 slot: L1-Cache size: 24KiB capacity: 24KiB capabilities: internal write-back unified *-cache:1 description: L2 cache physical id: 6 slot: L2-Cache size: 512KiB capacity: 512KiB capabilities: internal varies unified *-logicalcpu:0 description: Logical CPU physical id: 2.1 width: 64 bits capabilities: logical *-logicalcpu:1 description: Logical CPU physical id: 2.2 width: 64 bits capabilities: logical *-logicalcpu:2 description: Logical CPU physical id: 2.3 width: 64 bits capabilities: logical *-logicalcpu:3 description: Logical CPU physical id: 2.4 width: 64 bits capabilities: logical *-memory description: System Memory physical id: 13 slot: System board or motherboard size: 2GiB *-bank:0 description: SODIMM [empty] product: [Empty] vendor: [Empty] physical id: 0 serial: [Empty] slot: DIMM0 *-bank:1 description: SODIMM DDR3 Synchronous 1066 MHz (0.9 ns) product: SSZ3128M8-EAEEF vendor: Xicor physical id: 1 serial: 00000004 slot: DIMM1 size: 2GiB width: 64 bits clock: 1066MHz (0.9ns) *-cpu:1 physical id: 1 bus info: cpu@1 version: 6.6.1 serial: 0003-0661-0000-0000-0000-0000 size: 798MHz capacity: 798MHz capabilities: ht cpufreq configuration: id=2 *-logicalcpu:0 description: Logical CPU physical id: 2.1 capabilities: logical *-logicalcpu:1 description: Logical CPU physical id: 2.2 capabilities: logical *-logicalcpu:2 description: Logical CPU physical id: 2.3 capabilities: logical *-logicalcpu:3 description: Logical CPU physical id: 2.4 capabilities: logical So here I see my processor is effectively a 64 bits one. However, I'm wondering how my motherboard can have a "32 bits width". I've browsed the web to find an answer, without success. I imagine it's just a technical fact that I don't know about. Thanks.

    Read the article

  • Are there real world applications where the use of prefix versus postfix operators matters?

    - by Kenneth
    In college it is taught how you can do math problems which use the ++ or -- operators on some variable referenced in the equation such that the result of the equation would yield different results if you switched the operator from postfix to prefix or vice versa. Are there any real world applications of using postfix or prefix operator where it makes a difference as to which you use? It doesn't seem to me (maybe I just don't have enough experience yet in programming) that there really is much use to having the different operators if it only applies in math equations. EDIT: Suggestions so far include: function calls //f(++x) != f(x++) loop comparison //while (++i < MAX) != while (i++ < MAX)

    Read the article

  • Error: (subscript) logical subscript too long

    - by frespider
    Can some one let me know why I am getting this error and how I can fix it? Here is the code What I am trying to do is remove the rows that associated 1's if the column of that one's less than 10 a0=rep(1,40) a=rep(0:1,20) b=c(rep(1,20),rep(0,20)) c0=c(rep(0,12),rep(1,28)) c1=c(rep(1,5),rep(0,35)) c2=c(rep(1,8),rep(0,32)) c3=c(rep(1,23),rep(0,17)) c4=c(rep(1,6),rep(0,34)) x=matrix(cbind(a0,a,b,c0,c1,c2,c3,c4),nrow=40,ncol=8) nam <- paste("V",2:9,sep="") colnames(x)<-nam dat <- cbind(y=rnorm(40,50,7),x) #=================================== toSum <- colSums(dat) Col <- Val <- NULL for(i in 1:length(toSum)){ if(toSum[i]<10){ Col <- c(Col,colnames(dat)[i]) Val <- c(Val,toSum[i])} } cs <- colSums(dat) < 10 indx <- dat[,which(cs)]==0 for(i in 1:dim(indx)[2]){ datnw <- dat[indx[,i],] dat <- datnw} datnw2 <- dat[, -which(cs)] Thanks

    Read the article

  • jquery selector logical AND?

    - by taber
    In jQuery I'm trying to select only mount nodes where a and b's text values are 64 and "test" accordingly. I'd also like to fallback to 32 if no 64 and "test" exist. What I'm seeing with the code below though, is that the 32 mount is being returned instead of the 64. The XML: <thingses <thing <a32</a <-- note, a here is 32 and not 64 -- <other...</other <mountsample 1</mount <btest</b </thing <thing <a64</a <other...</other <mountsample 2</mount <btest</b </thing <thing <a64</a <other...</other <mountsample 3</mount <bunrelated</b </thing <thing <a128</a <other...</other <mountsample 4</mount <bunrelated</b </thing </thingses And unfortunately I don't have control over the XML as it comes from somewhere else. What I'm doing now is: var ret_val = ''; $data.find('thingses thing').each(function(i, node) { var $node = $(node), found_node = $node.find('b:first:is(test), a:first:is(64)').end().find('mount:first').text(); if(found_node) { ret_val = found_node; return; } found_node = $node.find('b:first:is(test), a:first:is(32)').end().find('mount:first').text(); if(found_node) { ret_val = found_node; return; } ret_val = 'not found'; }); // expected result is "sample 2", but if sample 2's parent "thing" was missing, the result would be "sample 1" alert(ret_val); For my ":is" selector I'm using: if(jQuery){ jQuery.expr[":"].is = function(obj, index, meta, stack){ return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase(); }; } There has to be a better way than how I'm doing it. I wish I could replace the "," with "AND" or something. :) Any help would be much appreciated. thanks!

    Read the article

  • Overloading the QDataStream << and >> operators for a user-defined type

    - by Alex Wood
    I have a an object I'd like to be able to read and write to/from a QDataStream. The header is as follows: class Compound { public: Compound(QString, QPixmap*, Ui::MainWindow*); void saveCurrentInfo(); void restoreSavedInfo(QGraphicsScene*); void setImage(QPixmap*); QString getName(); private: QString name, homeNotes, addNotes, expText; Ui::MainWindow *gui; QPixmap *image; struct NMRdata { QString hnmrText, cnmrText, hn_nmrText, hn_nmrNucl, notes; int hnmrFreqIndex, cnmrFreqIndex, hn_nmrFreqIndex, hnmrSolvIndex, cnmrSolvIndex, hn_nmrSolvIndex; }*nmr_data; struct IRdata { QString uvConc, lowResMethod, irText, uvText, lowResText, highResText, highResCalc, highResFnd, highResFrmla, notes; int irSolvIndex, uvSolvIndex; }*ir_data; struct PhysicalData { QString mpEdit, bpEdit, mpParensEdit, bpParensEdit, rfEdit, phyText, optAlpha, optConc, elemText, elemFrmla, notes; int phySolvIndex, optSolvIndex; }*physical_data; }; For all intensive purposes, the class just serves as an abstraction for a handful of QStrings and a QPixmap. Ideally, I would be able to write a QList to a QDataStream but I'm not exactly sure how to go about doing this. If operator overloading is a suitable solution, would writing code like friend QDataStream& operator << (QDataStream&,Compound) { ... } be a potential solution? I'm very open to suggestions! Please let me know if any further clarification is needed.

    Read the article

  • Strlen of MAX 16 chars string using bitwise operators

    - by fabrizioM
    The challenge is to find the fastest way to determine in C/C++ the length of a c-string using bitwise operations in C. char thestring[16]; The c-string has a max size of 16 chars and is inside a buffer If the string is equal to 16 chars doesn't have the null byte at the end. I am sure can be done but didn't got it right yet. I am working on this at the moment, but assuming the string is memcpied on a zero-filled buffer. len = buff[0] != 0x0 + buff[1] != 0x0 + buff[2] != 0x0 + buff[3] != 0x0 + buff[4] != 0x0 + buff[5] != 0x0 + buff[6] != 0x0 + buff[7] != 0x0 + buff[8] != 0x0 + buff[9] != 0x0 + buff[10] != 0x0 + buff[11] != 0x0 + buff[12] != 0x0 + buff[13] != 0x0 + buff[14] != 0x0 + buff[15] != 0x0;

    Read the article

  • Binary comparison operators on generic types

    - by Brian Triplett
    I have a generic class that takes a type T. Within this class I have a method were I need to compare a type T to another type T such as: public class MyClass<T> { public T MaxValue { // Implimentation for MaxValue } public T MyMethod(T argument) { if(argument > this.MaxValue) { // Then do something } } } The comparison operation inside of MyMethod fails with Compiler Error CS0019. Is it possible to add a constraint to T to make this work? I tried adding a where T: IComparable<T> to the class definition to no avail.

    Read the article

  • T-SQL aggregate function Logical error

    - by Yoda
    Hi Guys, Ok I have a data table containing duplicate Reciept numbers and a transaction value for each record, I need to simply list the total for each unique Reciept number, this is obviously a simple problem but I am missing something. Any help is much appriciated > SELECT Gf_Receipt_number AS Reciept, > SUM (Gf_Amount) AS Total FROM > [TestP].[dbo].[Gf] WHERE > Gf_Receipt_number IS NOT NULL GROUP > BY Gf_Amount Would probably help to mention the the error I am recieving is: Column 'TestP.dbo.Gf.Gf_Receipt_number' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

    Read the article

  • NetBeans Java code formatter: logical operators on new line

    - by mizipzor
    My code looks like this: if (firstCondition() && secondCondition()) { // ... code } The default settings for the code formatter in NetBeans wants to put the && on a new line, like this: if (firstCondition() && secondCondition()) { // ... code } The formatter works well so I would just like to find the setting so it doesnt change the code to the latter. Whats the setting called?

    Read the article

  • Negative logical shift

    - by user320862
    In Java, why does -32 -1 = 1 ? It's not specific to just -32. It works for all negative numbers as long as they're not too big. I've found that x -1 = 1 x -2 = 3 x -3 = 7 x -4 = 15 given 0 x some large negative number Isn't -1 the same as << 1? But -32 << 1 = -64. I've read up on two's complements, but still don't understand the reasoning.

    Read the article

  • Logical python question - handling directories and files in them

    - by Konstantin
    Hello! I'm using this function to extract files from .zip archive and store it on the server: def unzip_file_into_dir(file, dir): import sys, zipfile, os, os.path os.makedirs(dir, 0777) zfobj = zipfile.ZipFile(file) for name in zfobj.namelist(): if name.endswith('/'): os.mkdir(os.path.join(dir, name)) else: outfile = open(os.path.join(dir, name), 'wb') outfile.write(zfobj.read(name)) outfile.close() And the usage: unzip_file_into_dir('/var/zips/somearchive.zip', '/var/www/extracted_zip') somearchive.zip have this structure: somearchive.zip 1.jpeg 2.jpeg another.jpeg or, somethimes, this one: somearchive.zip somedir/ 1.jpeg 2.jpeg another.jpeg Question is: how do I modify my function, so that my extracted_zip catalog would always contain just images, not images in another subdirectory, even if images are stored in somedir inside an archive.

    Read the article

  • Comparison operators not supported for type IList when Paging data in Linq to Sql

    - by Dan
    I can understand what the error is saying - it can't compare a list. Not a problem, other than the fact that I don't know how to not have it compare a list when I want to page through a model with a list as a property. My Model: Event : IEvent int Id string Title // Other stuff.. LazyList<EventDate> Dates // The "problem" property Method which pages the data (truncated): public JsonResult JsonEventList(int skip, int take) { var query = _eventService.GetEvents(); // Do some filtering, then page data.. query = query.Skip(skip).Take(take); return Json(query.ToArray()); } As I said, the above is truncated quite a bit, leaving only the main point of the function: filter, page and return JSON'd data. The exception occurs when I enumerate (.ToArray()). The Event object is really only used to list the common objects of all the event types (Meetings, Birthdays, etc - for example). It still implements IEvent like the other types, so I can't just remove the LazyList<EventDate> Dates' property unless I no longer implementIEvent` Anyway, is there a way to avoid this? I don't really want to compare a LazyList when I page, but I do not know how to resolve this issue. Thank you in advance! :)

    Read the article

  • templates and casting operators

    - by Jonathan Swinney
    This code compiles in CodeGear 2009 and Visual Studio 2010 but not gcc. Why? class Foo { public: operator int() const; template <typename T> T get() const { return this->operator T(); } }; Foo::operator int() const { return 5; } The error message is: test.cpp: In member function `T Foo::get() const': test.cpp:6: error: 'const class Foo' has no member named 'operator T'

    Read the article

  • Objective c key path operators @avg,@max .....

    - by davide
    arr = [[NSMutableArray alloc]init]; [arr addObject:[NSNumber numberWithInt:4]]; [arr addObject:[NSNumber numberWithInt:45]]; [arr addObject:[NSNumber numberWithInt:23]]; [arr addObject:[NSNumber numberWithInt:12]]; NSLog(@"The avg = %@", [arr valueForKeyPath:@"@avg.intValue"]); This code works fine, but why? valueForKeyPath:@"@avg.intValue" is requesting (int) from each NSNumber, but we are outputting a %@ string in the log. If i try to output a decimal %d i get a number that possibly is a pointer to something. Can somebody explain why the integers become NSNumbers when i call the @avg operator?

    Read the article

  • Optimize conditional operators branching in C#

    - by abatishchev
    Hello. I have next code: return this.AllowChooseAny.Value ? radioSpecific.Checked ? UserManager.CurrentUser.IsClient ? txtSubject.Text : subjectDropDownList.SelectedItem.Text : String.Empty : UserManager.CurrentUser.IsClient ? txtSubject.Text : subjectDropDownList.SelectedItem.Text; or in less complex form: return any ? specified ? isClient ? textbox : dropdown : empty : isClient ? textbox : dropdown; or in schematic form: | any / \ specified isClient / \ / \ isClient empty textbox dropdown / \ textbox dropdown Evidently I have a duplicated block on two different levels. Is it possible to optimize this code to probably split them to one? Or something like that..

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >