Posts

Showing posts from July, 2010

pharo - Smalltalk ReferenceStream has problems with new instance variables? -

in pharo smalltalk i'm using referencestream serialise list of objects -- here's class definition of objects i'm serialising: object subclass: #task instancevariablenames: 'title notes list project datenextaction datecreated datecompleted importance selected' classvariablenames: 'database' pooldictionaries: '' category: 'todo' i'm using smfiledatabase method described here: http://book.seaside.st/book/advanced/persistency/image-based-persistency this has been working well, , it's been nice not have use database prototype app. howevere, here's problem: when add new instance variable person task load referencestream breaks: object subclass: #task instancevariablenames: 'title notes list project person datenextaction datecreated datecompleted importance selected' classvariablenames: 'database' pooldictionaries: '' category: 'todo' it seems not spot new variable, , load values wrong s

java - Is there a difference between calling a method from within a class' method code or on an instance of the class? -

i have piece of code here , i'm not sure couple of commands do: //this bit body of main method //lots of stuff omitted project frame = new project(); frame.creategui(); private void creategui() { setdefaultcloseoperation(exit_on_close); panel = new jpanel(); } so when frame.creategui(); called, happens 2 commands in creategui(); ? they setdefaultcloseoperation(exit_on_close); panel = new jpanel(); or frame.setdefaultcloseoperation(exit_on_close); frame.panel = new jpanel(); or else entirely? i'm quite new @ java, started year 12 computer science year, bit ahead of class. thanks time! every non static method in java has hidden parameter called this . it's value object in front of dot in invocation. inside body of methods, invocations of other methods implicitly have this. in front of them. use of variables, if cannot resolved locally. if this reference explicit, method this: private void creategui(project this) { this.setdefau

redirect - PHP in a 404 script to 301? -

i want 301 large amount of old urls. can via php in 404 script, or mess search engine results (them thinking pages not found)? my current .htaccess: errordocument 404 /404/ my 404/index.php script plan: <? switch (rtrim($_server["request_uri"],"/")) { case "/blah/foo" : $redirect="/somewhere_else/"; break; case "/over_here" : $redirect="/over_there/"; break; case "/etc/etc/etc" : $redirect="/etc/and_so_on/"; break; } if($redirect) { header ("http/1.1 301 moved permanently"); header ("location: ".$redirect); exit(); } ?> <html> <head> <title>404: page not found.</title> </head> <body> <h1>404: page not found.</h1> </body> </html> so, basically, redirecting isn't problem, don't want search engine t

enable the flag enable-offline-auto-reload via extension -

hi enable flag enable-offline-auto-reload via extension. can't find api though. when set via (chrome://flags) following json added local state file: "browser":{"enabled_labs_experiments":["enable-offline-auto-reload@1"]} when attempt use in manifest, browser tag not available , error "unrecognized manifest key". know api this? can guide me in direction please? you cannot control command line flags extensions. there no api that.

excel vba - How to copy sheets to another *specific* workbook using vba? -

so know answer question how copy sheets workbook using vba? , here code used: wb.worksheets(1).copy before:=activewb.worksheets("sheet1") so workbook called "wb", copy worksheet within "wb" new workbook called"activewb". before function place sheet in front of "sheet1". however, want place sheet "wb" "sheet1", not before or after it. tried many many methods, couldn't work. :( have tried? wb.worksheets(1).usedrange.copy activewb.worksheets("sheet1").range("a1")

mobile - How to show camera in 2 views for android -

i new android. make prototype showing camera in 2 views. checked url( android camera preview on 2 views ( multi-lenses camera preview ) ), can't now. please give me full course. thank you! basically need draw camera opengl texture , show texture. mikle wrote 2 versions of here, feel free modify code , add pull requests: https://github.com/sveder/cardboardpassthrough

Google SpreadSheet custom range -

i have copy data spreadhsheet column a3:infinity spreadhsheet b column a253:infinity . how can specify infinity or endofcolumn in range, while there empty rows between a3,infinity , a253, infinity ? in spreadsheet b, cell a253, write: = importrange(<<key_of_spreadsheet_a>>; "<sheet_name>!a3:a") where "key_of_spreadsheet_a" key of spreadsheet (you can find in url), , "sheet name" name of sheet in spreadsheet want import.

