Search Results

Search found 42 results on 2 pages for 'marian lux'.

Page 2/2 | < Previous Page | 1 2 

  • ExecutorService - scaling

    - by Stanciu Alexandru-Marian
    I am trying to write a program in Java using ExecutorService and it's function invokeAll. My question is: does the invokeAll functions solve the tasks simultaneously? I mean, if i have two processors, there will be two workers in the same time? Because a can't make it to scale correct. It takes the same time to complete the problem if i give newFixedThreadPool(2) or 1. List<Future<PartialSolution>> list = new ArrayList<Future<PartialSolution>>(); Collection<Callable<PartialSolution>> tasks = new ArrayList<Callable<PartialSolution>>(); for(PartialSolution ps : wp) { tasks.add(new Map(ps, keyWords)); } list = executor.invokeAll(tasks); Map is a class that implements Callable and wp is a vector of Partial Solutions, a class that holds some informations in different times. Why doesn't it scale? What could be the problem? Thank you, Alex

    Read the article

  • Objective-C Getter Memory Management

    - by Marian André
    I'm fairly new to Objective-C and am not sure how to correctly deal with memory management in the following scenario: I have a Core Data Entity with a to-many relationship for the key "children". In order to access the children as an array, sorted by the column "position", I wrote the model class this way: @interface AbstractItem : NSManagedObject { NSArray * arrangedChildren; } @property (nonatomic, retain) NSSet * children; @property (nonatomic, retain) NSNumber * position; @property (nonatomic, retain) NSArray * arrangedChildren; @end @implementation AbstractItem @dynamic children; @dynamic position; @synthesize arrangedChildren; - (NSArray*)arrangedChildren { NSArray* unarrangedChildren = [[self.children allObjects] retain]; NSSortDescriptor* sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"position" ascending:YES]; [arrangedChildren release]; arrangedChildren = [unarrangedChildren sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; [sortDescriptor release]; [unarrangedChildren release]; return [arrangedChildren retain]; } @end I'm not sure whether or not to retain unarrangedChildren and the returned arrangedChildren (first and last line of the arrangedChildren getter). Does the NSSet allObjects method already return a retained array? It's probably too late and I have a coffee overdose. I'd be really thankful if someone could point me in the right direction. I guess I'm missing vital parts of memory management knowledge and I will definitely look into it thoroughly.

    Read the article

  • SQLAlchemy - relationship limited on more than just the foreign key

    - by Marian
    I have a wiki db layout with Page and Revisions. Each Revision has a page_id referencing the Page, a page relationship to the referenced page; each Page has a all_revisions relationship to all its revisions. So far so common. But I want to implement different epochs for the pages: If a page was deleted and is recreated, the new revisions have a new epoch. To help find the correct revisions, each page has a current_epoch field. Now I want to provide a revisions relation on the page that only contains its revisions, but only those where the epochs match. This is what I've tried: revisions = relationship('Revision', primaryjoin = and_( 'Page.id == Revision.page_id', 'Page.current_epoch == Revision.epoch', ), foreign_keys=['Page.id', 'Page.current_epoch'] ) Full code (you may run that as it is) However this always raises ArgumentError: Could not determine relationship direction for primaryjoin condition ...`, I've tried all I had come to mind, it didn't work. What am I doing wrong? Is this a bad approach for doing this, how could it be done other than with a relationship?

    Read the article

  • How to poll a file in /sys

    - by Bjoern
    Hi, I am stuck reading a file in /sys/ which contains the light intensity in Lux of the ambient light sensor on my Nokia N900 phone. See thread on talk.maemo.org here I tried to use pyinotify to poll the file but this looks some kind of wrong to me since the file is alway "process_IN_OPEN", "process_IN_ACCESS" and "process_IN_CLOSE_NOWRITE" I basically want to get the changes ASAP and if something changed trigger an event, execute a class... Here's the code I tried, which works, but not as I expected (I was hoping for process_IN_MODIFY to be triggered): #!/usr/bin/env python # -*- coding: utf-8 -*- # import os, time, pyinotify import pyinotify ambient_sensor = '/sys/class/i2c-adapter/i2c-2/2-0029/lux' wm = pyinotify.WatchManager() # Watch Manager mask = pyinotify.ALL_EVENTS def action(self, the_event): value = open(the_event.pathname, 'r').read().strip() return value class EventHandler(pyinotify.ProcessEvent): def process_IN_ACCESS(self, event): print "ACCESS event:", action(self, event) def process_IN_ATTRIB(self, event): print "ATTRIB event:", action(self, event) def process_IN_CLOSE_NOWRITE(self, event): print "CLOSE_NOWRITE event:", action(self, event) def process_IN_CLOSE_WRITE(self, event): print "CLOSE_WRITE event:", action(self, event) def process_IN_CREATE(self, event): print "CREATE event:", action(self, event) def process_IN_DELETE(self, event): print "DELETE event:", action(self, event) def process_IN_MODIFY(self, event): print "MODIFY event:", action(self, event) def process_IN_OPEN(self, event): print "OPEN event:", action(self, event) #log.setLevel(10) notifier = pyinotify.ThreadedNotifier(wm, EventHandler()) notifier.start() wdd = wm.add_watch(ambient_sensor, mask) wdd time.sleep(5) notifier.stop() Thanks for any hints, suggestions and examples Kind regards Bjoern

    Read the article

  • How do you start a program after X has started?

    - by cyborg
    Hello, there's a little app called F.Lux that sets your screen temperature based on the time of day. The Linux version is a little spartan with just a console interface but it works perfectly well. The question I have is where can I invoke it so that it starts up after X has started? Thanks.

    Read the article

  • Glume cu chelneri

    - by interesante
    La un mic restaurant, in luna decembrie:- Chelner, ce ai rece in acest moment?- Picioarele, domnule.Distreaza-te si cu alte lucruri amuzante de pe jurnalul meu haios.La un restaurant de lux, vine controlul de la Sanepid.Fac ei controlul si constata ca totul era o.k.Multumiti,din partea patronului de local,primesc si un pranz.Vine chelnerul,ii intreaba ce vin doresc sa serveasca,le aduce vinul,scoate dopul de pluta,le toarna in pahare si, ca la un local care se respecta,acesta scoase o lingurita de la pieptul sacoului si curata cu grija bucatelele de pluta din paharele mesenilor. Dupa ce inspectorii servira masa, il chemara pe chelner sa-i multumeasca si-l intrebara: - Nu va suparati! De ce purtati snur la slit? - Igiena inainte de toate! Cand ne ducem la buda, ca sa nu mai punem mana, tragem de snur si gata! - Aha! Si cum o bagati la loc? - Cu lingurita!

    Read the article

  • Unable configure brightness or colors (12.04)

    - by bux
    I've make a fresh install with Ubuntu 12.04. Unfortunatly i've a problem with colors and brightness settings. Before reinstall of Ubuntu, i used Ubuntu 10.10 with same graphic card, and same nvidia drivers. Note: Only nvidia proprietary drivers works for my GeForce 8600 GTS. Exemple: With nvidia-settings: adjust colors, brightness: no effects With xgamma -gamma 0.5 : no effects Try to use f.lux or redshift: no effects I try solutions found on internet like here but no working to. Any idea ?

    Read the article

  • Failed to save to data store: The operation couldn’t be completed. (Cocoa error 133020.)

    - by poslinski.net
    I am working on quite complex app with huge sync procedure beetwen iphone and web server. I have no troubles with adding records, until I run sync procedure in separete thread, and It will update data on serwer, and send them back to iphone. But after this procedure, inserting new data cause error, such as this: 2011-01-07 12:49:10.722 App[1987:207] Failed to save to data store: The operation couldn’t be completed. (Cocoa error 133020.) 2011-01-07 12:49:10.724 App[1987:207] { conflictList = ( "NSMergeConflict (0x5ac1ea0) for NSManagedObject (0x5a2d710) with objectID '0x5a27080 <x-coredata://E82E75ED-96DB-4CBF-9D15-9CC106AC0052/uzytkownicy/p10>' with oldVersion = 9 and newVersion = 21 and old object snapshot = {\n adres = \"<null>\";\n haslo = xxxxxxxxxxxxxxxxxxxxxx;\n \"id_uzytkownika\" = 3;\n imie = Jan;\n \"kod_jednorazowy\" = 0;\n komorka = \"<null>\";\n login = nowakjan;\n nazwisko = Nowak;\n pesel = 0;\n rodzaj = 2;\n \"stan_konta\" = 0;\n telefon = \"<null>\";\n \"uzytkownicy_uczniowie\" = \"<null>\";\n \"zmienna_losowa\" = 8G9e1;\n} and new cached row = {\n adres = \"<null>\";\n haslo = xxxxxxxxxxxxxxxxxxxxxx;\n \"id_uzytkownika\" = 3;\n imie = Jan;\n \"kod_jednorazowy\" = 0;\n komorka = \"<null>\";\n login = nowakjan;\n nazwisko = Nowak;\n pesel = 0;\n rodzaj = 2;\n \"stan_konta\" = 0;\n telefon = \"<null>\";\n \"uzytkownicy_uczniowie\" = \"<null>\";\n \"zmienna_losowa\" = 8G9e1;\n}", "NSMergeConflict (0xd266990) for NSManagedObject (0xcd05950) with objectID '0x5a453b0 <x-coredata://E82E75ED-96DB-4CBF-9D15-9CC106AC0052/uczniowie/p125>' with oldVersion = 5 and newVersion = 10 and old object snapshot = {\n adres = \"Warszawa; ul. Lwowska 32\";\n \"data_urodzenia\" = \"1997-02-01 23:00:00 +0000\";\n dysfunkcje = \"\";\n email = \"<null>\";\n frekwencja = 0;\n \"id_ucznia\" = 86;\n imie2 = Marian;\n \"imie_ucznia\" = \"S\\U0142awomir\";\n klasa = \"0x5a47820 <x-coredata://E82E75ED-96DB-4CBF-9D15-9CC106AC0052/zespoly/p9>\";\n komorka = \"<null>\";\n \"miejsce_urodzenia\" = Warszawa;\n \"nazwisko_ucznia\" = \"S\\U0142awek\";\n \"numer_ewidencyjny\" = 20;\n opiekun1 = \"Mariusz S\\U0142awek\";\n opiekun2 = \" \";\n pesel = 97020298919;\n plec = 1;\n telefon = 890000002;\n \"uzytkownicy_uczniowie\" = \"<null>\";\n \"web_klasa\" = 50;\n} and new cached row = {\n adres = \"Warszawa; ul. Lwowska 32\";\n \"data_urodzenia\" = \"1997-02-01 23:00:00 +0000\";\n dysfunkcje = \"\";\n email = \"<null>\";\n frekwencja = 0;\n \"id_ucznia\" = 86;\n imie2 = Marian;\n \"imie_ucznia\" = \"S\\U0142awomir\";\n klasa = \"0x5a8e7c0 <x-coredata://E82E75ED-96DB-4CBF-9D15-9CC106AC0052/zespoly/p9>\";\n komorka = \"<null>\";\n \"miejsce_urodzenia\" = Warszawa;\n \"nazwisko_ucznia\" = \"S\\U0142awek\";\n \"numer_ewidencyjny\" = 20;\n opiekun1 = \"Mariusz S\\U0142awek\";\n opiekun2 = \" \";\n pesel = 97020298919;\n plec = 1;\n telefon = 890000002;\n \"uzytkownicy_uczniowie\" = \"<null>\";\n \"web_klasa\" = 50;\n}", "NSMergeConflict (0xd2669b0) for NSManagedObject (0x5a44480) with objectID '0x5a47830 <x-coredata://E82E75ED-96DB-4CBF-9D15-9CC106AC0052/przedmioty/p12>' with oldVersion = 7 and newVersion = 15 and old object snapshot = {\n \"id_przedmiotu\" = 1;\n \"nazwa_przedmiotu\" = Historia;\n \"skrot_nazwy\" = Hist;\n} and new cached row = {\n \"id_przedmiotu\" = 1;\n \"nazwa_przedmiotu\" = Historia;\n \"skrot_nazwy\" = Hist;\n}" ); } I've been looking for any solution but without luck. Thank You in advance for any usefull help.

    Read the article

  • MS Outlook Voting mismatch

    - by Robert Ilbrink
    I did send out an Outlook vote to hundreds of employees, using their email address (which is mostly [email protected], but there are many exceptions). The incoming votes are not matched against the email address, but against the display name. Unfortunately, the display name has no real standard either. So instead of seeing this: [email protected] Voted: Yes [email protected] Voted: No I see this: [email protected] [email protected] Doe, Johnathan Philip Voted: Yes Doe - Peeters, Marian Voted: No In the actual list I see the addresses that I sent the vote to PLUS extra lines with the votes that came back. Is there a quick way to match my "send" list with the "received" list? One thing I thought of was to dump the global address book in a file and in Excel use =vlookup. But that seems a lot of work (and I am not even sure that I have the authorization to dump the address book).

    Read the article

  • Do you know of any ways to effectively manage a triple screen setup brightness?

    - by nizm0
    I use a desktop with multiple monitors I have tried F.lux and it is a great app for changing the color from 3500k-6500k... but doesn't adjust screen brightness. (I recommend you try it) I've googled for hours trying to find an app that will work to let me easily manage screen brightness either by a "dim when idle" or a dynamically updating screen brightness based on the time of day. Windows 7 desktop doesn't seem to have options for me to adjust brightness on the system, and manually changing three separate monitors is too much of a chore? Anybody have some recommendations? Perhaps a way to script this, knowledge of how to use the supposed dynamic screen brightness functions that Windows was supposed to add in Windows 7?

    Read the article

  • php soapclient responds as 'null' but xml response is ok using __getLastResponse

    - by Roger S
    I'm looking for help with a php soapclient call: The call is to a remote panel and I want to pull off the log data. There are various services published via the WSDL and I am able to use several with no issues. Here's the list: array(12) { [0]=> string(77) "GetGPTimerChannelsResponse GetGPTimerChannels(GetGPTimerChannels $parameters)" [1]=> string(74) "GetGPTimerChannelResponse GetGPTimerChannel(GetGPTimerChannel $parameters)" [2]=> string(74) "SetGPTimerChannelResponse SetGPTimerChannel(SetGPTimerChannel $parameters)" [3]=> string(47) "GetSlaveResponse GetSlave(GetSlave $parameters)" [4]=> string(71) "GetLogDataInlineResponse GetLogDataInline(GetLogDataInline $parameters)" [5]=> string(71) "GetLogItemInlineResponse GetLogItemInline(GetLogItemInline $parameters)" [6]=> string(59) "GetAlarmListResponse GetAlarmList(GetAlarmList $parameters)" [7]=> string(50) "GetSyslogResponse GetSyslog(GetSyslog $parameters)" [8]=> string(47) "SetSlaveResponse SetSlave(SetSlave $parameters)" [9]=> string(53) "GetVersionResponse GetVersion(GetVersion $parameters)" [10]=> string(53) "GetTDBInfoResponse GetTDBInfo(GetTDBInfo $parameters)" [11]=> string(53) "GetLogItemResponse GetLogItem(GetLogItem $parameters)" } I am trying to use the GetLogDataInline service which requires four parameters - these I'm passing as an array and all seems OK when doing the connection (the request/response takes around 30 seconds to process). When I look at a var_dump / print_r of the result, it returns NULL, whereas when I do a call to the __getLastResponse all of the data I need to populate my local database is there. Below is the code for the soapclient call: $client = new soapclient ("http://192.168.1.126/cgi-bin/cgi.cgi?WSDL", array("trace" => 1, "exceptions" => true, "cache_wsdl" => WSDL_CACHE_NONE, "features" => SOAP_SINGLE_ELEMENT_ARRAYS )); $params = array ( "ResponseType" => "Xml", "Step" => 15, "Start" => "2012-06-14T12:00:00+01:00", "End" => "2012-06-14T23:59:45+01:00" ); $result = $client -> GetLogDataInline ($params); An extract from the var_dump / __getLastResponse is: var_dump($client) object(SoapClient)#1 (4) { ["trace"]= int(1) ["_features"]= int(1) ["_soap_version"]= int(1) ["sdl"]= resource(4) of type (Unknown) } var_dump($result) NULL __getLastResponse 15 2012-06-14T12:00:00+01:00 2012-06-14T23:59:45+01:00 External Temperature Workshop Lux Level Electricity Pulse 100wh Workshop PIR Active Boiler Flow Temp Outside Lux Workshop_Light_Override_Hours Water Consumption (Litres) Electricity kWh Consumption Water Consumption M3 Gas kWh Consumption Outside Lighting Heating Effective Setpoint Router Reset Workshop Lighting State Heating Run Hours Heating On Receptin Percent RH Reception Temp Reception RH Reception Temp 2012-06-14T12:00:00+01:00 -85.6 2.1 -1.0 Off -91.5 13.8 0.0 -1.0 0.0 0.0 -0.1 Off 21.0 Off Off 0.0 Off 53.0 22.0 53.0 22.0 2012-06-14T12:00:15+01:00 -85.4 2.1 -1.0 Off -91.8 13.8 0.0 -1.0 0.0 0.0 -0.1 Off 21.0 Off Off 0.0 Off 53.0 22.0 53.0 22.0 2012-06-14T12:00:30+01:00 -85.4 2.1 -1.0 Off -91.8 13.8 0.0 -1.0 0.0 0.0 -0.1 Off 21.0 Off Off 0.0 Off 53.0 22.0 53.0 22.0 2012-06-14T12:00:45+01:00 -85.4 2.1 -1.0 Off -91.5 13.7 0.0 -1.0 0.0 0.0 -0.1 Off 21.0 Off Off 0.0 Off 54.0 22.0 54.0 22.0 (this should be xml but doesn't appear to have copied correctly) If you've got this far, thanks for taking the time. Any help would be much appreciated.

    Read the article

  • Ubuntu 12.04 - Brightness controls not working

    - by Juan Manuel Zolezzi Volpi
    Controls from "Brightness and Lock" were not working so I've tried a solution that involved changing grub, which I'm detailing below: # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX="quiet splash acpi_backlight=vendor" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" After doing this, the brightness control dissapeared like you can see at http://screencloud.net/img/screenshots/6b90d56604b70cc749a632d0bc005a20.png Any ideas? Would love to be able to configure Brightness or even use apps like F.lux to regulate it automatically. Edit: I've modified the following line to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=" and now the brightness controls are back, but whatever I change the brightness remains the same. Just in case I'm using Intel H77

    Read the article

  • Ubuntu 12.04 stopped recognizing my BenQ monitor and reduced resolution to 1024x768

    - by Omri
    A few days ago I installed Ubuntu 12.04 32bit Desktop. It recognized my hardware without a problem (at least that I know of) and all worked fine. I left my system running (it is at work) through the night because it is also working as a database server and when I came today to work the resolution was 1024x768 (the monitor recommends 1920x1080) even though in the Display section of the System Settings it was recognized as BenQ, and no higher resolution was offered. After a restart, the monitor name changed from BenQ to Unknown. This is a desktop computer. I also installed gtk-redshift and f.lux. I checked Additional Drivers to see if there is something I can install but it didn't find anything. I tried to Google it but I didn't find anything about a monitor stopping being recognized after it was already working. I did enable some PPAs yesterday, namely webupd8, mozillateam/thunderbird-stable and some other, and I also followed the instructions to patch the NotifyOSD to be more friendly: sudo add-apt-repository ppa:caffeine-developers/ppa sudo add-apt-repository ppa:leolik/leolik sudo apt-get update sudo apt-get upgrade sudo apt-get install libnotify-bin pkill notify-osd sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install notifyosdconfig I now purged both caffeine-developers and leolik PPAs in the hope it will help, but no change. Has there been a change in the packages that could introduce this problem? Any help will be very appreciated :-) Omri

    Read the article

  • Populate Multiple PDFs

    - by gmcalab
    I am using itextsharp to populate my PDFs. I have no issues with this. Basically what I am doing is getting the PDF and populating the fields in memory then passing back the MemoryStream to be displayed on a webpage. All this is working with a single document PDF. What I am trying to figure out now, is merging multiple PDFs into one MemoryStream. The part I cant figure out is, the documents I am populating are identical. So for example, I have a List<Person> that contains 5 persons. I want to fill out a PDF for each person and merge them all into one, in memory. Bare in mind I am going to fill out the same type of document for each person. The problem I am getting is that when I try to add a second copy of the same PDF to be filled out for the second iteration, it just overwrites the first populated PDF, since it's the same document, therefore not adding a second copy for the second Person at all. So basically if I had the 5 people, I would end up with a single page with the data of the 5th person, instead of a PDF with 5 like pages that contain the data of each person respectively. Here's some code... MemoryStream ms = ms = new MemoryStream(); PdfReader docReader = null; PdfStamper Stamper = null; List<Person> persons = new List<Person>() { new Person("Larry", "David"), new Person("Dustin", "Byfuglien"), new Person("Patrick", "Kane"), new Person("Johnathan", "Toews"), new Person("Marian", "Hossa") }; try { // Iterate thru all persons and populate a PDF for each foreach(var person in persons){ PdfCopyFields Copier = new PdfCopyFields(ms); Copier.AddDocument(GetReader("Person.pdf")); Copier.Close(); docReader = new PdfReader(ms.ToArray()); Stamper = new PdfStamper(docReader, ms); AcroFields Fields = Stamper.AcroFields; Fields.SetField("FirstName", person.FirstName); } }catch(Exception e){ // handle error }finally{ if (Stamper != null) { Stamper.Close(); } if (docReader != null) { docReader.Close(); } }

    Read the article

< Previous Page | 1 2