Daily Archives

Articles indexed Wednesday June 20 2012

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

  • Flex Button Size Setting For Implementing Multilanguage

    - by user961496
    I'm creating a flex app with multilanguage support. But there's a problem with the design when I try to implement multilanguage support. For example : In Chinese : ?? In English : Good Morning The button size is not enough when I change the language to English. Although I set the button width with dynamic size, but the button will closing the objects around it Code is here http://pastebin.com/7fDB2VU2

    Read the article

  • JSON encode MySQL results then read using jQuery

    - by silentw
    I have a database table with some rows that I want to fetch using PHP and then encode them using JSON. Currently, my database structure is the following: idcomponente | quantidade After fetching the values in PHP, I want to know how can I encode them using JSON (with multiple rows, using the same names) so I can read them using jQuery.post(). $.post('test.php',{id:id},function(data){ //READ data HERE }); Thanks in advance Edit: So far, I made this: $.post('edit/producomponentes.php',{id:id},function(data){ console.log(data); }); Logs this: [Object { componente="1", quantidade="2"}, Object { componente="3", quantidade="3"}] Now how can I go through each row and fetch their properties? (data.componente, data.quantidade)

    Read the article

  • Why is my implementation of strcmp not returning the proper value?

    - by Avanish Giri
    Why is this printing out 0 back in main but 6 when it is inside of the strcmp function? 7 int main() 8 { 9 char* str = "test string"; 10 char* str2 = "test strong"; 11 //printf("string length = %d\n",strlen(str)); 12 13 int num = strcmp(str,str2); 14 15 printf("num = %d\n",num); 16 } 29 int strcmp(char* str, char* str2) 30 { 31 if(*str == '\0' && *str2 == '\0') 32 return 0; 33 if(*str2 - *str == 0) 34 { 35 strcmp(str+1,str2+1); 36 } 37 else 38 { 39 int num = *str2 - *str; 40 cout << "num = " <<num<<endl; 41 return num; 42 } 43 } The output is: num = 6 num = 0 Why is it printing 0 when obviously the value that it should be returning is 6?

    Read the article

  • NSPredicate 'OR' filtering based on an NSArray of keys

    - by So Over It
    Consider the following NSArray: NSArray *dataSet = [[NSArray alloc] initWithObjects: [NSDictionary dictionaryWithObjectsAndKeys:@"abc", @"key1", @"def", @"key2", @"hij", @"key3", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"klm", @"key1", @"nop", @"key2", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"qrs", @"key2", @"tuv", @"key3", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"wxy", @"key3", nil], nil]; I am able to filter this array to find dictionary objects that contain the key key1 // Filter our dataSet to only contain dictionary objects with a key of 'key1' NSString *key = @"key1"; NSPredicate *key1Predicate = [NSPredicate predicateWithFormat:@"%@ IN self.@allKeys", key]; NSArray *filteretSet1 = [dataSet filteredArrayUsingPredicate:key1Predicate]; NSLog(@"filteretSet1: %@",filteretSet1); Which appropriately returns: filteretSet1: ( { key1 = abc; key2 = def; key3 = hij; }, { key1 = klm; key2 = nop; } ) Now, I am wanting to filter the dataSet for dictionary objects containing ANY of the keys in an NSArray. For example, using the array: NSArray *keySet = [NSArray arrayWithObjects:@"key1", @"key3", nil]; I want to create a predicate that returns and array of any dictionary objects that contain either 'key1' or 'key3' (ie. in this example all dictionary objects would be returned except for the third object - as it does not contain either 'key1' or 'key3'). Any ideas on how I would achieve this? Would I have to use a compound predicate?

    Read the article

  • Add multiple ActionName for button

    - by NewToBirtReporting
    I have one controller on which i have Save button click event. Im using same controller and view for Add and Edit purpose. My code is as per below [HttpPost] [Button(ButtonName = "Save")] [ActionName("Create")] [ValidateAntiForgeryToken(Salt = "PostData")] public ActionResult Save(Ntegra m_Ntegra,FormCollection form) {} As Im Using ActionName("Create") here so button can not work for ActionName("Edit"). can anyone tell me how i can achive my requirnment!! Thanks for help...... :)

    Read the article

  • What if I put two kinds of encoded strings, say utf-8 and utf-16, in one file?

    - by jonny
    In Python, for example: f = open('test','w') f.write('this is a test\n'.encode('utf-16')) f.write('another test\n'.encode('utf-8')) f.close() That file gets messy when I re-open it: f = open("test") print f.readline().decode('utf-16') # it leads to UnicodeDecodeError print f.readline().decode('utf-8') # it works fine However if I keep the texts encoded in one style (say utf-16 only), it could read back ok. So I'm guessing mixing two types of encoding in the same file is wrong and couldn't be decoded back, even if I do know the encoding rules of each specific string? Any suggestion is welcome, thank you!

    Read the article

  • Which jsPerf-test should I consider as standard for checking the performance of javascript template-engines

    - by bhargav
    I am on a search for a javascript template engine that has good performance when used in large js applications and is also very suitable for mobile applications. So I have gone through the various jsPerf-tests for these. There seems to be a lot which show different results and it is confusing to find out which is the standard test. Can some one guide me a standard jsPerf that I can refer to and that should also include following templates dust, underscore, hogan, mustache, handlebars. From what I have observed dot.js is a constant performer with good rendering speed, but is it mature enough for larger applications ? What is this "with" and "no with" that is shown in the jspref tests? Can some one explain. In all the tests I have seen popular templates like mustache, handlebars, dust, hogan,etc seems to be behind performance than other templates, so why people are using them leaving out the top performers,is it because of maturity of these template engines? Thanks in advance

    Read the article

  • Foreign Key vs. Independent Relationships - is there improvement with Entity Framework 5?

    - by zam6ak
    I have read several articles and questions on concept of foreign key vs independent relationship when using Entity Framework. And I am still not 100% sure which way to go.... I would prefer not to "pollute" my domain POCOs by having a property that will be used in FK relationship when I already have a property reference to "has a" object. My questions are (looking at you @EFTeam, @Ladislav Mrnka) are there any improvements on this subject in the upcoming Entity Framework v5? are there more advantages if I use FK instead of independent associations (particularly with code first)?

    Read the article

  • Business Tier | client state in desktop application- way around Stateful Session Beans?

    - by arthur
    I read positive inputs on the following posts concerning client state management: Stateful EJBs in web application?, here, and here. I want to know how implement such client state management for desktop applications (Swing, AWT, SWT, and other). let's assume there are n desktop clients supposed to use some (remote) services provided on an Application Server. How to maintain a separate and permanent data state for each client , distinct from the other without have to use using stateful session Beans (SFSB) ? is that even possible on this application type ? With Webapp(Servlets / JsSF and JSP) some can avoid using SFSB by HttpSession object and/or coupling it with stateless session beans (SLSB). HttpSession object would keep information for each (Web)client separate and the SLSB would play the business logic music. But HttpSession objects aren't present on desktop application and I go stuck with only SFSB and SLSB. Knowing the problems(Concurrency, Error Handling, usw ) of SFSB, I would have not wanted to use it. What would be the other options? is there only SFSB available? Thanks in advances

    Read the article

  • How can I restore the "auto" values with for list-style-type in nested unordered lists with CSS?

    - by Michael
    By default, an unstyled set of nested <ul> lists looks like this (in Chrome, Firefox, and IE at least): The top level has a list-style-type of disc, the next level is circle, and subsequent levels are square. If I include a stylesheet that changes the list-style-type to none, is there a simple way to revert back to the "automatic bullet types" later in the document? (e.g., override with a subsequent CSS definition or JavaScript style change) Basically, I'm looking for something like list-style-type: auto; (which is apparently not valid and has no effect): <style type="text/css"> ul { list-style-type: none; } ul { list-style-type: auto; } /* Does not work */ </style> Setting the list-style-type back to disc changes every bullet in the list and I no longer see different bullets at different levels, so that doesn't work either. Is the only way to accomplish this by explicitly defining styles for every level? e.g.: <style type="text/css"> ul { list-style-type: disc; } ul ul { list-style-type: circle; } ul ul ul { list-style-type: square; } </style>

    Read the article

  • Turkish character problems while parsing (Android)

    - by alper35.5
    I am parsing an html content and have output on my screen. This website have Turkish characters such as çÇsSöÖgGiIüÜ. I am not able to show them as proper characters, they are printed out as question marks yet. Eclipse - Project - Properties - Resource - Text File Encoding = Inherited from container (Cp1254) I searched web and found this solution: Eclipse - Project - Properties - Resource - Text File Encoding = Other: UTF-8 However, it's not working. It only changes my files' current characters. (I have titles that have such characters on my activities) Any help? Thanks in advance...

    Read the article

  • Sarg report error

    - by amyassin
    I have a proxy server that runs Ubuntu Server 11.10, Squid 2.7.STABLE9. I installed sarg (version 2.3.1 Sep-18-2010) to generate reports using the ordinary apt-get install, and added a cron job to generate a report of the day every 5 minutes (that will overwrite the 5-minutes-older one): */5 * * * * /root/proxy_report.sh And the content of /root/proxy_report.sh is: #!/bin/bash /usr/bin/sarg -nd `date +"%d/%m/%Y"` > /dev/null 2>&1 And I added another cron job to generate a full report every hour at :32 (not to collide with the 5 minutes job): */32 * * * * /root/proxy_report_full.sh And the content of /root/proxy_report_full.sh is : #!/bin/bash /usr/bin/sarg -n > /dev/null 2>&1 And I added a small script to remove the yesterday full report (the full report that ends in yesterday that won't be overwritten by the new today full report) in /etc/rc.local to run at startup: /usr/bin/rm_yesterday.sh &>> /var/log/rm_yesterday Where /usr/bin/rm_yesterday.sh: #!/bin/bash find /var/www/sarg/ | grep `date -d Apr1 +"%Y%b%d"`-* | grep -v `date +"%Y%b%d"` | xargs rm -rf * Apr1 is the starting date of the proxy... ** I've placed it in /usr/bin to be mounted early at startup... That arrangement went OK for about a month and a half, except for one time I noticed some errors and reports wasn't generated, and fixed that by making an offset (the two minutes in 32 of the second cron job). However, it then started not to generate reports anymore. By manually trying to generate it it gives the following error: root@proxy-server:~# sarg -n SARG: getword_atoll loop detected after 3 bytes. SARG: Line="154 192.168.10.40 TCP_MISS/200 39 CONNECT www.google.com" SARG: Record="154 192.168.10.40 TCP_MISS/200 39 CONNECT www.google.com" SARG: searching for 'x2f' SARG: getword backtrace: SARG: 1:sarg() [0x8050a4a] SARG: 2:sarg() [0x8050c8b] SARG: 3:sarg() [0x804fc2e] SARG: 4:/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x129113] SARG: 5:sarg() [0x80501c9] SARG: Maybe you have a broken date in your /var/log/squid/access.log file When I looked to /var/log/squid/ folder, I noticed that it contains some rotated logs: root@proxy-server:~# ls /var/log/squid/ access.log access.log.1 cache.log cache.log.1 store.log store.log.1 So maybe sarg installed logrotate with it? Or it comes with the standard Ubuntu? I don't remember I installed it manuallly. The question is: What could've gone wrong? Does it have something to do with rotating the log? How can I trace the error and start generating reports again?

    Read the article

  • Recent DDE / file open issue with Office 2007 affecting only a few machines, is a Windows Update to blame?

    - by kafka
    All our workstations run Windows 7 Professional 64 bit. It started with one, then another, then another couple of machines having a problem accessing Word files locally and on the network. This doesn't happen on my machine though. Affected users get the error message 'There was a problem sending the command to the program'. I've Googled for solutions, but none of the answers worked. They suggested deleting certain registry keys; unregistering and reregistering the program for DDE; resetting the way that the shell opens .docx programs etc. each to no avail. As it affects local and network shares I believe the problem lies with the clients, and not the server, and I'm starting to suspect that there could have been a recent Windows Update which has caused this. I've tried comparing the updates on my working machine with an affected machine, but I can't immediately see any major differences. Has anyone else recently encountered this problem? What are the best steps to take to further isolate what could be causing this?

    Read the article

  • Active Directory management with low user rights

    - by DemonWareXT
    Our problem: The client, a normal user, has to be able to reset multiple passwords at once. Around 30 in one go. This would call for powershell or something along these lines, but for AD and Powershell one needs to be domain administrator. My solution would be to make a service that runs on the AD server and take connections from a program. The service would then do the AD changes. So far so good, I would just like to hear some other thoughts on this problem. Because I sure can't be the only one with it

    Read the article

  • Create a tunnel to my dedicated windows server

    - by Mobiz
    I have a Win 2008 dedicated server. The remote access for MSSQL db is disabled. However I want to connect to it during development from my system. I need to create something like a tunnel from my lap so as to access it. I don't have static IP. Another reason for mentioning about creating tunnel is that my server IP has been whitelisted with other server. The data must originate from my dedicated server then only I can do the testing.

    Read the article

  • How to secure postfix to find out whether the emails are coming really from the sender?

    - by codeworxx
    Is it possible to secure postfix in a way, that incoming emails are checked on whether the email comes really from the sender? Is that possible to write php script and chose a sender, like the mail is really coming from the sender and what are the possibilities for postfix to find out that this mail is not actually coming from the real sender? What I have found out and activated are the options smtpd_sender_restrictions = reject_unknown_sender_domain unknown_address_reject_code = 554 smtpd_client_restrictions = reject_unknown_client unknown_client_reject_code = 554 Please mention, whether I have missed out on any points!

    Read the article

  • Resolve another domain from current AD domain

    - by faulty
    We have 2 AD domain setup in our office. First is the primary domain for our office and exchange. The 2nd one is for development use to simulate production environment of our clients. Both domain are hosted on Windows 2008 R2 Enterprise. We, the development team has no access to the office domain other than login and email purpose. DNS is running on PDC of both domain. Both domain does not use public domain name. Now, our machines are joined to the development domain and we use outlook to access our office's exchange. We've added DNS entries for both the domain. From time to time we are having problem resolving our office domain (i.e. during outlook login), which we need to edit our NIC's DNS to have only DNS server from our office and then flush DNS. After that switch back once it's able to resolve. Is there a permanent solution for this scenario like specifying that the office domain be resolve with another DNS server when requested from the development domain? Thanks

    Read the article

  • How to extract attachments from Exchange 2003 database

    - by John
    I have an ancient Exchange 2003 server that I'm getting ready to retire. All user accounts have been migrated to Google Apps for Business, so no new mail is being sent or received on the server. There are less than 50 accounts on the server, but some are very large so that the whole Exchange database is between 10 and 20 GB. The largest account has over 100,000 messages. I believe that in the migration to Gmail, some attachments were not migrated. For peace of mind, I'd like to get the attachments out of the Exchange database. The only way I know of to do this is to set up a 2nd computer with Outlook on it, set up one of the accounts, and then sync the whole mail history and get the attachments out that way. Is there something simpler that I can do? Here are two possibilities: An Exchange attachment retrieval tool/script that pulls attachments for all accounts directly out of the Exchange database. An Exchange PST exporter tool/script that will export PST files for all accounts so that I can just load the PST files into Outlook at will.

    Read the article

  • Linux as a gateway (no NAT)

    - by Hugo
    I'm trying to configure a linux server as a gateway/router, but I can't get it to work, and all information I've managed to find is NAT-related. I have a public IP block for the gateway and devices behind it, so I want the gateway to simply route packets to the internet - again: no NATing! I've managed to get the gateway to access the internet successfully (that was just a matter of configuring the IP and GW), and the computers behind it can communicate with it. [EDIT: more info] This is actually an IPv6 block (2800:40:403::0/48) (but I've found that most utilities and instructions can be easily adapted from IPv4 to IPv6 with little hastle). The server has too ports: wan: 2800:40:403::1/48 lan: 2800:40:403::3/48 One of the computers behind it is connected to it via a switch; 2800:40:403::7/48 The wan interface on the server can ping6 www.google.com without issues. The lan interface on the server and the client can mutually ping each other without issues (as well as SSH, etc). I've tried setting the server as a default gateway for the client, with no luck: client # route -A inet6 add default gw 2800:40:403::3 dev eth1 server # cat /proc/sys/net/ipv6/conf/all/forwarding 1 I don't want any filtering/firewalling/etc, just plain routing. Thanks.

    Read the article

  • Can a GPO Startup Script starts a background process and exit immediately?

    - by pepoluan
    I have Googled, and not yet found an answer. Scenario: One of my GPOs have a Startup Script that takes a long time to finish. For some reasons, we have to run the scripts synchronously. Naturally, this causes slow startup time (sometimes as long as 15 minutes!) before the Logon screen appears. After profiling and analyzing the perpetrator script, I conclusively determined that the step where it's taking a long time to finish will not affect the result of the succesive GPOs. In other words, that particular step (and all steps afterwards) can run in the background. My Question: Is it possible for the Startup Script to just 'trigger' another script/program that will run to completion even when the Startup Script exits? That is, the "child processes" of the Startup Script continues to live even when the Startup Script's process ends? Additional Info: The Domain Controllers are 2008 and 2008 R2's. The workstations are Windows XP.

    Read the article

  • What would cause my SendMail server not to acknowledge receiving a TCP Sequence?

    - by Mike B
    My TCP/IP Stack knowledge is a little rusty so please bear with me.... I have a CentOS 5.7 server with SendMail and am having seeing intermittent timeout issues sending email (particularly larger email) to other remote domains. It doesn't happen with all attachments or recipient domains. Just some. After some extended troubleshooting, I think I've narrowed it down to TCP Sequences not being acknowledged. Here's a breakdown of the TCP session from a packet capture I collected directly on my MTA (fooMTA): Packet 1 - 11: Standard TCP handshake followed by initial SMTP conversation. No errors. Packet #12 Recipient MTA: TCP sequence 231. Ack 91. Packet #13 FooMTA: TCP sequence 91. Ack 305. Packet #14 FooMTA: TCP sequence 1115. Ack 305. Packet #15 Recipient MTA: TCP sequence 305. Ack 2495. Packet #16 FooMTA: TCP sequence 2495. Ack 305. Packet #17 FooMTA: TCP sequence 5255. Ack 305. Packet #18: Recipient MTA: TCP sequence 305. Ack 5255. Packet #19: FooMTA: TCP sequence 6635. Ack 305. Packet #20: FooMTA: TCP sequence 8015. Ack 305. Packet #21: Recipient MTA: TCP Sequence 305. Ack 8015. Packet #22: FooMTA: TCP Sequence 10775. Ack 305. Packet #23: FooMTA: TCP Sequence 13535. Ack 305. Packet #24: Recipient MTA: TCP sequence 305. Ack 10775 Packet #25: FooMTA: TCP Sequence 14915. Ack 305 It keeps going like this with my server still thinking it hasn’t received sequence 305… in response the remote side eventually retransmits its prior data thinking that it never arrived. Eventually the gap gets so large that no new data is sent and the remote MTA keeps retransmitting old stuff. This contributes to an exponential backoff and eventually the remote side gives up. What’s strange to me is that I see the “missing” TCP sequence (305 in this case) arriving back to my server (via a packet capture collected directly from fooMTA) So I don’t get why my server keeps asking for it. Could this be firewall related? What would be the next step in troubleshooting?

    Read the article

  • enable tcp_syncookies even after reboot

    - by Tim
    I'm running Scientific Linux 6.1 and would like to set net.ipv4.tcp_syncookies=1. I've set that in /etc/sysctl.conf and, if I do a sysctl -p then sysctl -q net.ipv4.tcp_syncookies it shows it's properly set. Sadly, if I reboot the machine, and sysctl -q again, it goes back to 0. I've tried to grep around and see if something else is resetting it to 0 during the boot process but haven't turned up anything. I've googled and everything points to sysctl.conf. The only thing I can think of is maybe networking isn't up by the time that file gets read but, honestly, I'm a developer and well beyond my natural skills here:) I'm tempted to just set it directly in /etc/init.d/network but then that feels hackish and so, I thought better of it and I'm here in search of the "right" way to do it. Any pointers?

    Read the article

  • Server to server replication and CPU and 32k\ corrupt doc

    - by nick wall
    Summary: if database contains a doc with 32K issue or corrupt, on server to server replication it causes marked increase in CPU in nserver.exe task, which effectively causes our server(s) to slow right down. We have a 5 server cluster (1 "hub" and 4 HTTP servers accessed via reverse proxy and SSO for load balancing and redundancy). All are physically located next to each other on network, they don't have dedicated network\ ports for cluster or replication. I realise IBM recommendation is dedicated port for cluster. Cluster queues are in tolerance and under heavy application user load, i.e. the maximum number of documents are being created, edited, deleted, the replication times between servers are negligible. Normally, all is well. Of the servers in the cluster, 1 is considered the "hub", and imitates a PUSH-PULL replication with it's cluster mates every 60mins, so that the replication load is taken by the hub and not cluster mates. The problem we have: every now and then we get a slow replication time from the hub to a cluster mate, sometimes up to 30mins. This maxes out the nserver.exe task on the "cluster mate" which causes it to respond to http requests very slowly. In the past, we have found that if a corrupt document is in the DB, it can have this affect, but on those occasions, the server log will show the corrupt doc noteId, we run fixup, all well. But we are not now seeing any record of corrupt docs. What we have noticed is if a doc with the 32K issue is present, the same thing can happen. Our only solution in that case is to run a : fixup mydb.nsf -V, which shows it is purging a 32K doc. Luckily we run a reverse proxy, so we can shut HTTP servers down without users noticing, but users do notice when a server has the problem! Has anyone else seen this occur? I have set up DDM event handlers for many of the replication events. I have set the replication time out limit to 5 mins (the max we usually see under full user load is 0.1min), to prevent it rep'ing for 30mins as before. This ia a temporary work around. Does anyone know of a DDM event to trap the 32K issue? we could at least then send alert. Regarding 32K issue: this prob needs another thread, but we are finding this relatively hard to find the source of the issue as the 32K event is fairly rare. Our app is fairly complex, interacting with various other external web services, with 2 way data transfer. But if we do encounter a 32K doc, we can't look at field properties, so we can't work out which field has issue which would give us a clue as to which process is culprit. As above, we run a fixup -V. Any help\ comments on this would be gratefully received.

    Read the article

  • Running two Magentos installations, one of which has 3 stores set up as multi-store. Which server?

    - by Pedro Peixoto
    I want to run 4 Magento stores in 2 different installations. 1 is a standalonne installation with 3 languages. The other is a multi-store with 3 different online stores in different domains. At the moment we have a VPS with 1GB memory, would that be enough? I ask because I've finished the standalone store and already put it online, and the server is already running on 62% memory. The ideal would be that this is enough as my company wouldn't like to move to a Dedicated Server (as it involves costs). I'm sure I can try to optimize Magento to run on lower memory (I'm expecting visits averaging 2000/day on all sites), if I could have some tips on the best way to do that Id appreciate it too.

    Read the article

  • Utilising a Magento server cluster to drive hot reindexing

    - by WOBenji
    We've asked a similar question in the past, basically we have a very large Magento store with 500000 products which are currently reindexed once a day, during the night. We'd like to speed this process up significantly, we're at about 4-5 hours now. The solution was suggested for us to do something like this on a server cluster and replicate the database changes after they've been done on a machine that isn't being bothered with serving customers. But what is the mechanism for that? How do we replicate those changes across to the live site from the server cluster? Can someone point me in the right direction here?

    Read the article

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