iphone - How to parse different files depending on the current date in Xcode? -

i have following problem: building app tv guide. parsing listing channels xml file on internet. code: -(void)loadlisting { nsurl *urllisting = [nsurl urlwithstring:@"http://pik.bg/tv/bnt1/29.03.2013.xml"]; nsdata *webdatalisting = [nsdata datawithcontentsofurl:urllisting]; nsstring *xpathquerylisting = @"//elem/title"; tfhpple *parserlisting = [tfhpple hpplewithxmldata:webdatalisting]; nsarray *arraylisting = [parserlisting searchwithxpathquery:xpathquerylisting]; nsmutablearray *newarraylisting = [[nsmutablearray alloc] initwithcapacity:0]; (tfhppleelement *element in arraylisting) { listing *shows = [[listing alloc] init]; [newarraylisting addobject:shows]; shows.broadcast = [[element firstchild] content]; } _shows = newarraylisting; [self.tableview reloaddata]; } look @ first row - file's name /.../01.04.2013.xml tomorrow's file /.../02.04.2013.xml , etc. how make parse d

How to transfer result gotten from a function to an array of char in C? -

the motive of program test longest word in string , return whether or not longest word matches expected result. i wrote code brain got stuck in part i'm store result of function longest word on line char array result. how do in c? my effort: #include <stdio.h> #include <ctype.h> #include <string.h> static int testsexecuted = 0; static int testsfailed = 0; char testlongestword(char line[], char expected[]); void longestword(char line[]); int main(int args, char *argv[]){ printf("%s\n", "testing typical cases, including punctuation\n"); testlongestword("the quick brown foxes jumped on lazy dogs", "jumped"); testlongestword("hello world said", "hello"); testlongestword("hello\tworld\tshe\tsaid", "hello"); testlongestword("hello, world said", "hello"); testlongestword("hello world! said???", "hello"); testlong

jquery - Bootstrap select - using data-container="body" breaks functionality -

i having problem bootstrap select going under div , , find solution solved in following question: bootstrap-select opens option under div the solution suggests adding data-container="body" bootstrap select , , solved problem caused side effects on bootstrap functionality: when select opened, clicking outside scope won't close it. when select opened, clicking on select (the original box) won't close it. when trying functionality described on 1 , 2, select gets stuck , clicking on valid option won't close select now. without using data-container="body" on select none of happens, have original problem. need if has idea happening. i've altered line of code has solved problem of select menus not closing once opened. bootstrap-select.js line 1002. original code .toggleclass('open', !$this.hasclass('open')) my altered code .toggleclass('open') someone else may able weigh in on , explain wh

datepicker - datetime is not function with jquery 1.12 -

i have code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#datetimepicker1').datepicker(); }); </script> however, keeps saying that: typeerror: $(...).datepicker not function can me find error ? date picker jquery ui <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> which have not included https://jqueryui.com/datepicker/

Excel VBA - How to copy and paste groups of data following blank cells? -

i have data in b6 , m6 correspond directly each other. data goes b6:b12 , there 2 blank cells in b13:b14. data goes on b15:b23 , there 2 blank cells , pattern repeats down page...(the same goes column m). i researched finding blank cells , able use code grab first set of data b6:b12 , m6:m12 , paste on new worksheet in location wanted. here code: sub copyandpaste() nextfree = range("b6:b" & rows.count).cells.specialcells(xlcelltypeblanks).row range("b" & nextfree).select nextfree2 = range("m6:m" & rows.count).cells.specialcells(xlcelltypeblanks).row range("m" & nextfree2).select sheets("sheet 1").range("b6:b" & nextfree).copy destination:=sheets("sheet 2").range("b13") sheets("sheet 1").range("m6:m" & nextfree2).copy destination:=sheets("sheet 2").range("j13") end sub this works grab first group before blank 2 blank cells cannot

How to download multiple files using php from csv as the references? -

