Posts

Showing posts from January, 2014

Being Good Without Gods or Religion is Possible

Being Good Without Gods or Religion is Possible 1.Godless Morality & Ethics: Being Good Without Gods or Religion ... Description:Godless Morality & Ethics: Being Good Without Gods or Religion is Possible. By Austin Cline. ... Being Good Without Gods or Religion is Possible and Preferable; 2.Does God Exist? Godless Morality & Ethics: Being Good Without ... Description:17-04-2013 · ... Being Good Without Gods or Religion is Possible. Comments (17) See All Posts; Share; Prev; Next; ... "Being Good Without Gods or Religion is Possible" 3.Christians or others - Is it possible to be a good person ... Description:07-05-2011 · ... Is it possible to be a good person without God and ... yes I think people can be good with out God or Religion ... fine with "being good and ... 4.Secular morality - Wikipedia, the free encyclopedia Description:Though it posits that human beings are capable of being ethical and moral without re

Vatican Suing Over Photo of Pope Kissing Imam

Vatican Suing Over Photo of Pope Kissing Imam 1.Vatican Suing Over Photo of Pope Kissing Imam Description:27-11-2011 · Aw, the pope, the representative of GOD ALMIGHTY on Earth, got his widdle feelings hurt! I don't think God, if he were to exist, would have an ego ... 2.BBC News - Vatican takes legal action over pope-imam kissing ad Description:17-11-2011 · The Vatican says it is taking legal action over the use of an ad showing Pope Benedict kissing a leading imam as part of a Benetton advertising campaign ... 3.Vatican Prepares Legal Action Against Benetton Over Ad Showing ... Description:17-11-2011 · ... showing Pope Benedict XVI kissing a leading imam ... Over Ad Showing Pope Kissing Imam. ... used a photo purportedly showing Pope ... 4.Benetton taken to court for Pope kissing imam advert by ... Description:... showing the pope kissing a leading imam as ... Vatican takes Benetton to court over advert ... a photo montag

Biography: Olive Emilie Albertina Schreiner

Biography: Olive Emilie Albertina Schreiner 1.Biography: Olive Emilie Albertina Schreiner Description:Part 1: An Early Life and The Story of an African Farm Olive Schreiner, the first white South African novelist of consequence, achieved international fame with The ... 2.Olive Emilie Albertina Schreiner -- A Short Biography of Olive ... Description:Olive Schreiner achieved international fame with her book The Story of an African Farm. She was also an outspoken advocate of feminism, socialism, and pacifism, and a ... 3.Olive Schreiner - Wikipedia, the free encyclopedia Description:... Olive Schreiner's life shows an interesting pattern. ... Biography Early life . Olive Emilie Albertina Schreiner ... 4.OLIVE SCHREINER Biography - Writers Description:Biography of OLIVE SCHREINER , Writers. O live Schreiner (Olive Emilie Albertina Schreiner) (March 24, 185... 5.Olive Emilie Albertina Shreiner | Online references ... Description:Re

Country History – Rwanda

Country History – Rwanda 1.Country History – Rwanda - About.com African History Description:Quotes: Rwandan Genocide A Selection of Quotes About The Rwandan Genocide. Background Notes: Rwanda A useful potted history is included with these US Department of ... 2.Rwanda - Wikipedia, the free encyclopedia Description:Rwanda is a country of few natural ... is produced in the southeast of Rwanda, with a history dating back to when the region was part of the independent Gisaka ... 3.History of Rwanda - Wikipedia, the free encyclopedia Description:Human occupation of Rwanda is thought to have begun shortly after the last ice age. By the 16th century, the inhabitants had organized into a number of kingdoms. 4.Rwanda: Maps, History, Geography, Government, Culture, Facts ... Description:Learn about the history, geography and culture of Rwanda and find statistical and demographic information. 5.Rwanda: A Brief History of the Country - Outreach

This Day in African History: August 12

