Daily Archives

Articles indexed Thursday November 15 2012

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

  • How to Link Sub Taxonomy to products in wordpress

    - by rahul251
    I have created custom post types called Internal products I Have a page page-internal-products.php which list all the custom taxonomy for the Custom post type Internal product On clicking on the taxonomies takes me to a page which lists the sub taxonomies for the particular parent taxonomy for which i have created the page called taxonomy-internalproducts_categories.php On clicking on the sub taxonomy. I need to go to a page which lists all the products for this sub taxonomy. How can I achieve this?

    Read the article

  • Removing duplicate solutions

    - by Enoon
    My code merges two lists of lists, item by item, in the following way: mergeL([[a,b],[c,d]], [[1,2],[3,4]], Result). Result = [[a,b,1,2],[c,d,3,4]] And this is the code i use: mergeL([],[],[]). mergeL(List, [], List). mergeL([], List, List). mergeL([X|Rest],[Y|Rest2], [XY|Res2]) :- mergeL(Rest, Rest2, Res2), append(X,Y,XY). This seems to work but if i call it with two lists of the same size i get three repeated results. Example (both list contain only one element): ?- mergeL([[a,b]],[[1,2,3]],Q). Q = [[a, b, 1, 2, 3]] ; Q = [[a, b, 1, 2, 3]] ; Q = [[a, b, 1, 2, 3]]. Is there a clean way to make this output only one solution?

    Read the article

  • How can I count existing and non-existing values with MySQL?

    - by jaya malladi
    I am new to MySQL. I have a table with answer ids. Answers can look like this:a1, a2, a3 ..., but due to some problems some are NULL, some are blank, and some are others like 1 a etc. Now I want to calculate the count of ids with a1 a2 a3 distinctly. But how is it possible to do this leaving others like NULL, blanks and garbage. The output should look like this atype count a1 45 a2 0 a3 56 If there is no row entry for a particular answer, the count should be 0.

    Read the article

  • Custom theme and sherlockActionBar

    - by Atomico
    I am doing a personal theme to use holo widget in 2.3 android. I did this: <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="AppThemes" parent="@style/Theme.Sherlock"> <item name="android:editTextStyle">@style/EditTextAppTheme</item> <item name="android:checkboxStyle">@style/CheckBoxAppTheme</item> <item name="android:radioButtonStyle">@style/RadioButtonAppTheme</item> <item name="android:buttonStyle">@style/ButtonAppTheme</item> <item name="android:imageButtonStyle">@style/ImageButtonAppTheme</item> <item name="android:spinnerStyle">@style/SpinnerAppTheme</item> <item name="android:dropDownSpinnerStyle">@style/SpinnerAppTheme.DropDown</item> <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItemAppTheme</item> </style> </resources> the problem is that widgets don't take the correct style but take the default style. I tried to force assign the @style/EditTextAppTheme at an edittext and it worked.. so the problem is that the theme don't apply. any idea? update: the theme apply and work good..the solo problem is some edittext inside a dialog that show with the standard theme

    Read the article

  • Clojure: I have many sorted maps and want to reduce in order all there values a super maps of keys -> vector

    - by Alex Foreman
    I have seen this but can't work out how to apply it (no pun intended) to my situation. I have a sorted list of maps like this: (note there can be more than two keys in the map) ({name1 3, name2 7}, {name1 35, name2 7}, {name1 0, name2 3}) What I am after is this data structure afterwards: ({:name1 [3,35,0]}, {:name2 [7,7,3]}) Ive been struggling with this for a while and cant seem to get anywhere near. Caveats: The data must stay sorted and I have N keywords not just two.

    Read the article

  • How to add a Fragment inside a ViewPager using Nested Fragment (Android 4.2)

    - by sabadow
    I have a ViewPager with three Fragments, each one shows a List (or Grid). In the new Android API level 17 (Jelly Bean 4.2), one of the features is Nested Fragments. The new functionality description says: if you use ViewPager to create fragments that swipe left and right and consume a majority of the screen space, you can now insert fragments into each fragment page. So, if I understand right, now I can create a ViewPager with Fragments (with a button inside for example) inside, and when user press the button show another Fragment without loose the ViewPager using this new feature. I expend my morning trying to implement this on several ways but I can´t made it... Can somebody show a simple example of how to do this? PS: I'm only interested in doing at this way, with getChildFragmentManager to learn how works.

    Read the article

  • iPhone SDK - Comparing characters in string

    - by Karl Daniel
    Basically what I'm trying to do is compare 2 strings one from a plist and one from the user's input. I use a while loop to step through each character and compare it and if true then I increase an integer then once the loop has finished I work out the percentage correct / similarity of the plist answer and the user's answer. I seem to be having a problem however as the only return I'm getting is 0. Below is the code I'm using... The code below is all functioning and the question no longer requires answering... Working code... answerLength = boxAnswer.length; //Gets number of characters of first string. plistLength = plistAnswer.length; //Gets number of characters of second string. characterRange = 0; //Sets the variable for which character to look at. charactersCorrect = 0; //Sets the variable of number of matching characters. unichar answerCharacter; //Declares a unichar for the first string. unichar plistCharacter; //Declares a unichar for the second string. while (answerLength > 0 && plistLength > 0) { answerCharacter = [boxAnswer characterAtIndex:characterRange]; //Gets character of first string at the index of the range integer. plistCharacter = [plistAnswer characterAtIndex:characterRange]; //Gets character of second string at the index of the range integer. answerLength--; //Reduces number of characters left to compare. plistLength--; characterRange++; //Increases integer to tell it to look at next character in string. if (answerCharacter == plistCharacter) { //Checks to see if character of first string and character of second string match. charactersCorrect++; //If true increases the number correct. } } //Works out percentage of matching characters out of the total string. totalChar = plistAnswer.length; totalPercentage = (charactersCorrect/totalChar)*100; percentageCorrect.text = [NSString stringWithFormat:@"%i%%",totalPercentage]; Variable Declarations... int answerLength; int plistLength; int characterRange; double totalChar; double charactersCorrect; int totalPercentage;

    Read the article

  • Jenkins - Publish Over CIFS Plugin

    - by Juvil
    I am getting confused with this plug in. basically my target is to Deploy files from Server1 to Server2 now the buildoutput dir is in a specific location in Server1 example E:\BuildOutput\Apps\Application1\Bin\ I need to deploy them in Server2 C:\Program Files\Tools\Application1\Bin\ How do I set up this plugin to work to what i need? I am getting stressed in the amount of files that needs to be deployed to another server, i just wished a simple xcopy tool to another server could work.

    Read the article

  • Security in HTTP Adapters

    - by Debopam
    I just started using IBM Worklight 5.0. I have been going through the HTTP Adapters recently and have successfully been able to Run as "Invoke Worklight Procedure". But I am stuck with the Adapter execution in the App. To my knowledge I think this is some kind of security issue where the client request to Worklight Server is unauthorized (401). Can any tell me or refer to some blog/website where there are steps to overcome this problem? I already got some of the websites but at this moment I am really confused on how to use them.

    Read the article

  • NSString cannot be released

    - by Stanley
    Consider the following method and the caller code block. The method analyses a NSString and extracts a "http://" string which it passes out by reference as an auto release object. Without releasing g_scan_result, the program works as expected. But according to non-arc rules, g_scan_result should be released since a retain has been called against it. My question are : Why g_scan_result cannot be released ? Is there anything wrong the way g_scan_result is handled in the posted coding below ? Is it safe not to release g_scan_result as long as the program runs correctly and the XCode Memory Leak tool does not show leakage ? Which XCode profile tools should I look into to check and under which subtitle ? Hope somebody knowledgeable could help. - (long) analyse_scan_result :(NSString *)scan_result target_url :(NSString **)targ_url { NSLog (@" RES analyse string : %@", scan_result); NSRange range = [scan_result rangeOfString:@"http://" options:NSCaseInsensitiveSearch]; if (range.location == NSNotFound) { *targ_url = @""; NSLog(@"fnd string not found"); return 0; } NSString *sub_string = [scan_result substringFromIndex : range.location]; range = [sub_string rangeOfString : @" "]; if (range.location != NSNotFound) { sub_string = [sub_string substringToIndex : range.location]; } NSLog(@" FND sub_string = %@", sub_string); *targ_url = sub_string; return [*targ_url length]; } The following is the caller code block, also note that g_scan_result has been declared and initialized (on another source file) as : NSString *g_scan_result = nil; Please do send a comment or answer if you have suggestions or find possible errors in code posted here (or above). Xcode memory tools does not seem to show any memory leak. But it may be because I do not know where to look as am new to the memory tools. { long url_leng = [self analyse_scan_result:result target_url:&targ_url]; NSLog(@" TAR target_url = %@", targ_url); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Scanned Result" message:result delegate:g_alert_view_delegate cancelButtonTitle:@"OK" otherButtonTitles:nil]; if (url_leng) { // ****** The 3 commented off statements // ****** cannot be added without causing // ****** a crash after a few scan result // ****** cycles. // ****** NSString *t_url; if (g_system_status.language_code == 0) [alert addButtonWithTitle : @"Open"]; else if (g_system_status.language_code == 1) [alert addButtonWithTitle : @"Abrir"]; else [alert addButtonWithTitle : @"Open"]; // ****** t_url = g_scan_result; g_scan_result = [targ_url retain]; // ****** [t_url release]; } targ_url = nil; [alert show]; [alert release]; [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(activate_qr_scanner:) userInfo:nil repeats:NO ]; return; }

    Read the article

  • Getting duplicate count when executing INSERT IGNORE via JDBC

    - by Nickolay Komar
    Is it possible to get the duplicate count when executing MySQL "INSERT IGNORE" statement via JDBC? For example, when I execute an INSERT IGNORE statement on the mysql command line, and there are duplicates I get something like Query OK, 0 rows affected (0.02 sec) Records: 1 Duplicates: 1 Warnings: 0 Note where it says "Duplicates: 1", indicating that there were duplicates that were ignored. Is it possible to get the same information when executing the query via JDBC? Thanks.

    Read the article

  • How would you create a notification system like on SO or Facebook in RoR?

    - by Justin Meltzer
    I'm thinking that notifications would be it's own resource and have a has_many, through relationship with the user model with a join table representing the associations. A user having many notifications is obvious, and then a notification would have many users because there would be a number of standardized notifications (a commenting notification, a following notification etc.) that would be associated with many users. Beyond this setup, I'm unsure how to trigger the creation of notifications based on certain events in your application. I'm also a little unsure of how I'd need to set up routing - would it be it's own separate resource or nested in the user resource? I'd find it very helpful if someone could expand on this. Lastly, ajax polling would likely improve such a feature. There's probably some things I'm missing, so please fill this out so that it is a good general resource.

    Read the article

  • Extending Chrome DevTools for fun and profit...

    Extending Chrome DevTools for fun and profit... Your browser is one of the most and best instrumented development platforms -- you may just not realize it yet. In this episode we'll cover the Audit and Panel extension API's, take a deep dive into the Chrome debugging protocol (and what you can do with it), peek inside the Chrome's network stack, and finally go deep into the guts of Chrome with chrome://tracing! From: GoogleDevelopers Views: 333 12 ratings Time: 23:35 More in Science & Technology

    Read the article

  • Route53 only for wildcard subdomain

    - by Philippe Gerber
    We recently moved our web application to AWS. One thing that is still managed by our old hoster is DNS. OLD HOSTER example.com. NS <Old hoster's name server> example.com. A <ElasticIP on EC2 instance> *.example.com. CNAME example.com. ... I'm now trying to setup and play around with Route53 and use it for name resolution of our EC2 instances. ROUTE53 web-01.aws.example.com. CNAME ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com. web-02.aws.example.com. CNAME ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com. ... Now my question: Is it possible to forward DNS queries for *.aws.example.com to Route53 (ns-xxxx.awsdns-59.co.uk.)? What kind of record would I have to add?

    Read the article

  • Block Domain User login

    - by Param
    I have created a Domain User id ( for example - Auser ). I have integrated my LDAP login with Firewall. I use this user to login in to firewall only. So, I want to block all the login for this User except on Firewall. Is there any way to accomplish this? As per my knowledge, we can specify :- By right click on Domain User -- Properties -- Account tab -- Logonto ( but here we have to specify Computer Name, we don't have any computer name for Firewall -- So i can't use this option ) Through Group Policy Window Setting -- Security Setting -- Local Policies -- User Rights Assignment -- Allow logon Locally (But it has to apply on Computer OU -- So i can't use this option also ) Any Other Option you know ??

    Read the article

  • MySQL daemon keeps terminating unexpectedly

    - by Yehia A.Salam
    The MySQL daemon on my CentOS server keeps crashing, i got the logs from /var/logs/mysqld but still i am not sure how to fix this: 121114 16:22:56 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 121114 21:55:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 121114 21:55:11 [Note] Plugin 'FEDERATED' is disabled. 121114 21:55:11 InnoDB: The InnoDB memory heap is disabled 121114 21:55:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins 121114 21:55:11 InnoDB: Compressed tables use zlib 1.2.3 121114 21:55:11 InnoDB: Using Linux native AIO 121114 21:55:11 InnoDB: Initializing buffer pool, size = 128.0M 121114 21:55:11 InnoDB: Completed initialization of buffer pool 121114 21:55:11 InnoDB: highest supported file format is Barracuda. InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 121114 21:55:11 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 121114 21:55:12 InnoDB: Waiting for the background threads to start 121114 21:55:13 InnoDB: 1.1.6 started; log sequence number 77177262 121114 21:55:13 [Note] Event Scheduler: Loaded 0 events 121114 21:55:13 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.5.12' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) by Remi 121115 00:19:44 mysqld_safe Number of processes running now: 0 121115 00:19:44 mysqld_safe mysqld restarted 121115 0:19:47 [Note] Plugin 'FEDERATED' is disabled. 121115 0:19:47 InnoDB: The InnoDB memory heap is disabled 121115 0:19:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins 121115 0:19:47 InnoDB: Compressed tables use zlib 1.2.3 121115 0:19:47 InnoDB: Using Linux native AIO 121115 0:19:47 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 121115 0:19:47 InnoDB: Completed initialization of buffer pool 121115 0:19:47 InnoDB: Fatal error: cannot allocate memory for the buffer pool 121115 0:19:47 [ERROR] Plugin 'InnoDB' init function returned error. 121115 0:19:47 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 121115 0:19:47 [ERROR] Unknown/unsupported storage engine: InnoDB 121115 0:19:47 [ERROR] Aborting Edit #1 total used free shared buffers cached Mem: 496 370 126 0 24 110 -/+ buffers/cache: 234 261 Swap: 1023 9 1014 Edit #2 Also, largest table in my mysql is 20MB, so my the memory used should be pretty moderate. SELECT CONCAT(table_schema, '.', table_name), CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, ROUND(index_length / data_length, 2) idxfrac FROM information_schema.TABLES ORDER BY data_length + index_length DESC LIMIT 10;

    Read the article

  • Postfix - How to configure to send these emails?

    - by Jon
    I want my mailserver to send mail from my local application "from" any user supplied email address "to" my own address, say "[email protected]". The MX records for "mysite.com" actually point to a different server, even though the outgoing mainserver is running with mydomain set as "mysite.com". Perhaps this is part of the problem? postfix is currently causing a SMTPRecipientsRefused error within the python application. Can anyone point me to what to change in the configuration? Thanks postconf -n: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = mysite.com, localhost.com, , localhost, * myhostname = mysite.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes

    Read the article

  • Follow through - How to setup equivalent USVIDEO.ORG DNS-Proxy on Linux

    - by DNSDC
    I'm quite keen to setup similar service (but FREE) and seems you know how to do this. "you need to run your own private dns with artificial records for example pandora.com you also need a real dns to fall back on. now that all requests for these sites are going to your US located box you can open up port 80 on squid and listen for the traffic. your cache_peer settings should allow you to map each domain to their real ip. The trafic now flows initially from your US located box to the service but then the server responds it responds directly to the host. no magic here. I won't share the fine details as it probably best serves all to not over exploit this." Did you mean we need to 1. Setup Forward-only DNS on a US-based server/ip? 2. Setup cache_peer and cache_peer_domain in Squid, I got this. 3. Any iptables rule, prerouting, postrouting rules needed to accomplish this? Appreciate your expert advice. Cheers, Don

    Read the article

  • Hyper-V: determine the guest's name given the GUID

    - by syneticon-dj
    How would I go about determining the guest's name given its GUID or vice-versa, preferably with only the Hyper-V/Server Core stock install at hands? Rationale: I am in favor of having a repository of dirty tricks to revert to when in great need. To immediately quiesce all (storage) operations of a VM guest without losing the state, I used to run kill 17 <all VM's virtual processes> (signaling SIGSTOP) and resumed afterwards using kill 19 <all VM's virtual processes> (signaling SIGCONT) in ESXi/vSphere shell. I tried the same technique with Hyper-V using Process Explorer's "Suspend" functionality on the vmwp.exe processes and it seemed to work. I have yet to find a way for easily identifying the processes to suspend, though - the vmwp command line is only listing a GUID.

    Read the article

  • How to change HTTP_REFERER using perl?

    - by zuqqhi2
    I tried to change log format and change HTTP_REFERER using perl to change browser's referrer like below. [pattern1] Log Format : %{HTTP_REFERER}o perl : $ENV{'HTTP_REFERER'} = "http://www.google.com"; [pattern2] Log Format : %{X-RT-REF}o perl : addHeader('X-RT-REF' => "http://www.google.com"); [pattern3] Log Format : %{HTTP_REFERER}e perl : $ENV{'HTTP_REFERER'} = "http://www.google.com"; but they didn't work. How can I do it? If you have any idea please teach me. Note that I just want to do this as a countermeasure for illegal access in my intra tool.

    Read the article

  • Why is IIS 7.5 flushing file cache very often?

    - by Steffen
    We're running a Win 2008 R2 server with IIS 7.5 for serving image files. It's only used for static content, and file caching has been set up to cache files for 10 minutes. However the IIS frequently completely flushes the cache (seen by using Perfmon) It's not application pool recycling, it's not because the TTL has expired, so now I'm at a loss :-( I've included a screenshot of the perfmon graph where you can clearly see the issue. Is there anywhere I can see WHY it's doing these flushes ? (Note: I'm aware I could maybe detect it by attaching a debugger to the process, but that's not an option because it's a production server, and it cannot handle the slowdown a debugger would cause)

    Read the article

  • VoIP setup for one external PSTN line

    - by Jcl
    I'm completely new to VoIP and the likes, and I'm trying to find information about what could be the best setup for this. I need 4 (maybe more in the future, but maximum 5 or 6) wireless extensions, connected to 1 PSTN line, and maybe 2 in the future. I've been trying to gather information about the gear needed but everything I find seems too much over-the-top (and extremely expensive). The main problem is that the physical place we are on doesn't have possibilities of having a decent internet connection, so using a external VoIP "virtual PBX" is not an option. Thing is, even if small, phone is critical to this organization. I currently have an analog DECT/GAP PBX which does what I need, however the PBX is very bad and the call quality is horrible, and that's why I want to change it. The requirements would be: 4 wireless terminals (routing cable is not an option), all of them ringing on incoming PSTN calls. Ability to do internal calls (4 separate offices) and ability to pass calls between terminals. The 4 terminals should be able to access the external PSTN line without dialing any special codes. Very important: terminals should be able to issue commands on the PSTN line to the external operator in the form *nn*nnnnnnnn# . Don't know wether this could face to be a problem, but I've had problems with analog PBX which would take any * as a PBX command and wouldn't allow terminals to send it to the external lines. Not so important, but would be nice to have: call waiting music Could anyone recommend such a setup? I need to be able to do this on a EXTREMELY LIMITED budget (that is: I don't have a limit, but all should get as much to zero as possible). I have enough spare powerful computers and a 300mbps wireless network which works just fine, so that's not to include in the budget. Don't really know if this is the best place to ask, but it's the most StackExchange-related site I've found to this subject.

    Read the article

  • wamp remote access

    - by user1589779
    I have a wamp server (Version 2.2 on Windows 7) running on my computer that works perfectly well for localhost access. But now, I need to grant access to a collegue on the same subnetwork. How to achieve that? My collegue receives a 403 error from the browser. I have 2 vhost : <VirtualHost *:80> ServerName localhost DocumentRoot "D:/Workspace" </VirtualHost> <VirtualHost *:80> ServerName oscar DocumentRoot "D:/Workspace/SMACS3/web/htdocs" </VirtualHost>

    Read the article

  • linux + match only VALID IP from text file into other file

    - by yael
    please advice how to match only the valid IPs ( 255.255.255.255 ) from the file.txt and insert only the valid IP into VALID_IP.txt file ( see VALID_IP.txt for example ) the solution should be implemented in my ksh script ( so perl or sed or awk is fine also ) more file.txt e32)5.500.5.5*kjcdr ##@$1.1.1.1+++jmjh 1.1.1.1333 33331.1.1.1 @5.5.5.?????? ~3de.ede5.5.5.5 1.1.1.13444r54 192.9.30.174 &&^#%5.5.5.5 :5.5.5.5@%%^^&* :5.5.5.5: **22.22.22.22 172.78.0.1()*5.4.3.277 example of VALID_IP.txt file 1.1.1.1 192.9.30.174 5.5.5.5 5.5.5.5 5.5.5.5 22.22.22.22 172.78.0.1

    Read the article

  • Apache Alias / VirtualHost run as different user

    - by inx
    I tried to create an alias or virtual host to run as different user. Well below is part of apache httpd.conf that doesn't work. Or, is it even possible? <VirtualHost blah:80> user DifferentUser group DifferentGroup ServerAdmin blah DocumentRoot blah ServerName blah ServerAlias blah ScriptAlias /cgi-bin/ blah DirectoryIndex index.html index.htm default.htm index.shtml index.php ErrorLog logs/blah-error_log CustomLog logs/blah-access_log common <Directory "/blah/"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride all Order Deny,Allow Deny from none Allow from all </Directory> </VirtualHost>

    Read the article

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