Posts

Showing posts from June, 2014

php - cakephp how to log events -

i want log events across multiple controllers , store them in 'actions' database. need have actions class/controller because need id action object after has saved. what best way of doing can run method across controllers add new action database? $this->action->log($array) ; many thanks you should use component that. components objects can used across controller (as long include in controller's $components property, or in of appcontroller). for example, if have experience auth in cake, that's component, , methods can called controller. more info components here: http://book.cakephp.org/2.0/en/controllers/components.html if need more help, feel free try , write component , come problems might have.

ruby on rails - redmine icalender export plugin -

i trying install redmine icalendar export plugin( https://github.com/planio/redmine_icalendar_export ) , plugin require icalendar, tried install using "gem install icalendar" . after installation calender part stopped working , showing error "internal error error occurred on page trying access." in log file getting following error: actionview::templateerror (no route matches {:action=>"index", :status=>"all", :controller=>"calendar", :assigned_to=>"*", :format=>"atom", :project_id=>#<project id: 3, name: "test project", description: "", homepage: "", is_public: true, parent_id: nil, created_on: "2013-01-08 06:03:05", updated_on: "2013-02-16 04:02:42", identifier: "testproject", status: 1, lft: 5, rgt: 6>, :key=>"268944ce53edddhsjhhgyuh57678dff5f3a0db719323c"}) on line #5 of vendor/plugins/redmine_icalendar_expor

jquery - Colorbox fill all framesets -

i've been looking way solve problem can't seem find it... have following index.html frameset: <html> <head> <script src="js/jquery-1.9.1.js"></script> <script src="js/jquery-ui-1.10.3.custom.min.js"></script> <script type="text/javascript" src="js/jquery.colorbox.js"></script> <link href="js/colorbox.css" rel="stylesheet" type="text/css" media="screen" /> <script> function mycallforcolorboxfunction(html){ alert('done'); $.colorbox({title:'aniversariantes',inline:true, href:"#colorbox_content", width:"600px", height:"500px"}); } </script> </head> <frameset rows="100,70,*" frameborder="1" framespacing="2"> <frame src="cre.html" name="superior" marginwidth="0" frameborder="0" marginheight="

razor - ASP.NET MVC One to Many Database Table Values with List Attribute -

my first table is: first table name: contacts contactid (pk) firstname lastname company second table name: phones contactid (fk) phonetype phonenumber my view model is public class contactvm2 { public int contactid { get; set; } public string firstname { get; set; } public string lastname { get; set; } public string company { get; set; } public string phonetype { get; set; } public string phonenumber { get; set; } } repository class is public class contactrepository { contactsdbentities dbrepo = new contactsdbentities(); public list<contactvm> getallcontacts() { list<contactvm> contactviewlist = new list<contactvm>(); var allcontacts = dbrepo.contacts.tolist(); var allphones = dbrepo.phones.tolist(); foreach (var cont in allcontacts) { foreach (var ph in allphones) { if (cont.contactid == ph.contactid) {

junit - Performant way to check java.lang.Double for equality -

what performant way check double values equality. i understand that double = 0.00023d; double b = 0.00029d; boolean eq = (a == b); is slow. so i'm using double epsilon = 0.00000001d; eq = math.abs(a - b) < epsilon; the problem infinitest complaning tests taking time. it's not big deal (1 sec top), made me curious. additional info a hard coded since it's expected value, b computed by // fyi: current = int, max = int public double getstatus() { double value = 0.0; if (current != 0 && max != 0) value = ((double) current) / max; return value; } update java.lang.double way public boolean equals(object obj) { return (obj instanceof double) && (doubletolongbits(((double)obj).value) == doubletolongbits(value)); } so 1 assume best practice. junit has method of checking double 'equality' given delta: assert.assertequals(0.00023d, 0.00029d, 0.0001d); see this api doc

c# - executing SqlCommand statement and displaying result in a label -

i executing stored procedure , want change instead of returning of results , handling them. want return , display information in third column stored procedure label.text on winforms app. how can go doing that. public ienumerable getguids(int id) { using (sqlcommand _command = new sqlcommand("storedproc")) { _command.connection = new sqlconnection(constring); _command.connection.open(); _command.commandtype = commandtype.storedprocedure; _command.parameters.addwithvalue("@itemid", id); return _command.executereader(); } } i want display items returned in 3rd column stored procedure follows: itemrow1/itemrow2. public ienumerable getguids(int id) { list<string> items = new list<string>(); using (sqlcommand _command = new sqlcommand("storedproc")) { _command.connection = new sqlconnection(constring); _command.connection.open(); _command.comman

To get the latest post and comments of a facebook page -

i want latest post , comments particular page. the below code gets posts , comments of page using graph api explorer: var accesstoken = hdnaccesstoken.value;//page access token var client = new facebookclient(accesstoken); dynamic result = client.get("me", new { fields = "name,id,posts" }); my requirement latest(30 mins example) posts , comments. how can able achieve that? what you'll want try use field expansion . allow limit results number. i'm not sure sdk using, raw request graph api, you'll want similar : https://graph.facebook.com/user_id?fields=id,name,posts.limit(10) this limit number of posts returned last (most recent) 10 results. can test out graph api explorer .

xml quote attribute value in tcl -

how can "convert" non valid xml (i.e. attrbutes not quoted) valid xml, i.e. convert a=b attribute a="b" . for example such xml file: <top> <name name='name' /> <group number=1> <member name='name1' test='test1' l=100/> </group> </top> desire output be: <top> <name name='name' /> <group number="1"> <member name='name1' test='test1' l="100"/> </group> </top>" i know tdom package, has -html option. package should use dom , xml file attribute must quoted. that's not valid xml document, can't use xml processor tdom this. instead, have nasty regular expressions , hope best: set inputdocument "…" regsub -all {(\w+)=(\w+)} $inputdocument {\1="\2"} outputdocument puts $outputdocument this isn't honest, right thing in case. possible put more effort in , ensure transform

android - Split action bar -

Image
i split action bar on activity. looks on galaxy s4 i9500: how looks on 5.5 inch screen: is there way split actionbar on big screens too? please help. got release apk today :/ not without rolling own layouts , end code. splitactionbarwhennarrow intended adapt screen size according whether or not have enough horizontal space. developer doesn't have more control guidance. different behavior deviation default behavior of many other applications' actionbar. personally, advise against , go splitactionbarwhennarrow gives you.

How to make a copy of an array and manipulate its element in ruby -

i have array copy , change element's value. how can (ruby 1.9.3p429) a = array.new(2,"test") #a => ["test","test"] #a.object_id => 21519600 #a[0].object_id => 21519612 b = a.clone #b => ["test","test"] #b.object_id => 22940520 #b[0].object_id => 21519612 c = a.dup #c => ["test","test"] #c.object_id => 22865176 #c[0].object_id => 21519612 d = array.new(a) #d => ["test","test"] #c.object_id => 23179224 #d[0].object_id => 21519612 c[0].upcase! #produces #a => ["test","test"], #b => ["test","test"], #c => ["test","test"] ...` in ruby every object reference object if have array x = [a, b, c, d] and copy array y = x.clone it copy references original objects, not objects themselves. to want have copy objects in loop, you

Notifications for Custom Calendar in Android -

i have custom calendar application integrated our school kiosk application. calendar must allow adding of events , set notification each event. how can 1 store each event , notify on set time , date? can me? here's calendar code. public class mycalendar extends activity implements onclicklistener { public calendar month; public calendaradapter adapter; public handler handler; public arraylist<string> items; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.calendar); month = calendar.getinstance(); items = new arraylist<string>(); adapter = new calendaradapter(this, month); gridview gridview = (gridview) findviewbyid(r.id.gridview); gridview.setadapter(adapter); handler = new handler(); handler.post(calendarupdater); textview title = (textview) findviewbyid(r.id.title); title.settext(a

python - Is there a IPython notebook api? -

i generate several notebooks python script. there api write ipython notebooks? there is, can do: import io ipython.nbformat import current def convert(py_file, ipynb_file): io.open(py_file, 'r', encoding='utf-8') f: notebook = current.reads(f.read(), format='py') io.open(ipynb_file, 'w', encoding='utf-8') f: current.write(notebook, f, format='ipynb') convert('test.py', 'test.ipynb') but it's not smart , place code python file 1 ipython notebook cell. can little bit of parsing. import io import re ipython.nbformat import current def parse_into_cells(py_file): io.open(py_file, 'r', encoding='utf-8') f: data = f.readlines() in_cell = true cell = '' line in data: if line.rstrip() == '': # if blank line occurs i'm out of current cell in_cell = false elif re.match('^\s+',

How to zoom a d3.js DotsChart instead of lineChart -

i want zoom dot chart line each point duplicated zoom step. g.updatecurve = function(_){ // update line path. this.select(".line") .attr("d", line); // add each point this.selectall('.circle').data(data).enter().append("circle") .attr("class", "dot") .attr("cx", function(d) {return xscale (d.date); }) .attr("cy", function(d) {return yscale (d.yspeed); }) .attr("r", function(d) {return rscale (d.xspeed); }); return this; }; how can change proper zoom ? i work on jsfiddle it need costruct dom.circle.data before update fonction: g.selectall('circle').data(data).enter().append("circle") .attr("class", "dot"); and juste update .attr() on zoom event // update attribute of line , dots on zoomevent g.updatecurve = function(){ // update line path. this.select(".line") .attr("

php - "amp;" Precedes $_GET array element (parameter) name -

the below link issue-although ".amp;" (i seeing link not appearing pasted when view question before posting. i'm looking $_get variable name, remove amp; parameter name) index.php?searchresults&searchstring=aliquippa&allwords=off the $_get elements named amp; preceding name expect. example, $_get[amp;allwords'] how variables named. expect $_get['allwords'] format. all links on 'site' built , returned standard class function applies htmlspecialchars final return value. each link constructed class function specific required task , returned through calling standard function. while links returned through same standard function, have 1 link misbehaving. this link first time i've tried taking user input , passing (redirecting?) through $_get parm. it's &'s being doubled up. code not adding second ampersand. as solution, found , tried htmlspecialchars_decode() against post variables. made no difference name assign

javascript - Correct way to match path inside a URL? (8) -

derived javascript, parts, regex matching urls. pseudo code (each number represents sub-expression) /^(1)(2)(3)(4)(5)(6)(7)$/ in 5 spot regex other things. [^?#]* pretty simple, not character class, match except ? or # , these later used match query , fragment identifier. however, want replace character class not use not - ^ the first thing not sure of whether or not unicode can used in path. if can't planning on using ascii character set. clarification: don't want use negative ahead emulates not character set. reference: here complete regex broken different lines each part. /^ (?:([a-za-z]+):)? (\/{0,3}) ([a-za-z0-9.\-]+) (?::(\d+))? (?:\/([^#?]*))? (?:\?([^#]))? (?:#(.*))? $/ the code points allowed ascii alpha numeric , described in url spec . the url code points ascii alphanumeric, "!", "$", "&", "'", "(", ")", "*", "+", ",", "

linux - Unable to install git -

i ran following commands on linux mint 12 lisa: 1). sudo rm -rf /var/lib/apt/lists/* -vf 2). sudo apt-get update 3). sudo apt-get install git i getting following error on running 3. is, installing git: reading package lists... done building dependency tree reading state information... done e: unable locate package git my /etc/apt/sources.list file contains following content: deb http://packages.linuxmint.com/ lisa main upstream import deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ oneiric-updates main restricted universe multiverse deb http://security.ubuntu.com/ubuntu/ oneiric-security main restricted universe multiverse deb http://archive.canonical.com/ubuntu/ oneiric partner deb http://packages.medibuntu.org/ oneiric free non-free # deb http://archive.getdeb.net/ubuntu oneiric-getdeb apps # deb http://archive.getdeb.net/ubuntu oneiric-getdeb games sudo apt-get upgrade shows following:

c# - AdvTree select all nodes programatically -

i trying select nodes on ctrl + on advtree. set allow multiselect. i have event previewkeydown check ctrl, , pressed. i tried this: for each nd node in tvcomputers.nodes nd.setselectedcell(nd.cells(0), nothing) next but selecting last item in tree, doesnt seem add selected list nevermind if found it, thought ill put others see couldn't find anywhere each nd node in tvcomputers.nodes tvcomputers.selectednodes.add(nd) next

f# - CSV Type provider -

i trying find easy example or introduction csv type provider. followed link me started. have visual studio 2012 students edition , while documentation says f# 3.0 has csv type provider not able find it. trying use type provider local csv file. see csv typeprovider mentioned not exist @ all. since given examples don't compile looked around , used load odata services : #r "fsharp.data.typeproviders" ///loading stackoverflow odata type provider type stackoverflow = microsoft.fsharp.data.typeproviders.odataservice<"http://data.stackexchange.com/stackoverflow/atom"> so bit different mentioned in example page above. not able see csv type provider. use visual studio ide list type providers , csv not listed. tried updating packages using nuget , still persists. can point right documentation on how work csv type provider , right updated links simple example found? fsharp.data isn't built-in library, either need use nuget or manually download p

java - String formatter not formatting the whole string -

i'm trying use string formatter not working expected.. when print sql_query , prints table1 , want overall result "select * table1" package mysql.first; public class twoconstructor { public static void main(string[] args) throws exception { final string sql_query = "select * %s ".format("table1"); } } you not calling method in right way : final string sql_query = string.format ("select * %s ","table1"); you should have read warnings in ide. read documentation . note second argument vararg object... args , hence compiled fine.

c - gtk_window_set_resizable sets window to minimum -

i have question this . concern answer. mean call gtk_window_set_default_size (gtk_window(window), width, height); gtk_window_set_resizable (gtk_window(window), false); sets window tiniest one. have idea? thanks. yury try gtk_window_set_geometry_hints set minimum size of window.

javascript - Google Maps API 3 - Info Window Issue -

this question has answer here: google maps js api v3 - simple multiple marker example 11 answers what need add & - make markers popup info window, using var locations txt? <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var map; var brooklyn = new google.maps.latlng(48.1391265, 11.580186300000037); var my_maptype_id = 'custom_style'; function initialize() { var mapoptions = { zoom: 2, center: new google.maps.latlng(48.1391265, 11.580186300000037), disabledefaultui: true, maptypecontrol: true, maptypecontroloptions: { style: google.maps.maptypecontrolstyle.dropdown_menu }, zoomcontrol: true, pancontrol: true, maptypeid: google.maps.maptypeid.roadmap, styles: [ { stylers: [ { hue: "#098aad" } ] } ] }

c# - WPF - MVVM : How to Check/Uncheck all Items in a ListView -

i have following requirements: window show listview multiple items. user should able check (checkbox) item. a) if 1 item, items should unchecked , disabled. b) if checked item unchecked, items should enabled. as of now, have following incomplete code. mainwindow xaml: <window x:class="wpfapplication4.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="520.149" width="732.463"> <window.resources> <resourcedictionary source="mainwindowresource.xaml" /> </window.resources> <grid> <listview x:name="mylistbox" itemtemplate="{staticresource offeringtemplate}"> <listview.itemspanel> <itemspaneltemplate> <uniformgrid columns="3"

ios - Object of array in new ViewController keeps empty -

i've problem array. there's array objects of class car in carviewcontroller: ...car.h @interface car : nsobject @property (nonatomic, strong) nsstring *name; ..and car.m - (void)encodewithcoder:(nscoder *)coder; { [coder encodeobject:name forkey:@"name"]; } - (id)initwithcoder:(nscoder *)coder; { self = [[car alloc] init]; if (self != nil) { name = [coder decodeobjectforkey:@"name"]; } return self; } and carviewcontroller car *car1 = [car new]; car1.name = @"a1"; ... cars = [nsarray arraywithobjects: car1, car2, ..., nil]; but when try have access array in newviewcontroller there problem: - (ibaction)btn:(id)sender { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"storyboard" bundle:nil]; carviewcontroller *vc = (carviewcontroller *)[storyboard instantiateviewcontrollerwithidentifier:@"carvc"]; car *car = [vc.cars objectatindex:0]; nslog(@"%

c# - how to use eager loading without string for related entities? -

i use eager loading load related entities , see this page : in example can see there 2 ways related entities: var princesses1 = context.princesses .include(p => p.unicorns) .tolist(); var princesses1 = context.princesses .include("unicorns") .tolist(); the first way use lambda expression (i think correct name that, if not, correct me), , second way use string name of related entity. in case, can use second, because in firt way, when can't property of related entity in lambda expression. use code: iqueryable<customers> myquery; myquery = mycontext.customers.include("orders"); but if try use second way: iqueryable<customers> myquery; myquery = mycontext.customers.include(c=>c.?????); i can't select orders property. why? add top of file: using system.data.entity; this includes reference dbextensions class

mysql - SQL: how to select a single id that meets multiple criteria from multiple rows -

on mysql database, have table below package_content : id | package_id | content_number | content_name | content_quality 1 99 11 yellow 1 2 99 22 red 5 3 101 11 yellow 5 4 101 33 green 5 5 101 44 black 5 6 120 11 yellow 5 7 120 55 white 5 8 135 66 pink 5 9 135 99 orange 5 10 135 11 yellow 5 and looking possibility make search queries on it: i select package_id content_number 11 and 22 (in case should select package_id 99 i don't know if it's possible in sql since statement and results false. if use statement or package_id 99, 101, 120, 135 , that's not want. m

android - Insert sqlite record if not exists, with a unique constraint -

i have table this: create table students( firstname varchar(64), lastname varchar(64), essay longtext, unique(firstname, lastname) on conflict replace); i want insert record - if exists, want update it: string firstname = "bob"; string lastname = "smith"; string essay = "foo"; contentvalues values = new contentvalues(); values.put("firstname", firstname); values.put("lastname", lastname); values.put("essay", essay); sqlitedatabase db = ...; db.insert("students", null, values); because i'm using "on conflict replace", can rely on insert() method take care of both cases: (1) student entry not exist, insert (2) student entry exists, overwrite it. thanks you must read documentation: the algorithm specified in or clause of insert or update overrides algorithm specified in create table. if no algorithm specified anywhere, abort algorithm used. from sql un

python - pep8 not working in Eclipse -

Image
i want alerted when write python code violates pep8 in eclipse editor. far can see, settings show should running pep8. (below screenshot of pydev settings). have tried: verifying pointing correct location pep8.py changing between error , warning checking , unchecking 'redirect pep8 output console' any suggestions or input on how can pep8 work me in eclipse, i'd appreciate it. i think have actively run pep8 tests when ready - not sure hidden in menus or if there keyboard short cut - try looking under 'tools' in menus. the other possibility may not have pep8 correctly installed indicated - try copying path above command prompt , seeing if runs sample .py file , not error. if doesn't should able install pep8 checker pypi under current python installation , point eclipse it.

SignalR not working when using sql server as backlplane -

i've tried setup following configuration sql server , signalr http://www.asp.net/signalr/overview/performance/scaleout-with-sql-server everything seems setup correctly, if profile sql server can see signalr making calls db, when call hub send message clients connected, message never sent connected browsers. any idea problem? thank @smnbss, saved life comment inside question. make clear in future same problem, here wrong implementation: getting context once like: public class syncservice : isyncservice { private ihubcontext statuschangehub { get; set; } public gatewaysyncservice() { statuschangehub = globalhost.connectionmanager.gethubcontext<hub>(); } public void syncstatuschange(status newstatus) { statuschangehub.clients.all.onstatuschange(newstatus); } } but somehow work while not using backplane. , correct implementation: need context everytime want send message: public class syncservice : isync

javascript - Get the Ul li width and set it to the width of the ul li ul -

any way achievable? think like: if( hover on element ) set child element width element width . but don't know how start it. using jquery: $("#hover_elem").hover(function () { $(this) .children() .first() .width($(this).width()); }); you should start tutorial ( http://www.w3schools.com/jquery/default.asp ) in order learn how use jquery. jquery easier javascript not understand how javascript works - , knowing jquery not means know javascript...

python - Adding numbers in a list and converting it to a dictionary -

i'm sure must simple, i'm python noob, need help. have list looks following way: foo = [['0.125', '0', 'able'], ['', '0.75', 'unable'], ['0', '0', 'dorsal'], ['0', '0', 'ventral'], ['0', '0', 'acroscopic']] notice every word has 1 or 2 numbers it. want substract number 2 number 1 , come dictionary is: word, number. foo this: foo = {'able','0.125'},{'unable', '-0.75'}... it tried doing: bar=[] a,b,c in foo: d=float(a)-float(b) bar.append((c,d)) but got error: valueerror: not convert string float: '' cannot converted string. bar = [] a,b,c in foo: d = float(a or 0) - float(b or 0) bar.append((c,d)) however, not make dictionary. want: bar = {} a,b,c in foo: d = float(a or 0)-float(b or 0) bar[c] = d or shorter way using dictionary comprehensions: bar = {sublist[2

c# - Authetication from a Kerberos authenticated machine to an NTLM server -

i stuck on following scenario: running c# program client has authenticationtype kerberos. want use kerberos credentials authenticate sharepoint server webservice still authenticated ntlm. how can login webservice using ntlm client kerberos credentials? as test program wrote following, adjust program not using constants username, pasword , domain , still function correctly: using system; using system.security.principal; using testsharepointservices.listservice; namespace testsharepointservices { class program { static void main(string[] args) { string username = "myusername"; string password = "mypassword"; string domain = "mydomain"; listssoapclient client = new listssoapclient(); if (client.clientcredentials != null) { console.writeline("name: " + windowsidentity.getcurrent().name); console.writeline("au

android - OnActivityResult is never called -

i have 2 standalone applications. application , application b. want start activity in application b application , results back. in application b there 1 more activity. b second acitivty result b's first activity. want these result application a. onactivityresult in never called. following code. application a: public void onclickbtntoapplicationb(view v) { try { final intent intent = new intent(intent.action_main, null); final componentname cn = new componentname("pakacagename","package.class"); intent.setcomponent(cn); intent.setaction(intent.action_main); intent.addcategory(intent.category_launcher); intent.setflags(intent.flag_activity_new_task); startactivityforresult(intent, request_code); } catch (activitynotfoundexception e) { //handle exception } } public void onactivityresult(int requestcode, int resultcode, i

mysql - What is the best way to implement a server database to be accessed from mobile apps (ios, android)? -

i'm creating mobile app access journal articles. organized volume -> issue -> section -> article. means have 13 * 4 * 10 * 3 = 1560 articles. way implement database host these articles (including images, resources, etc) on web server? each article marked in html. believe nice, because in apps display content in web view. however, i'll need query articles search functions, saving locally device, etc. i'd prefer open source, , i'm new databases (but proficient in app development), i'd appreciate if point me toward best way of learning. i'm not sure if looking advice concerning structure might approach further thinking: create table in write data you have 1 column unique id each article one column each field of volume, issue etc. then have 1 column contains huge string in put html data string. (there might better way concerning search function) you can save blob makes indexing lot harder. i save resources separated database. name th

javascript - Make last hovered menu item stay open -

i have menu when hovered, shows subnav of current hovered item adding .stick submenu , removing on mouseleave. if not hovering on menu item want last hovered menu item stay open 2 seconds before hiding. here's have. know mouseleave() called on container won't work since it's within handlerout of ul#main-nav > li hover function left show last left off. $('ul#main-nav > li').hover(function() { var $this = $(this); cleartimeout(window.menustick); $this.find('ul.submenu').addclass('stick'); }, function() { var $this = $(this); if($this.siblings().hover()) { $this.find('ul.submenu').removeclass('stick'); } else if ($('#main-nav').mouseleave()) { window.menustick = settimeout(function(){ $this.find('ul.submenu').removeclass('stick'); }, 2000); } }); here's jsfiddle. thanks in advance! js: $("ul#main-nav > li&q

oracle10g - Deletes Slow on a Oracle BIG Table -

i have table has around 180 million records , 40 indexes. nightly program, loads data table due business conditions can delete , load data table. nightly program bring new records or updates existing records in table source system.we have limited window i.e 6 hours complete extract source system, perform business transformations , load data target table , ready users consume data in morning. issue facing delete table takes lot of time due 40 indexes on table(an average of 70000 deletes per hour). did digging on internet , see below options a) drop or disable indexes before delete , rebuild indexes: program loads data target table after delete , loading data needs perform quite few updates indexes critical. , rebuild 1 index takes 1.5 hours due enormous amount of data in table. approach not feasible due time takes rebuild indexes , due limited time have data ready users b) use bulk delete: program deletes based on rowid , deletes records 1 one below delete <tab

r - Error trying to read a PDF using readPDF from the tm package -

(windows 7 / r version 3.0.1) below commands , resulting error: > library(tm) > pdf <- readpdf(pdftotextoptions = "-layout") > dat <- pdf(elem = list(uri = "17214.pdf"), language="de", id="id1") error in file(con, "r") : cannot open connection in addition: warning message: in file(con, "r") : cannot open file 'c:\users\raffael\appdata\local\temp \rtmps8uql1\pdfinfo167c2bc159f8': no such file or directory how solve issue? edit i (as suggested ben , described here ) i downloaded xpdf copied 32bit version c:\program files (x86)\xpdf32 , 64bit version c:\program files\xpdf64 the environment variables pdfinfo , pdftotext referring respective executables either 32bit (tested r 32bit) or 64bit (tested r 64bit) edit ii one confusing observation starting fresh session (tm not loaded) last command alone produce error: > dat <- pdf(elem = list(uri = "17214.pdf&quo

google cloud messaging - Does GCM need a Phonenumber? -

hi i'm creating gcm application on normal galaxy s4 works, on dev phone (galaxy s1, 2.3.3, without sim, own google account) keep getting error java.io.ioexception: service_not_available @ com.google.android.gms.gcm.googlecloudmessaging.register(unknown source) my register code if (gcm == null) { gcm = googlecloudmessaging.getinstance(context); } regid = gcm.register(sender_id); any hints why? gcm not need phone no. not require have sim installed in device. it requires internet connection, google account setup in phone, google play store present , should linked same google account.

c - Is my method of passing a struct as both value and reference correct? -

i have looked @ examples of passing struct both value , reference. code compiles not working should. using c program micro-controller hard check if working properly, not getting desired output. so, per instructions, first define structure: struct package //define structure type called package. { unsigned char wavtype,startfreq1,startfreq2,startfreq3,startfreq4, stopfreq1,stopfreq2, stopfreq3,stopfreq4,step,dura,amp,sett; //define bytes use }; in main method create instance of it: struct package p; //create new instance of package now pass reference (pointer - because i'm using c) function: getpackage(&p); within function getpackage() update values of respective elements of p: getpackage(struct package *p) //get data package { p->wavtype = receive(); p->startfreq1 = receive(); p->startfreq2 = receive(); p->startfreq3 = receive(); p->startfreq4 = receive(); p->stopfreq1 = receive(); p->st

windows phone 8 - c# click on button and copy a default image -

this first time making app windows , working c#. i wondering how can make button copies image specific button? (think emoticons) i building app sending pictures sms or chat. when user clicks on picture (button) want button's picture copied use in sms or chat. hope guys can me! you wont able send image inside sms. chat you'll need create special socket program accept binary data during chat (e.g. whatsapp). however, can create email , attach image mail message. let me know if answered question correctly.

ios - Accessing Deployment Target in unit test code -

Image
i need know deployment target in unit test cases. there way ios deployment target programmatically (using objective-c)? displays 'big' int: nslog(@"deployment target: %i", __iphone_os_version_min_required); e.g. ios 5.1 deployment target deployment target: 50100

spark RDD (Resilient Distributed Dataset) can be updated? -

rdd can updated? --- i.e. suppose created rdd "a.txt" file. "a.txt" got updated. possible update rdd without reading entire file a.txt? rdd immutable definition hence want able change rdd when "a.txt" file changes.

php - How do I Create a Custom Template File in Wordpress? -

i'm new wordpress , php gentle. i've searched wordpress documentation can't find answer this. i need create section of html (and/or php) use in multiple page templates. i'm not sure called, want act same built-in wordpress template files header, sidebar, footer etc... to clear, different creating own custom page template. the usage this: // index.php <?php get_header(); ?> // index page content <?php get_customrecentcontentsection(); ?> // more index page content <?php get_footer(); ?> // customrecentcontentsection.php <div> // wordpress post query html php </div> i use <?php get_customrecentcontentsection(); ?> @ end of post template or anywhere else see fit. currently, have duplicate code in index.php , post.php i'm trying rid of. any appreciated. thanks! first of all, to use function need create function in template's functions.php page. then can create new .php file inside theme, maybe in

javascript - Chrome extension: Insert fixed div as UI -

i want insert div fixed position using chrome extension. overlay page viewing. concern want work on page without altering (other inserting fixed div), don't know if possible way i'm doing it. currently, button won't show up, , had lot of trouble getting div show up. way, positioning temp now, position correctly once on page! :) here's have: here manifest: { "name":"poop", "version":"0.1", "manifest_version":2, "description":"shitty app i'm making", "background":{ "scripts":[ "scripts/modernizr.min.js", "scripts/background.js" ], "persistent": false }, "permissions":[ "contextmenus", "tabs", "http://*/*", "https://*/*" ], "icons":{ "16":&quo