This Day in African History: August 12 1.This Day in African History: August 12 Description:1961, 12 August The radical leader of Tunisia's left-wing opposition party, Salah ben Youssef, is assassinated in Frankfurt, Germany. 1964, 12 August 2.This Day in African History: August Description:A chronicle of events in African history on 11 August. This Day in African History: August 12 A chronicle of events in African history on 12 August. 3.On This Day in Ancient History Description:12-08-2013 · Pompey © Clipart.com On this day in 55 B.C ... 20th Century History; African History; ... On This Day in Ancient History. By N.S. Gill August 12, 2013. My ... 4.Today in History | South African History Online Description:... 12 January 2014; ... Enter a date below, to see historic events that happened on that day ... Copyright © South African History Online ... 5.Today in History | South African History Online Description:1779 - Lang H

This Day in African History: February 08

This Day in African History: February 08 1.This day in African-American History - 08 February - National ... Description:On this day in African-American History... 1831 - The first, black female physician, Rebecca Davis Lee Crumpler, was born in Delaware on this day. 1894 - The ... 2.This Day in African History: February 08 Description:A chronicle of events in African history on 8 February. ... 1917, 8 February Senussi campaign in Egypt and Sudan is successfully ended by the British. 3.This Day | History - History.co.uk | Shows, Videos, Topics and ... Description:This Day; Topics. History of South Africa; History of WW2; ... 08 February - Americans secure Guadalcanal. ... This day in history. prev; 4.This Day in African History: February Description:... happened in African history in the month of February. ... Day in African History: February 08 ... in African history on 10 February. This Day in ... 5.On this day, 08 January, in Af

This Day in African History: March 21

This Day in African History: March 21 1.This Day in African History: March 21 Description:A chronicle of events in African history on 21 March. ... 1960, 21 March South African police kill 69 and injure at least 186 when they opened fire on approximately ... 2.Day In History: What Happened On March 21 In History? Description:March 21: This Day In History. March 21st is the common date of the March equinox ... 3.This Day in African History – Namibia Achieves Independence Description:21-03-2013 · ... (although South Africa continued to call it South West Africa). On 21 March 1990 Namibia became the forty ... This Day in African History: July 10; 4.This Day | History Description:21 March - Stanley begins his ... journalist Henry Morton Stanley begins his famous search through Africa for the missing British ... This day in history. prev; 5.History for March 21 - On-This-Day.com Description:... united states history, world history, mu

Nationality and Flag Act No. 40 of 1927

Nationality and Flag Act No. 40 of 1927 1.Pre-Apartheid Era Laws: Nationality and Flag Act No. 40 of 1927 Description:Definition: The Nationality and Flag Act of 1927 denied Indians the right to become South African citizens by naturalization. Amended by the Provincial Government Act ... 2.Overview 1927_040 - Union Nationality and Flags Act, No. 40 of ... Description:To define Union nationality, and to provide for the Flags of the Union of South Africa. 3.Gazette Notices » Union Nationality and Flags Act No. 40 of 1927 Description:Gazette Notices / Acts Union Nationality and Flags Act No. 40 of 1927 4.Immigration and Nationality Act (INA) - About.com Job Searching Description:The Immigration and Nationality Act (INA) ... Nationality and Flag Act No. 40 of 1927; ... Top 10 Jobs No Degree Required; 5.Pact Government -- South Africa's Pact Government of 1924 to 1933 Description:... an official language through the Official Languag

Tutankhamun and the Golden Age of the Pharaohs Exhibition: Mannequin

Tutankhamun and the Golden Age of the Pharaohs Exhibition: Mannequin 1.Tutankhamun and the Golden Age of the Pharaohs Exhibition ... Description:A gallery of artifacts from the Tutankhamun and the Golden Age of the Pharaohs Exhibition: Mannequin. 2.Tutankhamun: Mannequin - About.com London Travel Description:Mannequin Tutankhamun and the Golden Age ... Golden Age of the Pharaohs in London. Tutankhamun and the Golden Age of the Pharaohs Visitor Information Tutankhamun ... 3.Premier Exhibitions - Tutankhamun : King Tut Museum and Exhibit Description:Our exhibition, Tutankhamun: The Golden King and the Great Pharaohs, will show you objects from King Tut, one of the most important rulers in Egyptian history. 4.Exhibitions of artifacts from the tomb of Tutankhamun ... Description:3.1 Other museums to host the exhibition; 4 Tutankhamun and the Golden Age of the ... Tutankhamun and the Golden Age of the Pharaohs consists of the same items from ..