kind of new php starting head around little. what want do... i have csv contains references files can download. i found page: how download xml file through in php? this enabled me download xml file if write url , directory want save no problems. how modify php xml files in csv? i assume like: foreach , variable functions etc have no idea how. also in csv contains file name not full url, first part of url stay same. , same goes download directory. want files downloaded same directory pick , file name same 1 im downloading. also how change php if example want download images, or other file type? assume easy? thanks john i suppose csv file following: "filename";"url" "file 1"; "url f1" "file 2"; "url f2" "file 3"; "url f3" "file 4"; "url f4" "file 5"; "url f5" "file 6"; "url f6"

javascript - Data security highcharts -

just starting use highcharts. if include data in array within javascript data available download when view source. same when data called, say, csv file. there way of protecting data against copying/download? no, since highcharts client-side javascript library, data available potentially available end user. there no way "secure" once data reaches user's browser, although can use https, server-side authentication, etc @ least guarantee in principle intended user receives data. if need visualize data while keeping actual raw data secure, obvious solution render data on server , (in end) serve image or other static content user. lose nice, interactive charts. you might able use flash or silverlight retrieve data, make part of process harder reverse engineer. not securing anything, making bit harder determined user. on other hand, user can see data anyway in final chart. if want download data painstakingly identify each data point , create own csv file, righ

bulkinsert - sql server bulk insert and temporary tables -

ive been learning mysql decided have attempt @ sql server. have pasted code mysql sql server , figuring out parts of code need adapted work in sql server. trying create temporary table , bulk insert text file temporary table. statement works fine in mysql show: create temporary table test123 ( reason_t varchar(30) default null, month_t varchar(30) default null, year_t varchar(30) default null, week_type_t varchar(30) default null, accident_time_t varchar(30) default null, alcohol_level_t varchar(30) default null, age_t varchar(30) default null, gender_t varchar(30) default null); load data local infile 'c:\\users\\jon\\onedrive\\desktop\\roadsafety_test123.txt' table test123 fields terminated ',' lines starting '' terminated '\r\n' ignore 1 lines; and in sql server have far come this: declare @test123 table ( reason_t varchar(30) default null, month_t varchar(30)

github - Set up upstream project in Travis CI -

i'm working on project, have 2 git repos: repo1 - devrepo, rep02- testrepo my scenario is: whenever commit or pr happens on repo1: step1: repo2 should triggered step2: once step1 success, repo1 should triggered. basically repo1 should build if repo2 run , turns success. could please me how can set up, appreciated: which .travis.yml file should configure meet scenario. exact configuration steps can write in .travis.yml file answer: got working: trigger dependent build: repo2 using travis api: create trigger_build.sh file , add code: ` body='{ "request": { "branch":"master" }}' curl -s -x post \ -h "content-type: application/json" \ -h "accept: application/json" \ -h "travis-api-version: 3" \ -h "authorization: token ..git_hub_login_token.." \ -d "$body" \ https://api.travis-ci.org/repo/xxxx%2fyyyy/requests #the 15s sleep allow travis trigger dep

Avoid hex-encoding in a text-file for a searching program in python -

i have written python program analyze server log(a text file) , find non matching strings user input. anyway hex-encoded strings not considered program. ex : in following case program says there no non-matching values user input although 'www.peoplesmonton.com' available. please me avoid this? for line in lines: match = re.search('\\b' + userinput + '\\b',line) sample text file: https://www.mysite.com/myworks/accaply/inquiry.asp http://www.peoplesmonton.com/amb/cgi-bin/bank/bank/ambt%20bank%20of%20frnak%20plc_asp.htm http://www.peoplesmonton.com/comblk/cgi-bin/bank/bank/ambt%20bank%20of%20ambt%20plc_asp.htm the information url encoded , use urllib2.unquote decode that. >>> input = '''\ ... https://www.mysite.com/myworks/accaply/inquiry.asp ... http://www.peoplesmonton.com/amb/cgi-bin/bank/bank/ambt%20bank%20of%20frnak%20plc_asp.htm ... http://www.peoplesmonton.com/comblk/cgi-bin/bank/bank/ambt%20bank%20of%20am

c# - If Condition inside switch case -

this question has answer here: control cannot fall through 1 case label 5 answers i trying convert if statement switch cases (for readability) 1) i've read switch statements aweful in general - true? https://stackoverflow.com/questions/6097513/switch-statement-inside-a-switch-statement-c 2) statement goes this: switch (show) { case display.expense: if (expected.expense != true) break; case display.nonexpense: if (expected.expense == true) break; case display.all: //code break; } error is: control cannot fall through 1 case label ('case 1:') another this original if statement: if ((show == display.a

