Posts

Showing posts from September, 2010

php - How to loop forms in one page based on the number of entries -

php - How to loop forms in one page based on the number of entries - i doing offense management web application using php. the page when run it,it gives chance come in details case,then click on submit button brings form on same page. that form inquire come in number of accused involved,if lets instance have 2 accused,it bring form on same page allow come in personal info bout accused number 1 ...then click on submit button bring form asks come in number of crimes accused number 1 has committed...if lets 1 time again committed 3 crimes brings select form allows select offense , submit 3 times. after 3rd entry go 1 time again , give form come in personal details accused number two....same process accused 1 when done takes initial point ready come in new case i pray clear....please help this before code ...ready run <?php session_start(); if(isset($_session["start"])) { switch($_session["now"]) { ...

php - Blocking Windows Phone WebBrowser control from viewing my site? -

php - Blocking Windows Phone WebBrowser control from viewing my site? - i have found out selling app straight using webbrowser/webview access site wrote. not want person making money off of app, , website getting bad reputation because people think trying charge site. are there windows phone webview specific request headers can block? running php , planning on blocking access via request headers. thank you! best contact microsoft straight , study app. php windows-phone-8

tsql - Why does CHECKSUM_AGG() return same values for totally different input values? -

tsql - Why does CHECKSUM_AGG() return same values for totally different input values? - i don't how checksum_agg() works, although understood somehow built using xors. explains why returns 0 when pass equal integers. why same aggregated checksum in next sql, input values unique? declare @test1 table (chksum int) insert @test1 values (2147473855), (2147473343) select checksum_agg(chksum) @test1 -- declare @test2 table (chksum int) insert @test2 values (2147474831), (2147472271) select checksum_agg(chksum) @test2 an explanation much appreciated. thanks! there known issues sql server checksum , checksum_agg implementations: checksum weakness explained use hashbytes instead: using hashbytes compare columns from microsoft: if 1 of values in look list changes, checksum of list changes. however, there little chance checksum not change. reason, not recommend using checksum observe whether values have changed, unless application can tolerate missing change. consi...

operators - == and .equals() in java -

operators - == and .equals() in java - this question has reply here: how compare strings in java? 23 answers java string.equals versus == [duplicate] 20 answers on reading many articles figure out == compares if 2 operands referring same object. how work primitive info types. does compare values of operand? does == work differently primitive info types , classes ? kindly clarify the “==” operator checking see if string objects (obj1 , obj2) refer exact same memory location. in other words, if both obj1 , obj2 different names same object “==” operator homecoming true when comparing 2 objects. the equals() method behaves same “==” operator – meaning checks see if both objects reference same place in memory. but, equals method meant compare contents of 2 objects,...

java - GAE ClassCastException Long cannot be cast to double -

java - GAE ClassCastException Long cannot be cast to double - getting exception when trying fetch info datastore entity. here code: persistencemanager pmf = pmf.get().getpersistencemanager(); seek { query query = pmf.newquery(docheader.class); @suppresswarnings("unchecked") list<docheader> docheaders = (list<docheader>) query.execute(); anyone can help in issue. here object @persistencecapable(identitytype = identitytype.application) public class docheader { @primarykey @persistent(valuestrategy = idgeneratorstrategy.sequence) private long docheaderid; @persistent private double previouspayment; @persistent private double currentbalance; @persistent private double totalaccountbalance; @persistent private string accountrepresentative; @persistent private double minpayment; } the exception classcastexception long cannot cast double means have @ to the lowest de...

UNWANTED PAGE BREAK WHEN THE REPORT_COUNT IS ONLY 1 JASPER REPORT -

UNWANTED PAGE BREAK WHEN THE REPORT_COUNT IS ONLY 1 JASPER REPORT - hi have subreport page break, how limit printing of page break when report_count > 1? <break> <reportelement x="0" y="8" width="100" height="1"> <printwhenexpression><![cdata[$v{report_count}>1]]></printwhenexpression> </reportelement> </break> jasper-reports

java - PDF page to Image, Apportable BridgeKit -

java - PDF page to Image, Apportable BridgeKit - i modified code post: need help convert pdf page bitmap in android java to seek , page pdf, convert byte[] , pass xcode project displayed. i'm doing using apportables bridgekit framework , compiles without errors. the problem app crashes 1 time loaded on device. imageextractor.java package com.pdflib; import android.graphics.bitmap; import android.os.environment; import android.util.log; import com.sun.pdfview.pdffile; import com.sun.pdfview.pdfpage; import net.sf.andpdf.nio.bytebuffer; import java.io.bytearrayoutputstream; import java.io.file; import java.io.randomaccessfile; public class imageextractor { //globals: private int viewsize = 0; //load images: private byte[] pdfloadimages() { seek { file file = new file(environment.getexternalstoragedirectory().getpath() + "/backs.pdf"); randomaccessfile f = new randomaccessfile(file, "r...

chef - Having an error regarding a node basedir while installing a ELKstack cookbook -

chef - Having an error regarding a node basedir while installing a ELKstack cookbook - my chef-client run fails finish running recipe on test node. gives error upon failure; here final output on ubuntu workstation: recipe compile error in /var/chef/cache/cookbooks/elkstack/recipes/single.rb undefined method `[]' nil:nilclass /var/chef/cache/cookbooks/elkstack/recipes/logstash.rb:22:in 'from_file' /var/chef/cache/cookbooks/elkstack/recipes/single.rb:14:in 'from_file' this line causing error, i'm not sure start in troubleshooting attribute: >> directory node['logstash']['instance_default']['basedir'] owner node['logstash']['instance_default']['user'] grouping node['logstash']['instance_default']['group'] mode '0755' end that error means either node['logstash'] or node['logstash']['instance_default'] not set. in ruby, when ...

robotframework - Imap Library for Robot Framework, "Open Link From Mail" not working -

robotframework - Imap Library for Robot Framework, "Open Link From Mail" not working - is there using imap library in robot framework? please help me resolve problem. i'm using imap library check new email comming, got issue during test. my simple test case: *** settings *** library selenium2library library imaplibrary *** test cases *** create simple test open mailbox server=imap.googlemail.com user=vntest...@gmail.com password=abcxyz ${latest}= wait mail service fromemail=brisi...@gmail.com toemail=vntest...@gmail.com timeout=300 ${html}= open link mail service ${latest} should contain ${html} mail service brisingrit vntestexpense 01 close mailbox i met issue @ keyword 'open link mail'. script have got result ${latest} = 1, failed when "open link mail service 1 " this test results: starting test: web.tests.z temp suite.sandbox.create simple test ...

python - Removing this value from a deeply nested list -

python - Removing this value from a deeply nested list - i have next info construction returned json object: [[[13, u'arsenal', [[6.125, [[u'assist', u'cross', [3]], [u'normal', u'cross', [198]], [u'normal', u'longball', [326]], [u'assist', u'short', [5]], [u'normal', u'short', [4726]], [u'assist', u'throughball', [1]], [u'normal', u'throughball', [35]]]]]]]] i having problem converting construction dictionary. dictionary has set of tuples keys, made text objects in above nested lists (i.e. ('assist', u'cross') ). code using is: for match in responser: num_events, team, events in match: regex = {tuple(sub[:2]): sub[2][0] y in events[0] sub in y} however returns next error: exceptions.typeerror: 'float' object not it...

opencv - Occluded Objects -

opencv - Occluded Objects - does have thought how separate or observe overlapped objects? working on project aiming @ detection crops in late stage of growth. did first step, segmentation (segment plants background), got stack detection stage because of overlapping between 2 crops or more (cauliflower). way, working on opencv , visual c++. grateful help. opencv visual-c++ image-processing

web applications - How to change configuration of web apps -

web applications - How to change configuration of web apps - my web app depends on external services , has api access key values hardcoded in source code. now want back upwards multiple environments, development , production. each environment want utilize different set of services different keys. the question how alter keys in source code when switching environments? as obvious solution can think of script patches files using environment variables. modern tools , technologies around web development think there must more elegant solution. heard grunt , didn't find appropriate plugin. i ended solution based on suggestion in comments. created settings.env.js files containing setting variables, env prod , dev , test , etc. then alter environment re-create 1 of tese files settings.js, included in client side code. convenience made grunt task copy: grunt use:dev web-applications configuration gruntjs gulp

Automatically extract images from Chrome cache on OSX -

Automatically extract images from Chrome cache on OSX - i want recover images particular domain visited in chrome. i've looked in ~/library/caches/google/chrome/default/cache , there bunch of gzipped files, tried extracting 1 of them , found contained bunch of minified js. i've seen cachecopy , chromecacheview windows. there easy way on osx? osx google-chrome

Postfix in Docker container can't resolve MX unless it gets restarted once -

Postfix in Docker container can't resolve MX unless it gets restarted once - i have issue postfix instance in docker container. i'm using supervisord create sure services run in background. however, if build image, start first time , seek send mail, postfix complains can't resolve mx record given address ( status=deferred (host or domain name not found. name service error name=domain.tld type=mx: host not found, seek again) ). now installed dig find out if dns issue, can resolve mx straight: $ dig mx domain.tld +short 90 aspmx2.googlemail.com. 90 aspmx3.googlemail.com. 10 aspmx.l.google.com. 50 alt1.aspmx.l.google.com. 50 alt2.aspmx.l.google.com. then proceeded restart postfix service postfix restart , pretty startled mx issue gone. reproduced issue more 3 times , same. have issue service postfix restart create postfix work functional. can explain me why or better: how prepare this? thanks in advance! i ran same issue when tried install post...

java - Android Action Bar Style Generator : Change text color of action bar -

java - Android Action Bar Style Generator : Change text color of action bar - i utilize "android action bar style generator" website generate styles actionbar. want alter text color of action bar white , tried <item name="android:textcolor">#fff</item> in manifest didn't work. can 1 help me ? test this way didn't answer. used appcompat in project. style generator give me values,drawable folder , other folder. style generator gives me <resources> <style name="theme.example" parent="@style/theme.appcompat"> <item name="actionbaritembackground">@drawable/selectable_background_example</item> <item name="popupmenustyle">@style/popupmenu.example</item> <item name="dropdownlistviewstyle">@style/dropdownlistview.example</item> <item name="actionbartabstyle">@style/actionbartabstyle.example</item> <ite...

ios - install release version of app from xcode -

ios - install release version of app from xcode - i'm developing iphone app , beta users (via hockey) have reported issues can't reproduce. believe related difference in builds between when run on device via xcode, , test users archive bundle via hockey. there way can xcode set same version on device release test users? well, figured out... guess it's don't understand xcode well. reply edit (or duplicate , edit) scheme you're using build app. can found on product menu. set "run" configuration "release" , clean build , run, , me @ to the lowest degree able reproduce issues beta testers seeing release archive. ios xcode archive

c - How is memory allocated in an array of integer pointers? -

c - How is memory allocated in an array of integer pointers? - i practicing c programming , trying create 2d array fixed rows, variable columns. so, used "array of pointers" concept i.e. created array such int* b[4]. this code written: #include <stdio.h> int main(void) { int* b[4]; int c[]={1,2,3}; int d[]={4,5,6,7,8, 9}; int e[]={10}; int f[]={11, 12, 13}; b[0]=c; b[1]=d; b[2]=e; b[3]=f; //printing b[0][0] b[0][2] i.e. c[0] c[2] printf("b[0][0]= %d\tb[0][1]=%d\tb[0][2]=%d\n", b[0][0], b[0][1], b[0][2]); //printing b[1][0] b[1][5] i.e. d[0] d[5] printf("b[1][0]= %d\tb[1][1]=%d\tb[1][2]=%d\tb[1][3]=%d\tb[1][4]=%d\tb[1][5]=%d\n", b[1][0], b[1][1], b[1][2], b[1][3], b[1][4], b[1][5]); //printing b[2][0] i.e. e[0] printf("b[2][0]= %d\n", b[2][0]); //printing b[3][0] b[3][2] i.e. f[0] f[2] printf("b[3][0]= %d\tb[3][1]=%d\tb[3][2]=%d\n", b[3][0], b[3][1], b[3][2]); homecoming 0; } and output expected: ...

php - Form Options Date Picker - 1 Year -

php - Form Options Date Picker - 1 Year - i have script lets me pick date dropdown list total year future, want same year past reversing not work. here codes: 1 year ahead <?php $day = date('y-m-d'); $last_day = date('y-m-d', strtotime($day . '+ 1 year')); while($day < $last_day) { echo '<option value="'.$day.'">'.date('js f y', strtotime($day)).'</option>'; $day = date('y-m-d', strtotime($day . ' + 1 day')); } ?> 1 year past <?php $day = date('y-m-d'); $last_day = date('y-m-d', strtotime($day . '- 1 year')); while($day < $last_day) { echo '<option value="'.$day.'">'.date('js f y', strtotime($day)).'</option>'; $day = date('y-m-d', strtotime($day . ' - 1 day')); } ?> the furure date picker works fin...

c# - Open File Dialog Initial directory -

c# - Open File Dialog Initial directory - i have problem initialdirectory path used part of code shown below. opendialog show directory open file lastly time couldn't set new relative path.. tried set absolute path didn't work also. private static string path = system.reflection.assembly.getexecutingassembly().location; public static string opendialog() { // create opendialog var dlg = new microsoft.win32.openfiledialog(); // initial directory openfiledialog need prepare if(directory.exists(path)) { dlg.initialdirectory = path; } dlg.restoredirectory = true; in example, 'path' beingness set .exe, cause if (directory.exists(path)) fail, therefore, dialog open lastly known directory, because initialdirectory not set value want. seek hard-coding known directory path first. or prepare it: path = directory.getparent(system.reflection.assembly.getexecutingassembly().locatio...

sql - Group by with null values -

sql - Group by with null values - trying grouping result bellow: +-------------+------+ | id | coln1 | coln2 | +-------------+------+ | 10 | | null | | 10 | null | x | | 15 | b | null | | 15 | null | y | | 20 | c | null | | 20 | null | z | +--------------+-----+ with next select: select * ( select db1.dbo.table1.id id, db1.dbo.table1.coln1 coln1, null coln2 db1.dbo.table1 union select db2.dbo.table2.id id, null coln1, db2.dbo.table2.coln2 coln2 db2.dbo.table2 ) grouping id, coln1, coln2 order id asc expecting this: +-------------+------+ | id | coln1 | coln2 | +-------------+------+ | 10 | | x | | 15 | b | y | | 20 | c | z | +--------------+-----+ with no luck. tried utilize having no luck neither. info on this. an aggregate function should help you. aggregate function eliminate null values.try this select id, max(coln1), max(coln2) tablename group...

objective c - iOS 8 Error when requesting Authorization -

objective c - iOS 8 Error when requesting Authorization - i having much problem trying requesting location services authorization. know there other posts on forum, did not solve problem solution. this error popping in xcode: trying start mapkit location updates without prompting location authorization. must phone call -[cllocationmanager requestwheninuseauthorization] or -[cllocationmanager requestalwaysauthorization] first. i have added both required keys plist. another of import point when start in simulator, can go setting manually , enable location services , app work. however, when restart app not work , same message above. i want prompt user alternative enable location services. unfortunately, code not prompt authorization location services. please help have been pulling hair out hours. 1 - (void)viewdidload { [super viewdidload]; self.locationmanager = [[cllocationmanager alloc]init]; self.locationmanager.delegate = self; if ([self.locationmanager ...

webrtc - XirSys - SimpleWebRTC - I get 'Could not validate application' when doing the request to iceServers -

webrtc - XirSys - SimpleWebRTC - I get 'Could not validate application' when doing the request to iceServers - my request xirsys endpoint looks this: $.ajax({ type: "post", datatype: "json", url: "https://api.xirsys.com/geticeservers", data: { ident: "username", secret: "secret_api_key", domain: "dummy_subdomain.domain.com", application: "default", room: "default", secure: 1 }, }); however, if username, secret , rest of info seem right xirsys dashboard, error: 'could not validate application' . do have thought ? give thanks you. well, tried , 200 status, unfortunately response: {"p":"/geticeservers","s":200,"d":{"iceservers":[{"url":"stun:127.0.0.1"},{"username":"free","url":"turn:127.0.0.1?transport=ud...

no syntax highlighting for Ruby Gemfile in Notepad++ -

no syntax highlighting for Ruby Gemfile in Notepad++ - i created new app in ruby on rails , opened notepad++. seems of files syntax highlighted ruby on rails create easier development. one problem, though gemfile, not given ruby file extension: gemfile not gemfile.rb . is there anyway apply ruby syntax highlighting gemfile without changing extension? select menu language -> r -> ruby , apply coloring document. unfortunately you'll have repeat every time open file. notepad++ syntax-highlighting

android - Updating regions in RegionBootstrap -

android - Updating regions in RegionBootstrap - i have application using regionbootstrap set of regions. in oncreate method of application class instantiate regionbootstrap , pass list of regions. works great, , expected. there way update regions regionbootstrap looking later on, after instantiation? have database table storing part data, , can updated throughout lifetime of application. have content observer watching updates don't know how add/remove regions accordingly. thanks! apologies late reply question. think can find reply similar question here: how can "refresh" regionbootstrap (android beacon library)? quote: you should build regionbootstrap once. if want alter monitored regions adding new ones, straight on beaconmanager this: beaconmanager.startmonitoringbeaconsinregion(new region("mymonitoringuniqueid", null, null, null)); android altbeacon

java - JUnit 4: Test case returns an object used in other tests in the test suite -

java - JUnit 4: Test case returns an object used in other tests in the test suite - i have created several tests cases application, these chained in single test suite class. however, pass object created in first test others. to clearer, first test tests class creates complex object info coming database. others test methods of object itself. here how define test suite class: package tests.testsuites; import tests.test1; import tests.test2; import org.junit.runner.runwith; import org.junit.runners.suite; import org.junit.runners.suite.suiteclasses; @runwith(suite.class) @suiteclasses({ test1.class test2.class }) public class datatestsuite { } but have somewhere: myobject obj=test1.testcreation(); test2.testmethod(obj); how can combine regular junit testsuite class definition need pass created object other test? edit for information, test suite launched in test runner class. class helps formatting results , creates custom log file. this how ca...

c# - How to call view as full page (ignoring render body)? -

c# - How to call view as full page (ignoring render body)? - i have regular application _layout.cshtml , @renderbody() render views inside, login view need render total page not within @renderbody(). regards you need set layout property null @ origin of view. so, login.cshtml file should start with: @model yourmodel @{ layout = null; } c# asp.net-mvc razor

ios - Custom table view cell image distorting -

ios - Custom table view cell image distorting - i have custom uitableviewcell, have image well, image stretching rather unusually. here code: var count = 0 var propic: nsstring = "" var name: nsstring = "" info in listdataarray { if(indexpath.row == count) { if allow pic = data["profile_pic"] as? nsstring { propic = pic } if allow n = data["full_name"] as? nsstring { name = n } } count++ } allow decodeddata = nsdata(base64encodedstring: propic, options: nsdatabase64decodingoptions(0)) var decodedimage = uiimage(data: decodeddata!) var cell:tableviewcell? = tableview.dequeuereusablecellwithidentifier("cell") as? tableviewcell if (cell == nil) { allow nib:array = nsbundle.mainbundle().loadnibnamed("tableviewcell", owner: self, options: nil) cell = nib[0] a...

sql - Calculating total time excluding overlapped time & breaks in SQLServer -

sql - Calculating total time excluding overlapped time & breaks in SQLServer - from list of start time , end times select query, need find out total time excluding overlapping time , breaks. starttime endtime 2014-10-01 10:30:00.000 2014-10-01 12:00:00.000 -- 90 mins 2014-10-01 10:40:00.000 2014-10-01 12:00:00.000 --0 since overlapped previous 2014-10-01 10:42:00.000 2014-10-01 12:20:00.000 -- 20 mins excluding overlapped time 2014-10-01 10:40:00.000 2014-10-01 13:00:00.000 -- 40 mins 2014-10-01 10:44:00.000 2014-10-01 12:21:00.000 -- 0 previous ones have covered time range 2014-10-13 15:50:00.000 2014-10-13 16:00:00.000 -- 10 mins so total should 160 mins in case. i don't want utilize many loops through this. looking simple solution. declare @table table (starttime datetime2, endtime datetime2) insert @table select '2014-10-01 10:30:00.000', '2014-10-01 12:00:00.000' insert @table select '...

Uploading a File on aWebsite using Ruby Rails 4 -

Uploading a File on aWebsite using Ruby Rails 4 - i using rails 4 , have code. i created controller , called upload (upload_controller.rb) i set code in it: class uploadcontroller < applicationcontroller def index render :file => 'app\views\upload\uploadfile.rhtml.erb' end def uploadfile post = datafile.save(params[:upload]) render :text => "file has been uploaded successfully" end end my model called data_file.rb. code following: class datafile < activerecord::base attr_accessor :upload def self.save(upload) name = upload['datafile'].original_filename directory = "public/data" # create file path path = file.join(directory, name) # write file file.open(path, "wb") { |f| f.write(upload['datafile'].read) } end end my view file called uploadfile.html.erb. code following: <h1>file upload</h1> <%= form_tag({:action =...

How to reshape a matrix horizontally using MATLAB -

How to reshape a matrix horizontally using MATLAB - i have matrix a of size(4,192) . consists of 12 matrices of size(4,4) aligned horizontally. want matrix b size(12,16) . b must follows: suppose a=[y1,y2,y3,...,y12] in yn 4*4 matrix. then, b=[y1,y4,y7,y10; y2,y5,y8,y11; y3,y6,y9,y12] is there efficient/quicker (using no loop) way using matlab? you can seek next code: ys1 = 2; % size(1) submatrix (for next example, utilize ys1 = 4 actual problem) ys2 = 2; % size(2) submatrix (for next example, utilize ys2 = 4 actual problem) ns1 = 3; % size(1) of final matrix in terms of submatrix (3 rows) ns2 = 4; % size(2) of final matrix in terms of submatrix (4 columns) temp = reshape(a,ys1,ys2,ns1,ns2); b = reshape(permute(temp,[1 3 2 4]),ys1*ns1,ys2*ns2); example: a = [11 12 21 22 31 32 41 42 51 52 61 62 71 72 81 82 91 92 101 102 111 112 121 122; 13 14 23 24 33 34 43 44 53 54 63 64 73 74 83 84 93 94 103 ...

delphi - How can I create my own custom Hint for a specific control? -

delphi - How can I create my own custom Hint for a specific control? - i need create custom hint window (with it's own color , layout) specific command (not entire application) the hint text not connected specific hint property control. as suggested wrote handler cm_hintshow (this worked if command has showhint=true ): procedure tmycontrol.cmhintshow(var message: tmessage); begin form1.caption := 'x'; // here display own hint window // inherited; end; but now, how know when/where hide when hint times out? neither cm_hintshow or cm_hintshowpause gives me info. in cm_hintshow message handler, can cast lparam value phintinfo pointer , customize fields needed. instance, alter background color, set thintinfo.hintcolor field. alter layout of hint, can derive new class thintwindow , assign class type thintinfo.hintwindowclass field. let vcl manage hint you, including showing , hiding it. delphi delphi-7

php - Codeigniter return null array from user function -

php - Codeigniter return null array from user function - i wrote user library: class likeredis { public function __construct($data = array()){ homecoming $this->init(); } public function init(){ homecoming array('id' => 3); // total array } } call function: $comment = $this->load->library('likeredis', array()); output: var_dump($comment); // null why null array? looks have casing problem, remember class names begin uppercase letter. seek this: $comment = $this->load->library('likeredis', array()); additionally, think there may conceptual problem regarding objects. been few years since i've used codeigniter framework , i'm not sure loader using typically constructor of class not have homecoming value , instead returns instantiation of class default commonly referred object. access array should added fellow member of class if appropriate. perhaps help explain want uti...

node.js - Nodejs + Mongodb tailable cursor stream() query keeps running in background -

node.js - Nodejs + Mongodb tailable cursor stream() query keeps running in background - i utilize code latest info mongodb collection https://gist.github.com/jpaljasma/3260eaa6f7a40315863d#file-tailable-cursor-js the issue when // create stream , hear var stream = coll.find(filter, cursoroptions).sort({$natural: -1}).stream(); the above line executed.. query starts can seen in mongod console so far able pause query using stream.pause(); when info beingness received. also info event // phone call callback stream.on('data', next); is called when info inserted in db i want find way can null results of query running in background. the issue page loaded execute code , stream query starts in background using live graph , it's fine long browser open want stop browser gets closed. node.js mongodb

javascript - How to properly retrieve all data from an IndexedDb in a WinJS Windows 8 app? -

javascript - How to properly retrieve all data from an IndexedDb in a WinJS Windows 8 app? - i've been googling while , have found nil can help me. i'm trying retrieve info indexeddb. here's code looks far: var request = window.indexeddb.open("list", 1); request.onsuccess = function (event) { db = request.result; console.log("success: " + db); }; request.onupgradeneeded = function (event) { db = event.target.result; var objectstore = db.createobjectstore("list", { keypath: "id" }); (var in parseddata) { objectstore.add(parseddata[i]); } console.log("retrieving data"); var transaction = request.transaction("list"); var store = transaction.objectstore("list"); store.opencursor().onsuccess = function (e) { var cursor = e.target.request; if (cursor) { console.log("li...

css - Best text color for any background image? -

css - Best text color for any background image? - my page backgroud image fills whole page , changes every time page loaded. looking find text color , shadow css suit every image out there. my current css text-shadow: rgb(255, 255, 255) 1px 1px 0px; color:#222; doesnt good. possible alter text color automatically based on type of image . or there text color , shadow suit images? white black outline readable on anything. if images very different, i'd go that. or add together per-image css. examples of how effect: http://css-tricks.com/adding-stroke-to-web-text/ css

python - Find overlap of two lists, preserving sequence order -

python - Find overlap of two lists, preserving sequence order - i've found many methods of finding list intersections here, i'm having problem finding efficient way find intersection when order taken account. list1 = [1, 2, 3, 4, 5, 6, 7] list2 = [7, 6, 3, 4, 5, 8] the function should homecoming [3, 4, 5] i know there 1 overlapping sequence, , know minimum length, not exact length. you looking longest mutual subsequence algorithm; next uses dynamic programming find elements in o(nm) time (for sequences of length n , m): def lcs(a, b): tbl = [[0 _ in range(len(b) + 1)] _ in range(len(a) + 1)] i, x in enumerate(a): j, y in enumerate(b): tbl[i + 1][j + 1] = tbl[i][j] + 1 if x == y else max( tbl[i + 1][j], tbl[i][j + 1]) res = [] i, j = len(a), len(b) while , j: if tbl[i][j] == tbl[i - 1][j]: -= 1 elif tbl[i][j] == tbl[i][j - 1]: j -= 1 else: ...

java - Type ChangeListener does not take parameters -

java - Type ChangeListener does not take parameters - i'm trying create changelisteners properties of stage, can't figure out how to... mainscene.widthproperty().addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> observablevalue, number oldscenewidth, number newscenewidth) { system.out.println("width: " + newscenewidth); } }); gives error "type changelistener not take parameters". mainscene.widthproperty().addlistener(new changelistener<>() { @override public void changed(observablevalue<? extends number> observablevalue, number oldscenewidth, number newscenewidth) { system.out.println("width: " + newscenewidth); } }); gives "cannot infer type arguments changelistener". feels "damned if do, damned if don't" situation me. removing parentheses after <> gives boatload of erro...

Python Program won't restart -

Python Program won't restart - this question exact duplicate of: restart python programme [duplicate] i trying restart programme in python, but, reason, code getting caught in while playagain loop. says "that not valid answer. please come in 'yes' or 'no'." when come in yes, no, or of other inputs acceptable. why won't work? while true: playagain = input("would play again?") while playagain != "y" or playagain != "y" or playagain != "yes" or playagain != "yes" or playagain != "yes" or playagain != "n" or playagain != "n" or playagain != "no" or playagain != "no" or playagain != "no": print("that not valid answer. please come in 'yes' or 'no'.") playagain = input("would play again?") if playagain == "y" ...

android - exception on on listing files inside assets folder -

android - exception on on listing files inside assets folder - i want print,for testing content of 2 folder within assets folder. the folder composed: assets foo.txt foo1.txt but programme says me there aren't files. assetmanager assetmanager = getassets(); string[] files = null; seek { files = assetmanager.list(""); } grab (ioexception e1) { e1.printstacktrace(); } (int = 0; < files.length; i++) { file file = new file(files[i]); seek { scanner scanner = new scanner(file); while (scanner.hasnextline()) { log.e(" ", " " + scanner.next()); } scanner.close(); } grab (filenotfoundexception e) { e.printstacktrace(); } } logcat 10-06 19:38:...

How do I set up Sinatra or another Ruby framework on NearlyFreeSpeech -

How do I set up Sinatra or another Ruby framework on NearlyFreeSpeech - how next code work on site hosted on nearlyfreespeech.net? require 'sinatra' '/' "hello world!" end that code in script file named main.rb , in public folder on nsfn-hosted site. but when go site, 403 error. if worked, show hello world! . what doing wrong? short reply how can create happen: you can't. just utilize heroku or openshift or other provieder allow run ruby (the have both free tiers) since next question why can't that: it's because how web server in combination php, ruby, python works. web server can write characters connected user (yes simplify here) need translate script in character. known run script. , create happens hoster need back upwards (as in have ruby installed), in case back upwards php can't run ruby code. ruby sinatra nearlyfreespeech

winapi - SetFileTime() behaving strangeley -

winapi - SetFileTime() behaving strangeley - the windows function setfiletime() in company's application behaving anomalously in 2 ways: a.) in 1 case, i'm trying update date times (access, create, modify) of file "01/01/1980 00:00:00" , file winds having original date times removed. b.) in case, file have create , modified date updated seemingly random date time "march ‎17, ‎1817, ‏‎6:26:56 am". 1 not replicable - same file can update fine if seek subsequent times. please advise/assist. in both cases, update beingness done remotely - files reside on different server. language mfc c++ code below: cstring cstime; coledatetime tcreate, taccess, tmodify; systemtime stcreate, staccess, stmodify; filetime ftcreate, ftaccess, ftmodify; cstime = pmeta->get( _t("createtime") ); if ( !cstime.isempty() ) tcreate.parsedatetime( cstime, 0ul, 1033 ); else tcreate = coledatetime::getcurrenttime(); tcreate.getassystemtime( stcr...

spring security - SpringSecurity replaying a login Grails -

spring security - SpringSecurity replaying a login Grails - in grails, have configured spring security. best practise alter value of session tokens after login , logout. however, wondering should behaviour if login replayed. for example, logs in, receives valid session token (http jsession). replay login, should new token or not? i think section of documentation regarding session fixation prevention addresses potential issue. unless have technical reason not enabling feature it's best practice so. grails spring-security

zend framework2 - One Factory to create entities -

zend framework2 - One Factory to create entities - i want utilize 1 mill create entities $this->getservicemanager()->setfactory("order_entity", new orderentityfactory($obj->concept, $obj->currency, $obj->exchangerate, $obj->cost, $obj->percentageofpayment, $obj->accountid, $obj->invoiceid, $obj->paymentdate, $obj->orderstatus, $obj->categorylinknode)); $orderentity = $this->getservicemanager()->get("order_entit...

SQL Server Audit Event Log -

SQL Server Audit Event Log - i'm struggling audit working using application logs on sql server 2012 based upon various responses i've found here , microsoft's documentation. test, executed next script in management studio , reported success. however, when deliberately fail login, don't see records appearing in os log. use master go create server audit auditdataaccess application_log go create server audit specification hippa_audit_specification server audit auditdataaccess add together (failed_login_group) (state = on) go alter server audit auditdataaccess (state = on) go clarifying: works if set output file instead of os log. if create object this: create server audit auditdataaccess file ( filepath ='c:\sqlaudit\' ) go ...it works , can retrieve info using: select * sys.fn_get_audit_file ('c:\sqlaudit\auditdataaccess_*.sqlaudit',default,default); go what doing wrong regard using os application log? edit: if...

operating system - QUERY REGARDING PARENT AND CHILD PROCESS -

operating system - QUERY REGARDING PARENT AND CHILD PROCESS - can loop preempted in between? suppose have parent , kid proces;both have loop execution can 1 process's loop preempted in between process loop started?and if so, resume afterwards? this depends on operating scheme used , many parameters, e.g. priority of processes. process can interrupted after each machine instruction. means can interrupted within single line of code in language c. if process has been interrupted, resumed next machine instruction. operating-system

Suppressing gridlines in ggplot for Python -

Suppressing gridlines in ggplot for Python - i create simple scatter plot using ggplot python, don't want grid lines in plot. there way suppress gridlines? know in ggplot2 can utilize like theme(panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank()) however, can't find similar in ggplot python documentation or on stackexchange. i had same problem , able find theme @ http://ggplot.yhathq.com/docs/theme_matplotlib.html python gridlines python-ggplot

Loading javascript in Span/Div in jquery -

Loading javascript in Span/Div in jquery - i'm trying load javascript script link in div/span.(script contains image , link) script must come within span when run page. i have tried load(),$.getscript unfortunately unable so.my script must run document load without click or user action. html <span class=" loader"></span> jquery: <script type="text/javascript"> $.ajax({ type: "get", url: "test.js", datatype: "script" success: function( strhtml ){ $( ".loader" ).html( strhtml ); }); </script> i tried also: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>home</title> <script src="https://code.jquery.com/jquery-1.11.1.js" type="text/javascript"></script> <style> </style> <script...

Suggested ways to handle object persistence on Android activity recreation -

Suggested ways to handle object persistence on Android activity recreation - in android application there many instances multiple activities phone call mutual service passing callback if activity destroyed , recreated (say due orientation change) there every chance callback reference lost. know normal ways of using onsavedinstance method or headless fragment of persisting. in way activities have handle it. there mutual way handle this. note : want have simple , reusable code persistence happen i want have simple , reusable code persistence happen you can create activity class write state management boilerplate code , create other activities inherit base of operations activity. android android-activity

java - Slash ("/") added to my return URL -

java - Slash ("/") added to my return URL - i'm creating payment rest api through paypal sdk. seems work fine, redirect paypal, payment itself. when homecoming shop paypal, returnurl has "/" added end. instead of http://192.168.41.174/confirm i'm beingness redirected http://192.168.41.174/confirm/ the payload of payment creation request is: { "intent": "sale", "payer": { "payment_method": "paypal" }, "transactions": [ { "amount": { "currency": "eur", "total": "21.27", "details": { "shipping": "4.99", "subtotal": "16.28" } }, "description": "thank purchase!" } ], "redirect_urls": { "return_url": "http://192.168.41.174/confirm", "cancel_url"...

ruby - Can't declare variables in Powershell -

ruby - Can't declare variables in Powershell - i next along larn ruby hard way book , having problem powershell. have gotten ruby running in shell , can perform calculations , run .rb files. however, when seek simple variable assignment such as: i = 4 i big reddish error message saying along lines of "i : term 'i' not recognized name of cmdlet, function, script file, or operable programme etc..." why trying read script/program name instead of variable assignment? using ruby 2.0.0p576 (x64) on 64 bit windows 8 machine if helps @ all. i realized won't allow me basic comparisons 4 == 9. tries read assignment reason. did seek irb command ? calculations , mimics need run irb first. ruby variables declaration

Python ctypes DLL method call works interactively, only one call as script -

Python ctypes DLL method call works interactively, only one call as script - i need utilize dll (of don't have source) communicate other process. i'm using ctypes, so: gcs = cdll('some_dll.dll') gcs.comm_init(byref(socket_id), 0, 'localhost') data_out = (c_double*3)(); data_in = (c_double*3)(); while true: rv = gcs.comm_exchange(byref(socket_id), data_in, data_out) if rv == communication_return_code['success']: print('received data_out :\t%lf\t%lf\t%lf\n' % tuple(data_out)) else: errmsg = some_function(rv) print('error: %s\n' % errmsg) break when running in interactive python prompt, comm_exchange updates data_out array each time expected (it'd work many times i'd try). however, when running script, updates data_out array once, connection error occurs @ sec phone call exchange. problem can't track downwards what's causing connection error in library, don't have source of library. ...

c++ - How can I write a type trait to check if a type is convertible to another by a non-narrowing conversion? -

c++ - How can I write a type trait to check if a type is convertible to another by a non-narrowing conversion? - c++11 introduced uniform initialization, comes desirable feature of forbidding implicit narrowing conversions. example, int i{2.2} should error. unfortunately, backwards-compatibility reasons c++03, gcc since 4.7 gives warning these. gcc's documentation suggests extension doesn't apply in sfinae contexts, appears wrong: #include <type_traits> #include <utility> template <typename from, typename to> class is_list_convertible_helper { template <typename to2> static void requires_conversion(to2 t); template <typename from2, typename to2, typename = decltype(requires_conversion<to2>({std::declval<from2>()}))> // ^ braced initializer static std::true_type helper(int); template <typename from2, typename to2> static std::false_type helper(...); ...

javascript - HandlebarsJS registerHelper for comparing two dates -

javascript - HandlebarsJS registerHelper for comparing two dates - i want create helper can compare 2 dates between each other, , depending if date has passed show specific html elements or not. have info receive remote json contains "date" field. example: data: { date: "2014-10-04", event: "some past event, }, { date: "2014-12-06", event: "some future event, ... so, if date has passed , want either hide html or archive it, , upcoming events want display of course. far tried this: handlebars.registerhelper('has_passed', function(datestring, options) { var current_date = moment(datestring).format("yyyy-mm-dd").touppercase(); // current date if(current_date> here???) { homecoming options.fn(this); // if current date "bigger" passed date show html } }); and html looks now {{#has_passed date}} <div> <h1>blablabla</h1> </div...

java - Can't read the receivePacket -

java - Can't read the receivePacket - why don't receive packet eclipse server ? i start server.java in eclipse java application , client android application server print out text client client doesn't response. server.java public static void main(string... args) throws exception { datagramsocket serversocket = new datagramsocket(4444); byte[] receivedata = new byte[1024]; byte[] senddata = new byte[1024]; while(true) { //empfang datagrampacket receivepacket = new datagrampacket(receivedata, receivedata.length); serversocket.receive(receivepacket); string sentence = new string( receivepacket.getdata()); system.out.println("received: " + sentence); //senden inetaddress ipaddress = receivepacket.getaddress(); int port = receivepacket.getport(); ...

xcode - Swift: Creating Edges Around Button And Adding Text -

xcode - Swift: Creating Edges Around Button And Adding Text - i trying turn rectangular button sort of oval getting edges on it. there anyway programatically through swift? also, there way add together string or text button? appreciate it, still getting used programming swift. thanks you need utilize quartzcore , layer property accomplish this. eg - import quartzcore allow myview = uiview(frame: cgrectmake(0, 0, 55, 55)) myview.layer.cornerradius = 5.0 myview.clipstobounds = true you can add together in viewdidload function. seek it xcode swift

Excel VBA - Reference chart data point by name instead of index number -

Excel VBA - Reference chart data point by name instead of index number - i have basic gantt chart table info source, however, when name selected somewhere on sheet, table gets emptied , refilled info belongs chosen name. there 1 info point same every name , want bar have color. i know way reference info point: activechart.fullseriescollection(2).points(3) but wont work in illustration because amount of info points keeps changing , same thing not in 3rd position. i tried this, thought throws me type mismatch error: activechart.fullseriescollection(2).points("somestring") is possible reference info point name in vba? with simple gantt chart looks this: you can alter color of point b first returning xvalue, match against name looking , set corresponding point color: option explicit sub changepointbcolor() dim x integer dim varvalues variant dim cht chart set cht = worksheets("sheet1").chartobjects(...

keyboard shortcuts - Edit Firefox Devtools key bindings -

keyboard shortcuts - Edit Firefox Devtools key bindings - since firefox 33, there has been gui alternative in dev tools utilize different style key bindings in editor. great, functionality ends. how can edit specific key bindings editor? i utilize sublime key bindings, 1 annoyance captures cmd/ctrl+t , transposes characters instead of opening new tab. incredibly annoying, , i've been looking way edit this file ff source code, can't find anywhere. downloading ff source code, editing it, , creating own build not option. firefox keyboard-shortcuts sublimetext codemirror firefox-developer-tools

PHP Array Retrieve Value -

PHP Array Retrieve Value - when run this: print_r($result); i following: stdclass object ( [sendmessagewithreferenceresult] => message queued ) how can assign "message queued successfully" variable? it's little hard tell question, think be: $variable = $result->sendmessagewithreferenceresult; php

spring security - CAS set-up using restlet API to secure REST services -

spring security - CAS set-up using restlet API to secure REST services - i trying utilize single sing on. able secure web services/pages , want extend rest apis (services) well. using cas 4.0.0. followed link http://jasig.github.io/cas/4.0.0/protocol/rest-protocol.html , alter web.xml suggested , added next jar cas deployment web-inf/lib folder: cas-server-integration-restlet-4.0.0.jar org.restlet.jar org.restlet.ext.spring.jar org.restlet.ext.servlet.jar the phone call "v1/tickets" reaching restlet-frame work getting 404 error rest client status code: 404 not found accept-ranges: bytes content-length: 439 content-type: text/html;charset=utf-8 date: thu, 06 nov 2014 13:12:46 gmt server: restlet-framework/2.2.2 can please help me identify issue set-up or point me detailed documentation. disclaimer: i'm chairman of cas , founder of cas in cloud (https://www.casinthecloud.com). the endpoint in lower-case: can try: /v1/tickets? rest spr...

java - Syntax error, regarding to changing variables in an object from a class -

java - Syntax error, regarding to changing variables in an object from a class - class anyname { int tcol = 0; int fc = 0; int x = 0; float randx = (random(1, 1000)); float randy = (random (0, 600)); int tsizes = 1; { if (fc >= x) { //random ellipse 3 stroke (tcol); fill (tcol); ellipse (randx, randy, tsizes, tsizes); } } } anyname ranx1 = new anyname(); ranx1.x = 100; hi, trying add together class/object code , not working. class have far, when instantiate 1 object class (ranx1), , seek alter 1 of variables within (x), says there error. there need change? appreciate help. since instantiated object class, how alter variables new object? example, if in class x = 0, made re-create , time want x = 100, other variables such tcol , fc remain same. know possible because teacher taught it, not working right me. i newby programmer, think should easy answer. if want entire code, please set email in answer, can email entire thi...

Rebuild only affected jade files with gulp-jade-find-affected -

Rebuild only affected jade files with gulp-jade-find-affected - i'm trying utilize gulp-jade-find-affected rebuild watcher affected files. example, if update in layout or mixin file, want rebuild files includes mixin. but illustration on plugin's github doesn't work since update of gulp-watch (emitonglob alternative doesn't exist anymore). after research, found this solution , tried adapt case doesn't work : var gulp = require('gulp'), watch = require('gulp-watch'), fs = require('fs'), jade = require("gulp-jade"), affected = require('gulp-jade-find-affected'); var destjade = './docs/'; gulp.task('templates', function() { homecoming gulp.src('src/fr_fr/pages/*.jade').pipe(watch('src/fr_fr/**/*.jade', function(files) { homecoming files .pipe(affected()) .pipe(jade({ pretty: true, data: json.parse(fs.readfilesync('./...

changing image opacity in jquery mobile -

changing image opacity in jquery mobile - bellow effort alter opacity of image using slider widget in jquery mobile. far code nil happens. wrong code? thank the script: <!doctype html> <html> <head> <title>base template</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/jquery.mobile-1.1.0.min.css" /> <script src="js/jquery-1.7.2.min.js"></script> <script src="js/jquery.mobile-1.1.0.min.js"> $(document).ready(function(){ $('#slider-0').click(function(){ $("img").fadeto(1000,0.4); }); }); </script> </head> <body> <div data-role="header"> <h3>change image opacity</h3> </div> ...