Biography: Nelson Rolihlahla Mandela

Biography: Nelson Rolihlahla Mandela 1.Biography: Nelson Rolihlahla Mandela - About.com African History Description:Biography: Nelson Rolihlahla Mandela Former president of South Africa and world acclaimed international statesman. By Alistair Boddy-Evans 2.Nelson Mandela - Wikipedia, the free encyclopedia Description:Nelson Rolihlahla Mandela (18 July 1918 – 5 December 2013) was a South African anti-apartheid revolutionary, politician, activist, lawyer, and … 3.Biography – Nelson Mandela Foundation Description:Rolihlahla Mandela was born into the Madiba clan in Mvezo, Transkei, on July 18, 1918, to Nonqaphi Nosekeni and Nkosi Mphakanyiswa Gadla Mandela, principal counsellor ... 4.Biography: Nelson Rolihlahla Mandela - About.com African History Description:Biography: Nelson Rolihlahla Mandela (Part 2 of 3) Law Practice, the ANC, and the Freedom Charter. By Alistair Boddy-Evans 5.Nelson Mandela Biography - Birthday, Facts, Life Story,

amazon web services - CloudFormation S3 specify physical name -

i deployed template s3 bucket. noticed 'logical id' field resource name, 'physical id' field in format of --. there way override behavior? need able specify exact name. everywhere ive looked suggests make through console, that's useless me. need automation. can me? i have been coming against same issue. know is possible set physical name of resource when create using ruby sdk aws. use ability can tear down/create elbs known , stable physical names, based on environment , server role, , backend nodes can auto-join upon deployment looking elb corresponding own environment , role. however, when using cloudformation, resources (elbs, sgs) take resource name specify , prefix or suffix things stackid etc. breaks above system having elb names different after each deployment. the cloudformation documentation no means bad, seem lack lot of edge cases. haven't yet found out if setting physical name possible or not. the aws sdk ruby easy use - have no

javascript - Ajax post response from express js keeps throwing error -

i having real hard time standing bidirectional data transfer html page node.js application , html page. i'm pretty sure i'm on correct solution, i'm not getting work. i'm using following node.js application: var express = require('/usr/lib/node_modules/express'); var app = express(); app.use(function(err, req, res, next){ console.error(err.stack); res.send(500, 'something broke!'); }); app.use(express.bodyparser()); app.post('/namegame', function(req, res) { console.log('got request name: ' + req.body.name); settimeout(function() { var newname = "new name-o"; res.send({name: newname}); }, 2000); } ); app.listen(8088, function() { console.log("server , running"); }); the following html page: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> &

SQL Server : return most frequently occurring values (and counts) from across 9 columns in one table -