javascript - assertEqual error on nodeJs -

i started nodejs development. testing mongodb driver repeatedly getting assertequals has no method. code sourcerepo var client = new db('test', new server("127.0.0.1", 27017, {})), test = function (err, collection) { collection.insert({a:2}, function(err, docs) { collection.count(function(err, count) { test.assertequals(1, count); }); // locate entries using find collection.find().toarray(function(err, results) { test.assertequals(1, results.length); test.asserttrue(results[0].a === 2); // let's close db client.close(); }); }); }; client.open(function(err, p_client) { client.collection('test_insert', test); }); error has no method 'assertequals' how reolve it? you can use node's assert (where called equal rather equal*s*): var assert = require('assert'); // ... assert.equal(count, 1); // ... ho

GitHub Java Project help eclipse -

whenever pull git is successful, when try turn java project, doesn't work. can make pull java project, cant make master branch can commit project.i need know problem can start working on project, new git. i've tried restart eclipse , reinstall it!! help! i using eclipse mars , have egit.

How to make Extent report (in Jenkins) show screenshot when a test fails? -

i'm having issue extent report not showing screenshot when test fails , when accessing report remotely via jenkins url. if report viewed on same machine jenkins installed, screenshot displayed. when saving image report, pass absolute path of image file. right way it? solved using following code (c#): extenttest test; test.addscreencapture("./screenshot.jpg");

javascript - Knockout push new array item using Ajax form -

my application mvc 5 c#, using following form update table: @using (ajax.beginform("addoha", "medication", new ajaxoptions() { updatetargetid = "result", onsuccess = "getresult", httpmethod = "post" })) { <input id="medname" name="medname" value="" class="input-sm form-control" style="width: 100px" placeholder="value"/> <input type="submit" value="save" class="btn btn-primary"/> } here knockout list: <tbody data-bind="foreach: ohalist"> <tr> <td> <input data-bind="value: name" class="input-sm form-control" style="width: 100px" placeholder="value" /> </td> </tr> </tbody> here viewmodel: var viewmodel = function() { var self = this; this.ohalist = ko.observablearray([])

sql - Update foreign key column from not null to null -

how can update foreign key column in table not null null without having recreate table? i tried use this: update tblproduct set consumerid not null please advise, thank did try this? alter table [table] alter column [column] integer null

node.js - Problems with multiple update in MongoDb -

i have mongo structure this: { "_id" : objectid("51596b7e469b9c3816000001"), "company" : { "_id" : "ade2fd0ec9b8b5e9152e0155", "title" : "lo3426546457" }, } { "_id" : objectid("51596cef469b9c3816000008"), "company" : { "_id" : "ade2fd0ec9b8b5e9152e0155", "title" : "lo3426546457" }, } { "_id" : objectid("51596cc3469b9c3816000007"), "company" : { "_id" : "ade2fd0ec9b8b5e9152e0155", "title" : "lo3426546457" } } and want change 'title' fields objects specific '_id'. this: collections.userscollection.update({ 'company._id': 'ade2fd0ec9b8b5e9152e0155' }, { $set: {

objective c - property's synthesized getter follows cocoa naming convention for returning 'owned' objects -

Image
i curious cocos2d have naming convention variable? i have this //.h nsmutablearray *newrowforcounter; and //.m @synthesize newrowforcounter; and @ @synthesize it's warning "property's synthesized getter follows cocoa naming convention returning 'owned' objects" if change name else work fine. i try out variable naming begin new- {ex newvariable...) it's still warn me that. thank my gamma may bad sorry that objective-c xcode naming-conventions share | improve question asked apr 1 '13 @ 12:02 koko hl apinyanont 62 1 9 1