Posts

Showing posts from August, 2011

java - Error: No enclosing instance of type zad_II_1 is accessible -

this question has answer here: java - no enclosing instance of type foo accessible 5 answers i'm learning abstract classes in java , have little problem error: no enclosing instance of type zad_ii_1 accessible. must qualify allocation enclosing instance of type zad_ii_1 (e.g. x.new a() x instance of zad_ii_1). wrong? code: public class zad_ii_1 { abstract class pacjent{ string imie; pacjent(string imie){ this.imie=imie; } abstract string nazwiskoo(); abstract string podajchorobe(); abstract string podajlek(); string nazwisko(){ return imie; } string choroba(){ return podajchorobe(); } string leczenie(){ return podajlek(); } } class ch

php - count mysql values for the week and then start count again from monday? -

i have count query counts how many times user has viewed users profile. counts rows in table, wondering if there way in php use calculation says count rows in table 'ptb_profile_views' monday sunday , start 0 again on following monday , count values week , not include counts previous week, im not sure possible thought because need time of memory aspect behind it, the other option wondering whether theres mysql statement can add every sunday @ 00:00am delete ptb_profile_views , start fresh monday. can please me sort of solution, thanks my table looks like: id | profile_id | viewed_id 1 4 8 2 5 6 mysql function check_profile_views() { global $connection; global $_session; $query = "select count(distinct profile_id) totalcount ptb_profile_views viewed_profile_id=".$_session['user_id']." , profile_id!='-1'"; $check_profile_

How to generate random Y at specific X from a linear model in R? -

say have linear model f1 fit x , y data points: f1 <- lm(y ~ x,data=d) how can generate new y values @ new x values (that different old x values within range of old x values) using f1 fit in r ? you can use predict this: x <- runif(20, 0, 100) y <- 5*x + rnorm(20, 0, 10) df <- data.frame(x, y) df plot(df) mod <- lm(y ~ x, data = df) x_new <- 1:100 pred <- predict(mod, newdata=data.frame(x = x_new)) plot(df) points(x_new, pred)

javascript - Is it possible to do a real time on hover function? -

i have div #conteudo , 2 links #linkprev , #linknext . when hover on link, .animate() left or right div #conteudo . html: <div id="conteudo"> <div class="boxes" id="content1"> <div class="boxes" id="content2"> <div class="boxes" id="content3"> </div> <a id="linkprev" class="linksnav"></a> <a id="linknext" class="linksnav"></a> css: #conteudo{width:2000;position:relative; height:1080px;} .box{width:0; overflow:hidden; float:left;} js: $('#linknext').on({ mouseenter: function(){ if ($('#conteudo .boxes').hasclass('ativo')) { $('#conteudo .boxes').removeclass('ativo'); $('.boxaberto').animate({width:'0'},600, function(){ console.

c++ - GetShortPathNameW returns the file extension. I want it to ignore the .exe -

i have getshortpathnamew in c++ msvc 2008 free edition. want use can search or return filename without .exe extension. chance me that? code below have: wchar buffer[max_path]; lpcwstr datafilepath = wargv[datafile_argv]; // hack windows in case there unicode chars in path. // normal argv[] array has ????? instead of unicode chars // , fails, instead manually short file name, // using ansi chars. if (wcschr(datafilepath, '\\') == null) { getcurrentdirectoryw(max_path, buffer); wcscat(buffer, l"\\"); wcscat(buffer, datafilepath); datafilepath = &buffer[0]; } if (getshortpathnamew(datafilepath, directorypathbuffer, max_path) == 0) { platform->displayalert("unable determine startup path: getshortpathnamew failed."); game_file_name = null; return; } i want use can search or return filename without .exe extension. sure, use pathre

javascript - Leaflet marker is not draggable even if draggable=true -

i'm using leaflet map markers . when user clicks "edit" on page, want make markers draggable. if set property draggable true each marker, doesn't work. when create new marker , set property right beginning, works. you gotta this: marker.dragging.disable(); // marker.dragging.enable(); my first attempt changes technical property not the behavior .

python - setting GAE namespace -

this function works fine on interactive console: from google.appengine.api import namespace_manager google.appengine.ext import db namespace_manager.set_namespace("some_namespace") class class(db.model): c = db.stringproperty() x = class(c="text") x.put() but when login executes namespace_manager.set_namespace(user.namespace) data retrieved , stored in datastore belongs root (empty) namespace. that raises questions am setting namespace wrong? do have set each time before retrieve , store data (that wan't case in guestbook example) if namespece set on server side how know post/get() belongs namespace? please dont point me link: https://developers.google.com/appengine/docs/python/multitenancy/multitenancy documentation very... edit answers question "set_namespace(namespace) sets namespace current http request." and guess answer "why guestbook example different" in appengine_config.py . now question - wh

ruby on rails - Strange error "403 Forbidden" for files in public/images -

i have got strange error - "403 forbidden" images in directory public/images . other images nested directories loads without problems (i.g. public/images/product ). i'm using nginx + passenger + capistrano. in production.rb have config.serve_static_assets = true . maybe error in assets pipeline? have checked permissions folder? in right-click -> properties or 'chmod' '755'?

How can I push a branch of my GitHub project repo to the Moovweb Cloud? -

i using github , have been pushing master branch of repo moovweb cloud. have started branching project. how can push specific branch moovweb cloud? thanks! actually, need push new branch master. moovweb cloud doesn't compile other branches. it's not meant serve code hosting repository rather used testing , deployment. so code be: git push origin my_branch:master this takes "my_branch" branch , pushes master. may need add "-f" force push on last build.

ios - UIButton is unclickable after change in container height -

an uibutton contained inside uiscrollview. have setup in xib. use nslayoutconstraint change height of scrollview. after click button, scrollview changes height, uibutton becomes unclickable. here code: - (ibaction)tagpressed:(uibutton *)sender { if (self.height.constant == 200) { self.height.constant = 88; }else self.height.constant = 200; [self.view setneedsupdateconstraints]; [uiview animatewithduration:0.5f animations:^{ [self.view layoutifneeded]; }]; drect(_scrollview.frame) drect(self.view.frame) drect(sender.frame) nslog(sender.selected ? @"selected" : @"not selected"); } drect nslog frames. console out is: 2013-04-08 17:04:19.264 touchselectapp[93618:c07] cgrect ( 20.000000, -112.000000, 62.000000, 200.000000) 2013-04-08 17:04:19.266 touchselectapp[93618:c07] cgrect ( 0.000000, 300.000000, 320.000000, 88.000000) 2013-04-08 17:04:19.266 touchselectapp[93618:c07] cgrect ( 7.000000, 78

assembly - Asm ascii to binary conversion -

im trying convert ascii input binary code in variable. program working while number of inputed char even. don't know why when odd i've got wrong result. if number of input odd i'm trying convert 8 bit binary if got 1 00000001 , put first take 2 ascii chars low , hight 4 bits. can ? sysexit = 1 sysread = 3 syswrite = 4 stdout = 1 stdin = 0 exit_success = 0 size = 500 .align 32 .bss .lcomm bufor, size .lcomm bufor2, size .text .global _start ; _start: mov $sysread, %eax mov $stdin, %ebx mov $bufor, %ecx mov $size, %edx int $0x80 sub $1, %eax #od liczby znaków odejmujemy znak entera mov %eax, %edi #przeniesienie liczby wczytanych znaków z eax mov $0,%dx # reszta z dzielenia mov $2,%cx #dzielnik div %cx # ax:=dx:ax / cx mov $0, %esi mov $0, %ecx mov $0, %ebp petla: mov bufor(,%ecx,1),%al inc %esi cmp $'a',%al jge male cmp $'a',%al jge duze cmp $'0',%al jge liczby next: cmp $1, %d

c++ - VS2010: fatal error LNK1120: 1 unresolved externals . Working with templates -

have simple assignment classes , templates class, have searched on here , no solutions seem fix issue. when try compile, comes up: 1>msvcrtd.lib(crtexe.obj) : error lnk2019: unresolved external symbol _main referenced in function ___tmaincrtstartup 1>c:\users\leanne\documents\visual studio 2010\projects\partc\debug\partc.exe : fatal error lnk1120: 1 unresolved externals have console project using empty project. can me find issue? here code: #include <iostream> using namespace std; template<typename itemtype> class vec3 { itemtype x, y ,z; public: vec3<itemtype>(){x=0;y=0;z=0;} vec3<itemtype>(const vec3<itemtype>& other); vec3<itemtype> operator+(vec3<itemtype>); vec3<itemtype> operator-(vec3<itemtype>); bool operator==(vec3<itemtype> other); vec3<itemtype> operator=(vec3<itemtype>); ~vec3<itemtype>(){;} }; template<typename itemtype> vec3<itemtype&

C# not running derived class function -

i have problem game i'm making. have lot of fields, basic type , other types. logically made derivatives of basic field add functionality needed. however, seems when call function present in base class, function ran base class , not derivative. here cut-down code can see mean. public class field { public field(field exitn, field exite, field exits, field exitw, bool barricadeallowed, int returnto, int xpos, int ypos) { //actual logic in constructor, unrelated below function } public void function() { if (this startfield) { debug.writeline("startfield running base function!"); } //actual logic here. } } . class startfield : field { public startfield(field exitn, field exite, field exits, field exitw, string color, int xpos, int ypos) : base(exitn, exite, exits, exitw, false, 0, xpos, ypos) { //again, constructor emptied due unrelatedness. } public

java - check if word belongs to locale -

i have file of words (phrases) belong specific language (let's spanish). in same file there words belong language (let's english). there way find few words using java? locale class of help? these 2 languages example. russian main language , in english ones want identify abnormally. the locale class isn't going of in case. best bet put spanish , english dictionaries in hashsets , check set membership iterate through file, or if dictionaries large fit in memory put them in database instead.

c# - Asp.Net Mvc Method OutputCache attribute set based on HttpContext.Current.IsDebuggingEnabled -

i trying set method attribute based on debug flag. expected have compile time issues this. perhaps can think of workaround works similar if worked. [outputcache( nostore = httpcontext.current.isdebuggingenabled, duration=(httpcontext.current.isdebuggingenabled)?0:15 )]///todo: remove attribute after testing! public actionresult rendersomething(int somethingid) { ... } can not use preprocessed conditionals? #if debug [outputcache( nostore = httpcontext.current.isdebuggingenabled, duration = 0)] #else [outputcache( nostore = httpcontext.current.isdebuggingenabled, duration = 15)] #endif ..? edit: have confirmed work test of using serializable attribute. should work you're trying achieve (not sure if it's best solution though.. works!).

eclipse - EGit clone dialog: Clean old URIs from content assist suggestions -

how can rid of old uris in "clone git repository" dialog in eclipse juno? if hold ctrl , press space bar list of uris you've ever used. want delete 1 on of them. if possible editing file somewhere, i'd know name , location of file. i've tried uninstalling reinstalling egit still there. information stored? the uris available via content assist in uri field stored in following file in workspace folder: .metadata/.plugins/org.eclipse.egit.ui/dialog_settings.xml you can edit hand when eclipse not running, , picked next time eclipse started.

passing data to the controller through ajax from view -

i have page http://www.mysite.com/discusssion/name_of_topic/page:1 at click of button in view, want redirect param (i.e url) controller , fetch data. url is: http://www.mysite.com/discusssion/name_of_topic/page:2 i writing ajax function call controller , fetch data not working me. here ajax function $("#loadbut").click(function() { $.ajax({ type: "post", url : "/discussion/"+$topic+"/page:2", data: data, datatype: "json", success: function (response) { if (response.success) { pr(data); exit(); } else { console.log(response.data, response.code); } } }); });' how can make work, ideas?? few things try assuming 1:1 code have, add install or use firebug view request made. check address it's right. make sure controller action works intended. return valid json-response.

php - Find a value & key in a multidimensional array -

this question has answer here: find value , key in multidimensional array 8 answers i have 2 arrays, need find if 1 of values in array 1 matches 1 of values in array two, multi-dimensional array. need check value array 1 in specific key in array two, "principal" key "authority" key may hold value. here array one: array ( [0] => 17 [1] => 6 [2] => 3 [3] => 2 ) and array 2 [actually truncated readability]: array ( [modaccessresourcegroup] => array ( [3] => array ( [0] => array ( [principal] => 0 [authority] => 9999 [policy] => array ( [load] => 1

c++ - Why doesn't my code work? -

Image
i'm implementing simple dfs traversal directed graph: #include <iostream> #include <vector> #include <climits> #include <utility> #include <deque> #include <queue> #include <algorithm> #include <iomanip> #include <list> using namespace std; enum class color_type { black, white, gray }; struct vertex { char label; color_type color; int start; int finish; vertex *parent; vector<vertex> adjacents; vertex(char label) :label(label), start(0), finish(0), color(color_type::white) { } void add_neighbor(const vertex &v) { adjacents.push_back(v); } }; class digraph { private: vector<vertex> vertices; int count; public: digraph() :count(0) { vertex a('a'); vertex b('b'); vertex c('c'); add_edge(a, b); add_edge(b, c); add_edge(c, a); vertices

javascript - Concept - Firing events on a resource load -

is there library this? is there pure code way it? i have code want run when library has loaded. jquery.js -> jqueryui.js. once jqueryui loaded have app specific code want execute. want use event system know when happens. is common practice? if load libraries "vanilla" way: <script src="path/to/jquery.js"></script> <script src="path/to/jqueryui.js"></script> then script tags placed after executed after preceding scripts have been loaded , parsed. you can instead fancier async loaders such requirejs or headjs , provide "onload"-like callbacks in can execute own code.

sql server 2008 - SSIS: Redirecting both Errors and Truncation issues to file, but conversion errors cause package failure -

i have 2 columns in source flat file, integer column , varchar. in data flow task, selected source object,and in configure errors section, set both "error" "truncation" columns "redirect" output file intended rejected records. if rig data 1 row has varchar value longer length of column, row redirected expected rejected flat file. however, when string value encountered in int column (productid), package dies on following error. [oledest [200]] error: ssis error code dts_e_oledberror. ole db error has occurred. error code: 0x80040e21. ole db record available. source: "microsoft sql server native client 10.0" hresult: 0x80040e21 description: "multiple-step ole db operation generated errors. check each ole db status value, if available. no work done.". [oledest [200]] error: there error input column "productid" (1084) on input "ole db destination input" (213). column status returne

java - Receiving NullPointerException when trying to retrieve textview in custom listener class -

i have 2 spinners on 1 page, each retrieve stations same line/train. i wanted "update" information in view when user selects value spinners. i've created custom spinner listener both of them, cannot seem access textview update inside embedded class. my code activity being described included below. there lot of it, areas of interest can found in 2 embedded classes @ end: spinneractivitydestination , spinneractivityorigin. the exact line throwing error is: estimatedtime = (textview) findviewbyid(r.id.timeshow); i'm trying access text value in view , display numerical value spinner. throws nullpointerexception , i'm assuming because inside class view not inflated. don't know how around it? any help/advice appreciated. public class choosestations extends activity { public int globalspinnerorigin; public int globalspinnerdestination; public double globalstationtime; private metrosleepdb db; private cursor stations; simplecursoradapter adapter

Redirecting page links after .htaccess SEO upgrade? -

i didn't want bloat 1 post here ton of .htaccess questions, i'm breaking them individually. 1 has using redirectmatch create rules existing, indexed pages part of existing website. specifically, test site has been year , using .htaccess re-write clean urls better seo. when had container page content called based on query string in link, so: http://www.website.com/departments.php?dep=contact_us i'm working on making url appear smoother like: http://www.website.com/contact-us/ the tutorial read suggested changing links new, snazzier seo-friendly style lead lots of 404 errors , broken page links until site has been indexed again , records brought date. thus, question: legitimate concern or new links picked in 24-48 hours? i ask because have several websites many layers of file structure , i'm thinking i'd need ton of rules in .htaccess file fix broken links may creating. if i'm creating confusion here, please let me know , i'll clarify thi

javascript - what are the consequences of using === in pre javascript1.3? -

the strict equal operator appeared in javascript1.3 , ecmascript 3rd edition. the oldest browser have ie6, implements 1.3. don't have practical way test outcome of === on browsers. if use === happen javascript1.2 browsers? and still exist today point should care? edit 1: people suggesting should test <script language="javascript1.2"> . well, not work that. i executed on modern firefox , chrome: <script language="javascript1.2"> alert( "1" === 1 ); </script> and returned false . absolutely not happend on javascript1.2 (it either syntax error or true ). you really, shouldn't care them. we're talking version of netscape 4, released on 1997 , no 1 it's using anymore. , honestly, if have write code compatible such browsers, have bigger issues strict equal operator. so, unless have real use case – , hope you haven't – wouldn't care. threat such browsers "no javascript enabled&qu

html - Turn Nokogiri XML object to string without using .text -

i have object child of < td > tag. class ctext , relevant data within < b > tag.tag i have selected node using: td.css(".ctext b") and seems work. result of like: < b >flying< br >< br >at beginning of each combat, choose first strike, vigilance, or lifelink. creatures control gain ability until end of turn.< /b > if use: td.css(".ctext b").text to convert string, get: flyingat beginning of each combat, choose first strike, vigilance, or lifelink. creatures control gain ability until end of turn. what need able convert td.css(".ctext b") , think nokogiri xml node string without stripping html tags. need keep < br > s. you want .inner_html instead of .text .

database - CodeIgniter: Fatal error: Call to a member function select() on a non-object -

i getting above error while i'm trying trying access function library shown... <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class my_crud { public function select_from($select, $from) { // dafaults $output = ""; // querying $this->db->select($select); $this->db->from($from); $query = $this->db->get(); // if no rows returned if ($uqery->num_rows == 0) { return $output = "no results found"; } // if row(s) retunred return $output = $query->result_array(); } } while database library set autoload. if creating in library should instance of ci add on __construct class my_crud { var $ci; public function __construct() { $this->ci =& get_instance(); } } then on method within class change this->db $this->ci->db , question why making crud on library when can make inside model?

apache - ProducerTemplate and Direct:start in camel -

my camel route : from("direct:start") .to("http://myhost/mypath"); i used : producertemplate template; template.sendbody("direct:start", "this test message"); to send exchange. getting following exception: no consumers available on endpoint: endpoint[direct://start]. how can receive same exchange in direct:start endpoint? the reason error because have not configured route starts direct:start . if have configured route , did not mention in original query, next step try first start camel context, before calling sendbody method. camelcontext.start(); template.sendbody("direct:start", "this test message"); hope resolves issue.

python logging module is not writing anything to file -

i'm trying write server logs exceptions both console , file. pulled code off cookbook. here is: logger = logging.getlogger('server_logger') logger.setlevel(logging.debug) # create file handler logs debug messages fh = logging.filehandler('server.log') fh.setlevel(logging.debug) # create console handler higher log level ch = logging.streamhandler() ch.setlevel(logging.error) # create formatter , add handlers formatter = logging.formatter('%(asctime)s - %(levelname)s - %(message)s', datefmt='%y-%m-%d %h:%m:%s') ch.setformatter(formatter) fh.setformatter(formatter) # add handlers logger logger.addhandler(ch) logger.addhandler(fh) this code logs fine console, nothing logged file. file created, nothing ever written it. i've tried closing handler, doesn't anything. neither flushing it. searched internet, apparently i'm 1 problem. have idea problem is? answers. try calling logger.error('this should go both console , file&#

Android Layout help needed -

i having difficulty making layout work... what want have 2 spinners , button below , once button clicked, display results based on values selected in spinners. ----------- | spinner 1 | ----------- ----------- | spinner 2 | ----------- ----------- | button | ----------- result 1 result 2 result 3 result 4 result 5 i have tried put results in listview, problem face once button clicked, can see repetition of spinner1, spinner2 , button multiple times. the xml layout follows: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <spinner android:id="@+id/spinner1" android:layout_width="match_parent" android:layout_height="wrap_content" android:entries="@array/country_arrays" android:prompt="@string/country_prompt&

Uncomparable type error when []string field used (Go lang) -

i have particular go lang struct object i'm interacting , expect equal itself. i'm passing function function returns accepting interface{} inputs/outputs type animal struct { name string food interface{} } type yummyfood { calories int } func echo_back(input interface{}) interface{} { return input } func main() { var tiger_food = food{calories: 1000} var tiger = animal{name: "larry", food: tiger_food} output_tiger := echo_back(tiger) fmt.printf("%t, %+v\n", tiger, tiger) fmt.printf("%t, %+v\n", output_tiger, output_tiger) fmt.println(tiger == output_tiger) fmt.println(tiger == output_tiger.(animal)) } running this, see tiger , output_tiger appear same , evaluate equal. great. that's expect. now, try using definition yummyfood type yummyfood { calories int ingredients []string } all of sudden, output echo_back not evaluate same input, type assertion. 'panic: runtime error:

javascript - onRemove()-event? -

i've got following situation: i'm storing dates in text-inputs , above those, min- , maxdates displayed. possible add , remove additional inputs. dates stored in array of objects [{id: 1, val: '15.3.13'}, {id: 2, val: '1.4.13'}...] onchange-event these inputs checks array , calculates minimum , maximum dates display on top of page. if add input, make minimum/maximum date , remove it, onchange-event isn't called. is there kind of onremove-event jquery or have work way around , call manually? (the scenario above highly simplified version of real problem, idea of i'm doing. please don't "why don't call onchange-method in onclick-method of button removes inputs?", because it's not easy ;-)) are looking snippet? jquery - trigger event when element removed dom if not, please provide code.

java - Find the closest object (before and after) to the target object -

i want implement 2 methods given below. someobject has field createddate of type date private someobject getnearestobjectbeforetargetobjectscreateddate(list<someobject> someobjectlist, someobject targetobject){ } private someobject getnearestobjectaftertargetobjectscreateddate(list<someobject> someobjectlist, someobject targetobject){ } suppose have 5 objects p1, p2, p3, p4, p5 in ascending order of created dates. , target object p3 , 1st method should return p2 , second should return p4 currently have wirtten this private someobject getnearestportfolio(list<someobject> someobjectlist, someobject targetobject){ someobject returnobject = targetobject; for(someobject someobject : someobjectlist) { // if current iteration's date "before" target date if(someobject.getcreateddate().compareto(targetobject.getcreateddate()) < 0) { if (someobject.getcreateddate().compareto(returnobject.getcreatedd

Java recursion code -

public class temp { public static void main(string[] args) { system.out.println(recursion(1, 100)); system.out.println(recursion(4, 5)); system.out.println(recursion(99, 100)); system.out.println(recursion(100, 100)); } public static int recursion(int m, int n) { int number = 0; if (m == 1) { number = ((2 * n) - 1); } else { number = 2 * recursion(m - 1, n - 1); } return number; } } when run code, last 2 tests return 0's , know supposed big numbers, why? how can figure out value of last two?? you're running arithmetic overflow. int can store values between -2^31 , 2^31-1. deal numbers big, need more suitable data type, such biginteger .

C++ Functions with lambdas as arguments -

i have overload function, following signatures: void foo(const std::function<void(int )> &func); void foo(const std::function<void(int, int)> &func); and when want use foo() lambdas, i'll have this: foo((std::function<void(int )>) [] (int ) { /* */ }); foo((std::function<void(int, int)>) [] (int i, int j) { /* */ }); both of not user-friendly. it'd lot easier use function without having add casting "(std::function<...>)" before lambdas - this: foo([] (int ) { /* */ }); // executes 1st foo() foo([] (int i, int j) { /* */ }); // executes 2nd foo() so, need overload, accept lambda argument, , automatically casts lambda 1 of above signatures. how can done? or, possible in first place? template <typename function> void foo(function function) { // insert code here: should // - check signature of 'function'; , // - call 'foo()' corresponding signature }

javascript - How to destroy a progressbar on dialog closing? -

i have these 2 functions 1 of them create dialog , other destroy progressbar, after create dialog might need create progress bar inside , start it, when close dialog, progress bar keeps running in ground. need destroy or stop progress bar working. wrote createdialog function beforeclose event destroy progress bar doesn't work, , dialog not closing, close button none responsive. function createdialog(trgt,h,w) { $( trgt ).dialog({ height:h, width:w, autoopen: false, show: { effect: "blind", duration: 200 }, hide: { effect: "blind", duration: 100 }, beforeclose: function( event, ui ) { destroyprogresspar(trgt); } }); } destroyprogresspar(dialg) { if(dialg=="#myfilesdialog") { $("#progressbar").progressbar("destroy"); } else if(dialg=="#ibrowser") { $

How to properly configure the Amazon EC2 AMI for 'hadoop-ec2'? -

i trying launch instance on amazon ec2. have researched problem extensively, have not found helpful information. when run command hadoop-ec2 launch-cluster mycluster 2 , receive following error message: starting master ami. required parameter 'ami' missing (-h usage) i have entered aws key, aws secret key, aws key pairs, etc. using hadoop-1.0.4. using default s3 bucket ( hadoop-images ), have tried many other amis , same error message. has experience problem before? the basic issue search images launch-hadoop-master script performs not returning results. cause of due different amis available in different regions (but due changes you've made s3_bucket , hadoop_version in hadoop-ec2-env.sh ). from launch-hadoop-master script: # finding hadoop image ami_image=`ec2-describe-images -a | grep $s3_bucket | grep $hadoop_version | grep $arch | grep

android - Updating a single column is creating sqlite syntax error -

i'm not sure i'm doing wrong, i'm trying update single integer value in column of table 1 0. when creating database, set values of column 0 using: for (int = 0; < setups.length; i++) { contentvalues values = new contentvalues(); values.put(jokedbcontract.tbljoke.column_name_setup, setups[i]); values.put(jokedbcontract.tbljoke.column_name_punchline, punchlines[i]); values.put(jokedbcontract.tbljoke.column_name_used, 0); db.insert(jokedbcontract.tbljoke.table_name, null, values); } then, in actual activity, i'm doing: private void findnewjoke() { jokedb jokedb = jokedb.getinstance(this); sqlitedatabase thedb = jokedb.getdb(); string selection = jokedbcontract.tbljoke.column_name_used + "=" + 0; // query database joke has not been used, update fields // thejoke , thepunchline appropriately string[] columns = {jokedbcontract.tbljoke._id, jokedbcontract.tbljo

multithreading - T SQL multi thread for launching xp_cmdshell jobs -

i have job takes database backup files , compresses them .7z files using 7 zips command line utility , @ moment takes 8 hours run through .bak files because doing 1 @ time. running on has 16 cores , 7z process seems using 1 core able run multiply instances of xp_cmdshell command have compress several files @ time. there way execute list of commands in t sql on mssql server 2005? i have post script below. this link program using zip files. [http://downloads.sourceforge.net/sevenzip/7za920.zip][1] -- yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy -- ii zip files in folder ii -- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -- zip , delete files backup folder -- list files in directory - t-sql parse string date , filename declare @pathname varchar(256) , @cmd varchar(512) create table #commandshell ( line varchar(512)) -- use xp_cmdshell option has enabled. can use script bellow enable i