i have sql server 2005 database table ( expenseformitems ) (among other things) stores street addresses across 11 columns ( fromtravel , totravel , totravel1 , totravel2 , totravel3 .... totravel9 ). basically trip 11 total legs/stops, google calculated mileage/etc (not important here). i able return (say 15) occurring addresses across 11 columns, number of times occur. so basically [to] [occurrances] ============== address1 328 address2 233 address3 112 .... address15 23 i'm guessing sort of un/pivot in use here, i've never done cool enough have used 1 before, not grasping how apply (what i've read them) case. tia it sounds want unpivot data take data columns , convert rows. the basic structure be: select col, address expenseformitems unpivot ( address col in (fromtravel, totravel, totravel1, totravel2, totravel3, totravel4, totravel5, totravel

jQuery .clone() of audio tag with new ID not playing on IE or FF from inside a .click() -

jquery .clone() of audio tag new id not playing on ie or ff inside .click() i have simple audio tag in body of page <audio preload="auto" id="badclick"> <source src="audio/button-4.ogg"/> <source src="audio/button-4.mp3"/> <source src="audio/button-4.wav"/> <source src="audio/button-4.m4a"/> </audio> i use code clone , assign id 'badclick_1_1' var gclk = 'badclick_1_1'; sounds[1] = $('#badclick'); $(sounds[1]).clone(true).attr('id', gclk).insertafter(sounds[1]); i try , play sound inside .click() handler although plays in chrome doesn't on ie , ff var vol = .05; var xclk = 'badclick_1_1'; var audiobad = $('#' + xclk)[0]; audiobad.volume=vol; audiobad.play(); any thoughts why?

How to create tables from column data instead of row data in HTML? -

according article @ w3 schools , 1 can create basic table in html this: <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> from above, appears 1 enters data rows. i have situation need enter of data columns. possible? <table border="1"> <tc> <td>row 1, cell 1</td> <td>row 2, cell 1</td> </tc> <tc> <td>row 1, cell 2</td> <td>row 2, cell 2</td> </tc> </table> you're best bet render table rows, , use javascript invert table http://jsfiddle.net/csgk9/2/ the following code invert table (this sample code uses jquery) $("table").each(function() { var $this = $(this);

vb.net - Issue with some Visual Basic programming code -

basically have design fruit game random fruit generated , child has guess fruit type. if child guesses right, receive message saying congrats , if wrong, receive message saying "try again". i have done programming don't know going wrong when type name of fruit. because though right, gives message saying wrong. i have program code when fruit right , message it. private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click button1.visible = true ' tools need hide when check button cliked button2.visible = false picturebox1.visible = false textbox1.visible = false if label1.text = "1" , textbox2.text = "banana" ' if both true following result true picturebox2.image = my.resources.well_done 'my.resources.name 'the well_done picture appears correct picturebox2.visible = true '- answer , @ same ti

android - Can't instantiate class, no empty constructor, SQLiteHelper -

i'm trying android application using sqlite when try launch application on smartphone, appears white screen , crash. so have looked @ logcat , showed errors: 04-18 01:33:32.186: e/androidruntime(26741): fatal exception: main 04-18 01:33:32.186: e/androidruntime(26741): java.lang.runtimeexception: unable instantiate activity componentinfo{com.example.sqliteexample/database.mysqlitehelper}: java.lang.instantiationexception: can't instantiate class database.mysqlitehelper; no empty constructor 04-18 01:33:32.186: e/androidruntime(26741): @ android.app.activitythread.performlaunchactivity(activitythread.java:2034) 04-18 01:33:32.186: e/androidruntime(26741): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2135) 04-18 01:33:32.186: e/androidruntime(26741): @ android.app.activitythread.access$700(activitythread.java:140) 04-18 01:33:32.186: e/androidruntime(26741): @ android.app.activitythread$h.handlemessage(activitythread.java:1237) 04-18

Embed videos which have no control options and close option in HTML document -

trying embed video file (mp4) html document. video play without being paused , without being closed/minimized. <video width="320" height="240"> <source src="mov.mp4" type="video/mp4"> </video> i using code play video in html. not able remove controls video. if right click on video, still control options. so know if there way disable controls on video or use player can remove controls. i know if can dynamically write display data on video space while being played.

java - Amazon S3 upload InputStream - thread hangs -

i writing basic method put/get files amazon s3 bucket. here relevant code method."key" isthe s3 name , "savestream" inputstream upload myupload = transfermanager.upload(daqbucketname, key, savestream, metadata); try { myupload.waitforcompletion(); savestream.close(); } catch (interruptedexception e) { key = null; e.printstacktrace(); } catch (amazonserviceexception e) { key = null; e.printstacktrace(); } catch (amazonclientexception e) { key = null; e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } { if (savestream != null) { try { savestream.close(); } catch (ioexception e) { e.printstacktrace(); } } } return key; } the stream uploads there thread stops program completing (leaving program running). ideas going wrong ?here jstack dump: "attach listener" daemon prio=10 tid=0x6a403c00 nid=0x2

java - MVC and Swing in desktop application -

after realizing have ignored mvc pattern have tried utilize concept in application swing view. have read of posts on subject of mvc swing still bit confused, because complicated me grasp, , think need basic clarifications don't set off on wrong path. i wonder how common use mvc in real projects. many online tutorials seem leave out controller , mix model, while confused xstl:s business logic capabilities. why want address datasource jsp view? these thoughts aside, proper question this: if have swing component, should event listener in swing class update component state through calling (static perhaps?) methods in pojo controller class, in turn gets appropriate business logic model, made pojo class hierarchy , associated persistence? i've worked freelance long time , 90% of projects java swing (desktop applications). lot of projects involved migration languages visual fox pro java, pain, because hard part not think in logic done, hard part take code mess , tur

php - Server will not return AJAX GET request with CORS enabled -

i'm trying enable external sources make requests server. right i'm testing on personal server hosting through godaddy. issue? i have following code on page i'm trying make request to //page.php <?php header("content-type: application/json") header('access-control-allow-origin: *'); header('access-control-allow-methods: get'); include_once 'php_dom/simple_html_dom.php'; include_once 'phpquery.php'; if(isset($_get['item'])){ echo json_encode(array("data" => $_get['item'])); } else{ echo json_encode(array("error"=>"no item provided")); } i tried making request (with url, obviously) , i'm not getting back. $.getjson("http://www.example.com/page.php?item=123&format=json&callback=?", function(data) { alert(data); }); chrome developer shows successful request nothing returned. doing incorrectly? when use callback=? response

python - Get response encoding using httplib/http.client -

how can incoming response's encoding using httplib/http.client? i can see part of content-type using getheaders(), guess bad practise parse since might in few different formats, , supposed use particular method in httplib/http.client instead: >>> r = h.getresponse() >>> r.getheaders() [('transfer-encoding', 'chunked'), ('expires', 'tue, 11 oct 1988 22:00:00 gmt'), ('vary', 'accept-encoding'), ('server', 'nginx/1.2.6'), ('connection', 'keep-alive'), ('pragma', 'no-cache'), ('cache-control', 'no-cache, must-revalidate'), ('date', 'thu, 18 apr 2013 00:46:18 gmt'), ('content-type', 'text/html; charset=utf-8')] what best way incoming encoding? not direct answer, maybe find useful. use requests library. there reason people stopped building own http libraries. in fact, httplib says use urllib which uses http

php - Limit the size of text being echod from an array Codeigniter? -

in ci application displaying text array: <?php echo $music[0]['title']?> what easiest way limit size of text either limit text in terms of characters or pixel size. tried using css works actual text. appropriated. //in controller $this->load->helper('text'); //in view file //for word limiter use word_limiter($str, $limit = 100, $end_char = '&#8230;'); //for character character_limiter($str, $n = 500, $end_char = '&#8230;'); example: <?php echo word_limiter($music[0]['title'],30); ?>

C++: avoid optimizing out variable -

i have useful code in constructor or class valuable . want sure it's executed before submain . how can guarantee it's not optimized out? int main() { // dear compiler, please don't optimize ctor call out! valuable var; return submain(); } is local variable enough? need use static : static valuable *v = new valuable(); delete v; v = null; can shorten previous 1 liner: delete new valuable(); if constructor or destructor has observable behavior, compiler not allowed optimize out. there's no need tricky.

ios - Format 9999999 into 9,999,999 (comma after every third digit) using NSNumberFormatter -

similar comma separated thousand nsstring stringwithformat specific use case. how insert comma (,) after every third digit? some cases: 9999999 → 9,999,999 1234 → 1,234 3432423455435435 → 3,432,423,455,435,435 the results expected regardless of locale or other circumstance. you're looking nsnumberformatter . easiest way use this: nsstring *formatted = [nsnumberformatter localizedstringfromnumber:@(1234) numberstyle:nsnumberformatterdecimalstyle]; nslog(@"%@", formatted); // logs "1,234", depending on locale.

objective c - CGAffineTransformMakeRotation not resizing view in iOS 6 -

Image
when use cgaffinetransformmakerotation on view not resize view. cuts part of view out. works fine on ios 5.1, reason not work on ios 6. could please explain doing wrong/not taking consideration added in ios 6? here code using: zoomstepper.transform = cgaffinetransformmakerotation(270.0/180*m_pi); while view rotates expected in ios 5, in ios 6 not. views have same bounds , frame after rotation in both ios 5 , ios 6. wondering how can ios 5 behavior rotate in ios 6. ios 5: ios 6: i figured out. if create new view , apply rotation view , add view wish rotate subview rotate , works on both ios 5 , ios 6: uiview *myview = [[uiview alloc] initwithframe:cgrectmake(0, 0, 94, 27)]; [myview settransform:cgaffinetransformmakerotation(270.0/180*m_pi)]; [self.view addsubview:myview]; [myview addsubview:zoomstepper];

c++ - Does this StackOverFlowException require pointers to correctly work? -

i made program searches palindromes reading in .txt file, placing output onto separate .txt file. it works should 50 or characters. if copy , past large amount of words onto .txt file read, @ runtime "process terminated due stackoverflowexception". opens file called chkstk.asm , has arrow pointing called- "test dword ptr [eax], eax ; probe page". next box comes break , continue option , says, "an unhandled exception of type 'system.stackoverflowexception' occurred in palindrone.exe" i working on changing things around use pointers , such , possibly store things in vectors. however, still not sure reason error , want know why acting , needs changed can have read , process large blocks of text. not having pointers reason working incorrectly? #include <iostream> #include <string> #include <ctype.h> #include <iterator> #include <algorithm> #include <fstream> using namespace std; /** recursivly reverse

java - Creating a sub menu using String/char? -

public static string getsubmenu(string submenu){ scanner keyboard = new scanner(system.in); string chosen="", a="a",b="b", a="a", b="b"; do{ chosen = keyboard.next(); keyboard.nextline(); system.out.print("\n\n"); }while(chosen.compareto(a)); return chosen; } //this function below fine. public static void menu(){ string unem=""; do{ system.out.println("sub menu"); system.out.println("select option\n\n"); system.out.println("a.sort name\n" + "b.sort time\n" + "c.exit sub-menu\n\n"); system.out.print("input number selected option: "); unem= getsubmenu(unem); if("a".equals(unem)|| "a".equals(unem)){ } i

Local testing for Android App using Cloud Endpoints for Google App Engine -

i developing android app uses google cloud endpoints on google app engine (in python) backend. android app authorizes user using google play services on android device, , works fantastically. however, have actual users, i'd able test locally before deploying app engine api changes production, , haven't figured out how have android app talk local development server anywhere. testing recommendations suggest manual tinkering api explorer, i'm using endpoints proto datastore api, makes android development easy, makes api explorer useless, since calls need make far more complicated can generate hand. one answer this question suggests there way point android client @ local server, while can use --host argument have dev_appserver's default server listen on other localhost, can't seem find way same api server. , if that, might first step full end-to-end local testing setup android app. can post more details on how might this, or short of that, please enlighte

C++ store any child struct/class in array? -

in c++ have series of structures defined... struct component {}; struct scenegraphnode : component {}; struct renderable : component {}; struct health : component {}; these classes, i've been told there little difference in c++. in java possible declare array of type component , put class extends (inherits) component it. java considers them components , since uses smart pointers, java's "array" list of smart-pointers same size. however understand java handles arrays different c++. when checked size of each of these structs got following. component // 4 scenegraphnode : component // 8 renderable : component // 8 health : component // 20 which isn't suprising. when create array of components, size of blocks going 4 (bytes) won't hold of other structures. so question is, how can store loose list of components (ie list can store class / struct inherits component)? in java mind-numbingly simple do. surely there

Replace the first occurence of a text in a given input using Powershell script -

the following code works, replaces occurrences of text finds. there way replace first occurrence. have tried 4 days now. please help. cls $filename = "c:\test\bmsbackuplog.htm" $findstring=select-string $filename -pattern "the backup of volume system reserved" -list $replacement = "<tr><td>change using line</td></tr>" $firstdata=$findstring[0].line $both="$firstdata$replacement" $match ="the backup of volume system reserved*.*" (get-content ($filename)) -replace $match,$both | set-content "c:\test\bmsbackuplog.htm" i use zero-width negative lookbehind assertion that: $filename = "c:\test\bmsbackuplog.htm" $pattern = 'the backup of volume system reserved' $replacement = '$1<tr><td>change using line</td></tr>' [io.file]::readalltext($filename) -replace "(?<!$pattern[\s\s]*)($pattern)", $replacement

unix - echo "You have not entered a file" -

the problem want echo string "you have not entered file". simply put, if user literally inputs nothing after calling unix script, receive error message. here code for var in "$@" file=$var if [ $# -eq 0 ] echo "you have not entered file" elif [ -d $file ] echo "your file directory" elif [ -e $file ] sendtobin else echo "your file $file not exist" fi done i cannot figure out wrong, believe it's in first if statement if user enters no arguments, $@ empty -- in other words, loop runs 0 times. check needs happen outside loop. additionally, -d , -e checks, should quote "$file" , otherwise if user entered empty string arg, unexpected behavior (it if no arg had been passed, , in case -d , -e end returning true ).

java - running from console is ok, from Eclipse error -

Image
i'm going crazzy eclipse. writing simple test class uses external jar. uses native library .dll when running eclipse, command run. here stack trace: exception in thread "main" java.lang.unsatisfiedlinkerror: c:\program files\yaz\bin\yaz4j.dll: specified procedure not found @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary1(classloader.java:1939) @ java.lang.classloader.loadlibrary0(classloader.java:1864) @ java.lang.classloader.loadlibrary(classloader.java:1854) @ java.lang.runtime.loadlibrary0(runtime.java:845) @ java.lang.system.loadlibrary(system.java:1084) @ org.yaz4j.connection.<clinit>(connection.java:56) @ ru.test.testconnection(test.java:20) @ ru.test.main(test.java:15) but when run code console this java -cp "bin;c:\program files\yaz\java\yaz4j.jar" ru.test everything works perfect! it's same code. how works in console , not works in eclipse? here how

xapian - Django-haystack not updating index -

using django-haystack 2.0.0 , xapian-haystack 2.0.0, migrated code 1.1.5 said in docs . search_indexes.py looks like: from haystack import indexes app.models import post class postindex(indexes.searchindex, indexes.indexable): text = indexes.charfield(document=true, use_template=true) def get_model(self): return post def index_queryset(self, using=none): """used when entire index model updated.""" return self.get_model().objects.filter(visible=true) but when go rebuild_index, says: are sure wish continue? [y/n] y removing documents index because said so. documents removed. with verbosity: skipping '<class 'django.contrib.auth.models.permission'>' - no index. skipping '<class 'django.contrib.auth.models.group'>' - no index. ... skipping '<class 'app.models.post'>' - no index. so, don't know why haystack doesn't index

http - How to call external rest service from angularjs? -

trying call external rest service angular using $http service. thing stuck on $http.get method, because everytime call rest service error status = 0 , no information in data parameter of error callback. so far i've tried calling local service runnig on port 5000 : $http.get('http:// localhost :5000/ping') , supposed return json object property , value. approach calling http://api.flickr.com/services/rest/?method=flickr.test.echo&name=test in hope of getting answer. both of them same error: mentioned earlier. the call made angular controller has injected http service. thanks. have tried: $http({method: 'get', url: 'someurl'}). success(function(data, status, headers, config) { //set view model or something. }). error(function(data, status, headers, config) { });

ruby on rails - Validation for nested attributes -

iam using nested forms in rails 3.2.8 when go in edit page when ever add nested attributes , make empty , submit form nested attributes not validated , not displaying message these how validates nested attributes in nested form let consider code follow : user model : class user < activerecord::base has_one :company attr_accessible :first_name, :last_name validates :first_name, :presence => true validates :last_name, :presence => true accepts_nested_attributes_for :company end user model has 1 company , suppose want accept nested attributes users company. comapny model : class company < activerecord::base belongs_to :user attr_accessible :company_name, :address validates :company_name, :presence => true validates :address, :presence => true end comapny model has company_name , address. can accept company attributes user view , on user save check both validates i.e. user company. if validation fails, i

msbuild to copy to multiple locations defined in item metadata -

i have item metadata want copy perform actions on , result occur in multiple locations, example, want copy file multiple locations: <itemgroup> <myitem include="myfile.txt"> <out>c:\blah;c:\test</out> </myitem> </itemgroup> how setup target create c:\blah , c:\test if dont exist, copy myfile.txt c:\blah\myfile.txt , c:\test\myfile.txt i want list of full output paths (c:\blah\myfile.txt , c:\test\myfile.txt) if want clean them during clean. if dont want change structure of itemgroup, need handle have nested itemgroup (the metadataelement out). therefor need batch itemgroup myitem target , inside can batch out. made small example project: <?xml version="1.0" encoding="utf-8"?> <project defaulttargets="copyfiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" toolsversion="3.5"> <itemgroup> <myitem include="myfile.txt"

datetime - MySQL date_add and repeat forever -

i got alert table users, in have send alerts users in user defined intervals 0 ( once), 3 months, 6 months, 1 year so designed table id | user_id | alert_date | repeat_int -----+--------------+-------------------------+------------- 12 | 747 | 2013-04-19 00:00:00 | 0 13 | 746 | 2013-03-19 00:00:00 | 1 14 | 745 | 2012-04-19 00:00:00 | 0 15 | 744 | 2013-04-19 00:00:00 | 0 16 | 743 | 2013-05-19 00:00:00 | 0 we sending alert day before "alert_date" with following query can fetch data select al.id, al.user_id, al.alert_date, al.repeat_int repunit alerts al date_add(alert_date,interval repeat_int month)=date_add(current_date,interval 1 day) or date(al.alert_date)=date_add(current_date,interval 1 day) its working file real problem the repeat works once, need repeat every interval ie. if alert date 2012-03-14 , repeat_int 0 - need

Char pointer weird expression in c -

this question has answer here: with arrays, why case a[5] == 5[a]? 15 answers i know why code running. code: #include <stdio.h> int main(int argc, char* argv[]) { char* c = "1234567"; printf("%c\n", 5[c]); return 0; } result: 6 if confused a[b] syntax, refresh c knowledge. a[b] defined *(a + b) , since a+b same b+a , a[b] , b[a] .

input - Use Javascript to apply CSS property of fontWeight to label tag of radio button -

i have searched internet looking solution, , i've reached wit's end. i've been experimenting javascript few weeks now, life of me can't manage make new project work. my initial goal bold correct answers online quiz i've been developing 1 of classes. can bold correct answers using css enough, marked class name of "correct", can't make javascript execute command same @ click of button. if me solve issue appreciated. clearcorrectanswers() function meant reverse effects of showcorrectanswers(). the javascript i've been developing can found below: function showcorrectanswers() { var correctanswers = document.getelementsbyclassname("correct"); (var count = 0; count < correctanswers.length; count++) { correctanswers[count].style.fontweight = "bold"; } } function clearcorrectanswers() { var correctanswers = document.getelementbyclassname("correct"); (var count = 0; count < corre

perl - $_ outputting extra bit of data -

Image
the static $_ might needs flushed. tried done $|=1;. desired output: client connected server. sent server : sas4 sent server : 50 sent server : sas_action login sent server : login bss sent server : password cleint sent server : $end$ message received server : sas4 message received server : 61 message received server : sas_action login_ack message received server : ack_status 0 message received server : ack_message logged in message received server : $end$ server waiting client. connected : 127.0.0.1, port : 1862 message received client : sas4 message received client : 50 message received client : sas_action login message received client : login bss message received client : password cleint message received client : $end$ server client : sas4 server client : 61 server client : sas_action login_ack server client : ack_status 0 server client : ack_message logged in server client : $end$ code : client use strict; use warnings; use io::socket::inet; $socket = new