Posts

Showing posts from July, 2010

json - C# IgnoreDataMember attribute sets database field to null, how do I overcome this? -

i have built web api usual rest methods. i have field in database tracking when record inserted (called insertlogtime. works fine. my classes generated automatically ef6 using database first. i don't want serialised added [ignoredatamember] attribute field using standard partial metadata classes... [metadatatype(typeof(membersmetadata))] public partial class members { } public class membersmetadata { [databasegenerated(databasegeneratedoption.none)] public int id { get; set; } [ignoredatamember] public nullable<datetime> insertlogtime { get; set; } } now when use fiddler put data other fields, insertlogtime field set null. more importantly, don't want show every field put. customer needs use id , single other field. however, need provide full dataset (without insertlogtime) when doing full post. { "id":99, "firstname":"jack spratt", "email":"someone@somewhere.com", "eligible":f

ios - iOS8 change UIPopoverPresentationController trait collection -

i'm deploying application on both iphone , ipad (ios7 , ios8). i'm using storyboard size classes, have base size classes any-any fits ipad layout , compact-regular fits iphone models. view controllers in ipad version presented custom slide in/out segue, others popovers. while works on ios7 ipad (since xcode build different storyboards) on ios8 have problem shown in popover picks iphone interface. present in usual way: if (uipopoverpresentationcontroller.self) { commentvc.modalpresentationstyle = uimodalpresentationpopover; uipopoverpresentationcontroller * presentationcontroller = commentvc.popoverpresentationcontroller; presentationcontroller.sourcerect = [[(afposttimelinetableviewcell*)cell commentbutton] frame]; presentationcontroller.sourceview = cell; presentationcontroller.permittedarrowdirections = uipopoverarrowdirectionany; presentationcontr

python - merge and split synonym word list -

(i trying update hunspell spelling dictionary) synonym file looks this... mylist=""" specimen|3 sample prototype example sample|3 prototype example specimen prototype|3 example specimen sample example|3 specimen sample prototype protoype|1 illustration """ the first step merge duplicate words. in example mentioned above, word "prototype" repeated. need club together. count change 3 4 because "illustration" synonym added. specimen|3 sample prototype example sample|3 prototype example specimen prototype|4 example specimen sample illustration example|3 specimen sample prototype the second step more complicated. not enough merge duplicates. added word should reflected linked words. in case need search "prototype" in synonym list , if found, "illustration" word should added. final list of words this... specimen|4 sample prototype example illustration sample|4 prototype example specimen illustration proto

ios - How to change the background color with Sprite Kit -

i'm trying make game sprite kit in swift have little problem background color. i started new project on xcode , selected "game" presets , sprite kit. have starter project grey background "hello world" in white , spaceships appear when press on screen. so removed code don't care when launch game, still have grey background, if try change in gamescene.swift file. here files: appdelegate.swift import uikit @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { var window: uiwindow? func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. return true } func applicationwillresignactive(application: uiapplication) { // sent when application move active inactive state. can occur types of temporary interruptions (such incoming phone call or sms message) or when user quits application , be

php - Google calendar events do not show with approval prompt("auto") -

i listing google events in own calendar. worked fine, until changed approval_prompt auto force . not need refresh token every time user logs in (correct me if i'm wrong, i'm new google api). another strange thing can still create, update, delete events. not list google calendar events. here code: login.php $client = new google_client(); $client->setclientid($client_id); $client->setclientsecret($client_secret); $client->setredirecturi($redirect_uri); $client->setscopes(array( 'email', 'https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/plus.me' )); $client->setapprovalprompt('auto'); $client->setaccesstype("offline"); calendar.php: var events = []; <?php foreach ($results->getitems() $event) { $now = new datetime(); $unformatted_start = new datetime($event->start->datetime); $start = $event->star

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

what undefined reference/unresolved external symbol errors? common causes , how fix/prevent them? feel free edit/add own. compiling c++ program takes place in several steps, specified 2.2 (credits keith thompson reference) : the precedence among syntax rules of translation specified following phases [see footnote] . physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed. [snip] each source character set member in character literal or string literal, e

html - php link not found error -

i started getting error on site : the requested url /ilanlar.php not found on server. although link correct , have set path , correctly, link try access follows : http://domain.com/%ef%bb%bfilanlar.php?il=34&ilce=34.35&mah17050&path=2 here surprising thing is, have link defined as: <a href='http://domain.com/ilanlar.php?il=34&ilce=34.35&mah17050&path=2'>clicky</a> but %ef%bb%bf part being added automatically on own, missing here? change file encoding utf8 , delete link , type again. don't copy/paste it. type it.

c++ - Copying value of char pointer array to char array -

this simple game , trying learn how apply c++ in existing project (that's how learn best), have experience programming in c# , other high level languages quite new me still. have list of races: const char* races[] = { "demon", "human", "elf", "orc", "aliens" }; at 1 point receive registration of user , race selected. save away information of user struct , want save full name of race struct well. struct user_t { unsigned int raceid; char race[16]; }; the following code got put values inside struct: user_t user; user.raceid = 3; strcpy(user.race, races[user.raceid]); this, however, not work. part of game , exception handling horrible (it crashes game without error visible). trying figure out doing wrong. suggestions, perhaps suggestions on other things well? assuming scope of races array global can avoid copying , this: struct user_t { unsigned int raceid; const char* race; }; u

material design - Sections Framework Materialize -

in frameworks can develop throughout app in single page . i drew app using appframework.js intel , want migrate materialize , researched enough in documentation , have not found way make layout several pages in single html file. just saw ways invoking other external html files , creating other pages . does know that? can pass me layout or indicate can find information? it offers layout material design well. you can use angularjs inject pages main template. not cause page load again. you can read more here: https://scotch.io/tutorials/single-page-apps-with-angularjs-routing-and-templating

c - Replacing some characters in a string with characters stored in an array inserts garbage -

i have been trying replace characters in string characters stored in arrays: char encode_table[122]; char decode_table[122]; ... int main() { memset(encode_table, 0, 122); memset(decode_table, 0, 122); ... to populate table, use file in format a b c d where maps b, c maps d, etc. store mappings in array, using indices ascii values of mapped characters. encode_table[97] // asking mapping of 'a'. returns 'b' after map characters, parse file, line line. each line processed function supposed replace characters must replaced , leaves alone rest. void display(char * filename){ char buffer[255]; file * file = fopen(filename, "r"); ... while(fgets(buffer, sizeof(buffer), file){ display_line(buffer); } } void display_line(char * line){ char c; char c_r; char format_str[255]; if(encode || decode){ for(int = 0; < strlen(line); i++){ c = line[i]; c_r = (encode

.net - Microsoft.ApplicationInsights.Log4NetAppender -

i'm getting silent error when trying create log4netappender, stops logging working. could not load type 'microsoft.applicationinsights.telemetryconfiguration' assembly 'microsoft.applicationinsights, version=1.1.0.1899, culture=neutral, publickeytoken=31bf3856ad364e35'. @ microsoft.applicationinsights.tracing.tracer..ctor(string instrumentationkey) @ microsoft.applicationinsights.log4netappender.applicationinsightsappender.activateoptions() at log4net.repository.hierarchy.xmlhierarchyconfigurator.parseappender(xmlelement appenderelement) from can see, log provider trying create class microsoft.applicationinsights.telemetryconfiguration wrong namespace , class exists in microsoft.applicationinsights.extensibility.telemetryconfiguration. we using following libraries microsoft.applicationinsights - 1.1.0.1899 microsoft.applicationinsights.log4netappender - 0.10.0.0 they both latest versions, i'm not sure why aren't

python - what is wrong with my script, export psd to bmp? -

i trying export psd file bmp. if del zhe line ###here, generator test.png correctly, want bmp file, if use ###here , "attributeerror: property 'photoshop.bmpsaveoptions.format' can not set." import win32com.client import os fn='test.psd' psapp = win32com.client.dispatch('photoshop.application') options = win32com.client.dispatch('photoshop.exportoptionssaveforweb') options.format = 13 # png options.png8 = false # sets png-24 bit #options = win32com.client.dispatch('photoshop.bmpsaveoptions') ###here del #options.format = 2 # bmp # fd=os.path.abspath('.') fk=os.path.join(fd, fn) doc = psapp.open(fk) fn='bbb' fn = os.path.splitext(fk)[0] + '_' + fn + '.png' #fn = os.path.splitext(fk)[0] + '_' + fn + '.bmp' ### doc.export(exportin=fn, exportas=2, options=options) #exportas=2, doc.close(2) if reading question (apoligies if not) want save file in

Replace text inside an array in PHP -

i have array in php $aresults full thousands of urls looks this: array ( [0] => http://test.com/server1/image?img=nortel.jpg ) array ( [1] => http://test.com/server1/image?img=network.jpg ) i need replace text inside each url , replace server server1 server5 , word image photo each url should this: http://test.com/server5/photo?img= how accomplish this? i have tried variation of str_replace functions cannot work: $simgurl = $aresults[1][0]; $filter_url ='server1/image'; $replace='server5/photo'; $filtered_url = str_replace($filter_url, $replace, $aresults); print_r($aresults); what best way accomplish this? thanks for ($i = 0; $i <= sizeof($aresults); $i++) { $aresults[$i] = str_replace('server1/image', 'server5/photo', $aresults[$i]); }

xcode6 - Changing text size in xcode version 6.3 -

Image
it common knowing changing font/text in xcode. found difficult me in version 6.3. please? if trying xcode editor here . as mention drdiv in post how increase font size in xcode editor? easisest solution: close open projects. xcode > preferences > font & colors make sure press cmd + a select possible text types. change font size picker. note:- of if want change fornt , size of other uicontrol or etc please explain question in detail.

ios - Xcode how do I duplicate a View Controller? I've had this complication for days -

Image
how duplicate view controllers, don't have re-place menu screen in ui, because stays constant throughout each screen. somebody told me copy this: however 'view controller scene' not in project navigator... so told me: "you have right click in project navigator , create new file. select "cocoa touch class" , create subclass of uiviewcontroller." i did that, gives me code files, not 'view controller scene' in can copy 'view controller' in order have 2 of same on storyboard. i using objective c, , have had problem days, can please me out? in first photo, have "view controller" highlighted, click on left arrow open view hierarchy. select view comprises menu , hit command + d or edit > duplicate. this create duplicate version of menu in same viewcontroller. grab duplicated copy , move other scene want in storyboard edit: you're looking @ wrong menu. click on main.storyboard , in bottom left of stor

java - How to update a swing component at a certain hour everyday? -

i want accomplish behavior in application running during whole week. have methods repaint , re validate information i'm displaying, , call repainting routines when user presses button, how can make these operations execute automatically @ time everyday application can stay unattended in meanwhile? but how can make these operations execute automatically @ time everyday with javax.swing.timer should able want. the timer swing package has been designed work event-dispatching thread , reduce needed resources.

sql - Create view based on three tables with columns as rows in one of tables -

i'm starting learn sql, learning views. wondering if possible join 3 tables in 1 view, columns based on rows of these tables. i have 3 tables: roles: id | name | permissionid 1 | admin | 1 2 | staff | 2 rolepermissions: id | roleid | permissionid 1 | 1 | 1 2 | 1 | 2 3 | 1 | 3 4 | 2 | 1 5 | 2 | 2 <- staff doesn't have permission 3 permissions: id | name 1 | perm1 2 | perm2 3 | perm3 . . (not fixed number of permissions) i create view this: id (of role) | name | perm1 | perm2 | perm3 ... (not fixed number of columns) 1 | admin | true | true | true 2 | staff | true | true | false is possible? you cannot use view if don't know how many columns output. code below should in right direction. use in procedure dynamic sql if need dynamically build list of columns ; roles(id, name, permissionid) ( select * (values(1, 'admin', '1'), (2, 'staff', '2&#

php - How does Yii timestamps work? -

yii says can automatically set timestamps 'created_at': http://www.yiiframework.com/doc-2.0/guide-concept-behaviors.html#using-timestampbehavior however, every time created record, time blank: $ yii kw/test 1437683634 mysql> select * ad_group_keyword_network ad_group_keyword_id = 1; +---------------------+- | created_at | +---------------------+- | 0000-00-00 00:00:00 | | 0000-00-00 00:00:00 | +---------------------+- public function actiontest() { $agkn = new adgroupkeywordnetwork(); $agkn->save(); echo $agkn->created_at; i tried schema::type_timestamp , changed field , tried schema::type_datetime . both return integer timestamp in field after save, time 0s in database. public function behaviors() { return [ [ 'class' => timestampbehavior::classname(), 'attributes' => [ activerecord::event_before_insert => ['created_at'], active

json - Passing Applescript list to javascript ExtendScript as array for Indesign -

background i have load of applescripts(as) designers use indesign process workflow production. there great deal of os interaction javascript can not, moving away not possible. due restrictions unable install pretty anything . unable update anything. script editor , extendscript tool kit have work with. operating environment: os x 10.8.5 & adobe cs6 how works user preferences saved properties in local applescripts saved in user's documents folder. ###property grabber.scpt set mypath path documents folder set mypropertiesfile ((mypath & "myproperties.scpt") string) set thepropertyscript load script file mypropertiesfile set designerinitials (designerinitials of thepropertyscript) etc... some of properties lists. why need js? i'm making palettes , prefer use scriptui rather in this: set dlgref make dialog properties {name:"user settings", can cancel:true, label:"dialog label"} the string hands

php - PHPExcel: No default style found for this workbook -

i'm trying convert xlsx pdf phpexcel+dompdf , exception: "no default style found workbook". here's stack trace: warning: invalid argument supplied foreach() in /var/www/clients/client46/web339/web/phpexcel/classes/phpexcel/reader/excel2007.php on line 365 warning: invalid argument supplied foreach() in /var/www/clients/client46/web339/web/phpexcel/classes/phpexcel/reader/excel2007.php on line 402 warning: invalid argument supplied foreach() in /var/www/clients/client46/web339/web/phpexcel/classes/phpexcel/reader/excel2007.php on line 1715 fatal error: uncaught exception 'phpexcel_exception' message 'no default style found workbook' in /var/www/clients/client46/web339/web/phpexcel/classes/phpexcel.php:930 stack trace: #0 /var/www/clients/client46/web339/web/phpexcel/classes/phpexcel/writer/html.php(142): phpexcel->getdefaultstyle() #1 i've tried tcpdf, keep getting error well.

How to make full backup of Sharepoint Online? -

is there way make full backup of sharepoint online web site based on office 365 without third-party tools? tried google it, found ways manually backup list or libraries. i'm need save user properties, permissions, webparts, etc. help! since sharepoint online, won't able perform full-backup you'd able backup-spsite. however, can save site template. if publishing feature enabled site, you'll need enable saving website template via sharepoint designer. under "site" tab, select “site options”, find "savesiteastemplateenabled" , set "true". add site's url: /_layouts/15/savetmpl.aspx fill out , submit form. in experience, should take 10 minutes, or working on screen might never change. if later happens, can check solution on page: /_catalogs/solutions/forms/allitems.aspx this option might not work if site on 50mb, might need forgo checking option allows including list content in backup.

Ubuntu Gnome 3.14 GTK+ theme locations -

where theme ( css and/or xml ) files stored contain default themes of mutter ( window manager ) on gnome 3.14? i.e.: there numix theme, installed default, cannot find files fetches. i think want: /usr/share/themes/ comment update: /usr/share/themes/numix/gtk-3.0/ there 2 files depends on use: gtk.css , gtk-dark.css if want change bg color (for example) have modify following row: @define-color bg_color #2d2d2d;

MySQL Java getting objects by a distinct field -

i need return java objects database distinct field. in database have country , state , city . have 2 records have same data in fields, want return distinct states in country. to clarify - have 2 records same country , state. want return 1 state instead of washington twice example. however, need object opposed returning string of washington. my query: select distinct r roster r r.state = :state , r.country = :country what happening return duplicates because objects not distinct, want 1 of each? i apologise if not clear. any appreciated! edit: need objects because using them populate results table. edit2: create table: create table `roster` ( `id` int(10) unsigned not null auto_increment, `country` varchar(45) not null, `state` varchar(45) not null, `city` varchar(45) default null, `clientname` varchar(45) not null, `tdomain` varchar(45) not null, `tsubdomain` varchar(45) default null, `treferenceid` varchar(45) default null, `startdate` date def

windows - RStudio takes too much memory -

on pc open rstudio takes enormous amount of memory. how can fix it? i using windows 7 machine 8 gb or ram, not expandable. have 64 bit machine. i re-installed rstudio after noticed problem. when @ task manager says rstudio.exe *32 using 137 mb of memory , rsession.exe using on 2 gb or memory. @ point have not done other open rstudio. ideas? when open rgui 3.1.2, task manager says using 38 mb of memory. when open rstudio on laptop, following. rstudio.exe*32 74 mb. rsession.exe 33 mb. on laptop if open rgui, following. 32 bit r¨20 mb 64 bit r: 29 mb i not know if related, if open large number of tabs on firefox, large amount of memory eaten , not returned until close down firefox. on desktop right after booting using 28% of 8 gb of physical memory , running 121 processes. on laptop after booting up, using 38% of 4 gb of memory , running 68 processes.

html - How to pass link name in javascript? -

in code below need pass link name inorder process in javascript. don't know how pass link name in javascript. tries passing this.value, this.innerhtml no luck. please can this. <li><a href="#tab6" onclick="hideupdatebutton(this)">images</a></li> try this function hideupdatebutton(el) { console.log(el.innerhtml); } <ul> <li><a href="#tab6" onclick="hideupdatebutton(this)">images</a></li> </ul> or can pass text, function hideupdatebutton(name) { console.log(name); } <ul> <li><a href="#tab6" onclick="hideupdatebutton(this.innerhtml)">images</a></li> </ul>

android - getExternalFilesdir Fail -

onactivitycreated i'm doing: activity.getexternalfilesdir(environment.directory_pictures); in logcat get: com.package w/contextimpl﹕ failed ensure directory: /storage/sdcard1/android/data/com.package/files/pictures this happens on lollipop (moto g 2014), , fine on kitkat (nexus 4). i've write_external_storage on manifest. missing here? storage mounted , reachable via file browsing app (like es explorer). edit: surprisingly file correctly created under directory if warning reported above. try : string path = environment.getexternalstoragepublicdirectory(environment.directory_pictures); and use permission: <uses-permission android:name="android.permission.read_external_storage" /> actually: getexternalfilesdir() it returns path files folder inside /android/data/com.package/files/pictures on sd card. , there no folder named pictures inside it. getting error.

angularjs - Best way to get values using ngFormController -

this can't correct, perhaps google has gone off rails life of me can't find documentation return $valid = true values using formcontroller. functionality exist? i'm trying marshall information form , send web service wan't make sensible before doing so. i'm looping through properties in formcontroller given form , looking see if doesn't start $, , $valid = true , pushing array so: angular.foreach(form,function(data,key) { if(key.indexof('$') === -1 && data.$valid) { var item[key] = data.$modelvalue; clean.push(item); } }) real basic, i'm totally stumped (and can't believe) doesn't exist in angular api somewhere. missing something? i'm still learning lot angular , getting feeling isn't documented perhaps i'm missing quite basic. reading! this not ngformcontroller used (for validation , custom directive scri

Maintain image quality in iOS Application -

i trying create photo application having tough time formatting photos show clearly. i have imageview size 320 * 500, , image size 3648*2736 px (which of course can scale down). imageview.contentmode=uiviewcontentmodescaleaspectfit; with imageview.contentmode=uiviewcontentmodescaleaspectfit; changed image size 700* 525px (imga) , 1 500 * 325(imgb). in mode imga fills entire image view somehow little distorted/not crisp imgb not fill entire image view top , bottom width perfect , image crisp. uiviewcontentmodescaleaspectfill uiviewcontentmodescaleaspectfill image made fit uiimageview again distorted if image scaled down vs being scaled up. i see many apps crisp large images . , hoping helps me measuring/ contentmode images better. or correct resizing p.s have been looking @ link try i'm still missing goal. difference between uiviewcontentmodescaleaspectfit , uiviewcontentmodescaletofill?

php - Laravel Eloquent, select only rows where the relation exists -

i trying select table, want select things have existing relationship. for example, if have users , comments, , users havemany comments, want like: user::hascomments()->paginate(20); so, want select users have @ least 1 comment, , paginate result of query. there way this? according laravel's eloquent documentation "querying relations when selecting", should work: user::has('comments')->paginate(20);

javascript - Sorting array in angular doesn't work -

i have following structure: array( array('id' => 1, 'name' => 'aaa', 'thumbnailurl' => 'some1'), array('id' => 2, 'name' => 'ccc', 'thumbnailurl' => 'some2'), array('id' => 3, 'name' => 'bbb', 'thumbnailurl' => 'some3') ) and display this: <div ng-controller="creationcontroller"> <input type="radio" name="sortby" id="id" ng-click="reverse=false;order('id',reverse)"><label for="id">id</label> <input type="radio" name="sortby" id="name" ng-click="reverse=false;order('name',reverse)"><label for="name">name</label> <div class="creations accordion" ng-repeat="creation in creations"> <h3> {if !empty("[[cre

Git pull/push history: Does Git save information who did a pull or push operation? -

if user pulls in changes master in branch b , possible without merge (no conflicts), there possibility see did pull in git history (or possibly other git metadata)? assuming pull pushed corresponding branch on central git repository. there "push" history in git? no, information not automatically recorded anywhere. need have gitlab or github , handles (among others) authentication/authorization , able log kind of information.

ruby create sub arrays if element includes same letter -

i have array this: ["b3", "a3", "a5", "b2"] and need this: [["b3", "b2"] ["a3", "a5"]] i have tried various things including: ["b3", "a3", "a5", "b2"].map { |i| i.include? 'a' } # => returns [false, true, true, false] ["b3", "a3", "a5", "b2"].detect { |i| i.include? 'a' } # returns "a3" is there simple way done? thanks a = ["b3", "a3", "a5", "b2"] a.group_by { |s| s[0] }.values #=> [["b3", "b2"], ["a3", "a5"]] enumerable#group_by produces: h = a.group_by { |s| s[0] } #=> {"b"=>["b3", "b2"], "a"=>["a3", "a5"]} and use hash#values extract values: h.values #=> [["b3", "b2"], ["a3&qu

c# - (Pause) Stop download without dropping connection -

i want able pause download. can stop them dropping existing connections. what i'm referring similar what's described here: https://superuser.com/questions/170509/whats-the-difference-in-using-pause-stop-in-%c2%b5torrent my download class: public class download { public event eventhandler<downloadstatuschangedeventargs> downloadstatuschanged; public event eventhandler<downloadprogresschangedeventargs> downloadprogresschanged; public event eventhandler downloadcompleted; public bool stop = true; // default stop true public void downloadfile(string downloadlink, string path) { stop = false; // set bool false, everytime method called long existinglength = 0; filestream savefilestream; if (file.exists(path)) { fileinfo fileinfo = new fileinfo(path); existinglength = fileinfo.length; } if (existinglength > 0) savefilestream = new filestream

java - Selenium WebDriver on IE11 always has "--port=" in URL -

i trying run automated tests on ie11 using selenium webdriver. whenever run code url ie tries load http://--port=38198/ i trying load google , return title, move onto actual automated testing intend do. here sample of code far; private webdriver driver; private string baseurl; @before public void setup() throws exception{ system.setproperty("webdriver.ie.driver", "c:\\program files\\internet explorer\\iexplore.exe"); desiredcapabilities cap = desiredcapabilities.internetexplorer(); cap.setcapability(capabilitytype.forseleniumserver.ensuring_clean_session, true); baseurl = "http//www.google.com"; driver = new internetexplorerdriver(cap); driver.manage().deleteallcookies(); driver.manage().timeouts().implicitlywait(30, timeunit.seconds); } @test public void test() throws exception{ driver.get(baseurl); system.out.println(driver.gettitle()); //driver.navigate().to(baseurl); } ever time run code opens same u

hadoop - migrate hbase 0.94 to 0.98 - Incompatible Result object for TableMapReduceUtil -

i using following api org.apache.hadoop.hbase.mapreduce.tablemapreduceutil hadoop 1 , hbase 0.94 public static void inittablemapperjob(list<scan> scans, class<? extends tablemapper> mapper, class<? extends writablecomparable> outputkeyclass, class<? extends writable> outputvalueclass, job job) throws ioexception { inittablemapperjob(scans, mapper, outputkeyclass, outputvalueclass, job, true); } tablemapreduceutil.inittablemapperjob(scans, stage1mapper.class, immutablebyteswritable.class, result.class, job); now it's giving me compile error hadoop 2 , hbase 0.98 . think it's hbase 0.98 has issue. error is: the method inittablemapperjob(list<scan>, class<? extends tablemapper>, class<? extends writablecomparable>, class<? extends writable>, job) in type tablemapreduceutil not applicable arguments (list<scan>, class<planstage1mapper>, class<immutablebyteswritable>, class&l

ruby on rails - jquery datepicker is not working while reset the value of datepicker -

i have included following code in test.js var refreshrange = function () { var tab = $("select[id^='select']").parents("div[id$='_tab']"), currentdateselect = tab.find("select[id^='select'] option:selected") if (currentdateselect.val() != 'range') { $("input[name^='start_date']").val('');; $("input[name^='end_date']").val('');; } } and in test.js.erb have called this refreshrange(); now case when select range 02-02-2015 02-03-2015 , when again go range , select start_date @ time allows me select start_range 02-03-2015 not current date , end_date working fine. please guide me how solve this.

javascript - "Page Not Found" Error When Adding a Second <ons-template> tag -

i'm brand new onsen ui , i'm busy working <ons-navigator> : <body ng-controller="appcontroller"> <!-- cordova reference --> <script src="cordova.js"></script> <script src="scripts/index.js"></script> <!-- --> <ons-navigator title="navigator" var="mynavigator"> <!-- login screen --> <ons-page> <div class="login-form" ng-controller="logincontroller"> <input type="text" class="text-input--underbar" placeholder="membership number" value="" ng-model="membershipno"> <input type="password" class="text-input--underbar" placeholder="password" value="" ng-model="password"> <br><br> <ons-button modifier="large" class="lo

codeigniter - php Use of undefined constant zip - assumed 'zip' -

this question has answer here: what php error message “notice: use of undefined constant” mean? 8 answers sorry i'm new php , i'm getting error when trying use argument function. doing wrong? public function legislatorsbyzip($zip = null) { $url = "..."; $params = [ zip => $zip, ]; $data= $this->curl->simple_get($url, $params); return $data; } error: a php error encountered severity: notice message: use of undefined constant zip - assumed 'zip' filename: models/congressapi.php line number: 11 (zip=> $zip line 11 btw) please let me know if need more info.. use "zip" instead of zip , assoc. array should have keys strings or int , words without $ sign constants $params = [zip => $zip]; change into $params = ["zip" => $zi

Outlook 2010 VBA Save Message as MSG Will Not Work as Script -

i trying script inside outlook rule automatically save e-mail messages file server when received user/domain. i found following vba script on site , works if manually run it, not work inside outlook rule says use script. sub savemessageasmsg() dim omail outlook.mailitem dim objitem object dim spath string dim dtdate date dim sname string dim enviro string enviro = cstr(environ("userprofile")) each objitem in activeexplorer.selection if objitem.messageclass = "ipm.note" set omail = objitem sname = omail.subject replacecharsforfilename sname, "-" dtdate = omail.receivedtime sname = sname & ".msg" spath = enviro & "\desktop\allied e-file\" debug.print spath & sname omail.saveas spath & sname, olmsg end if next end sub private sub replacecharsforfilename(sname string, _ schr string _ ) sname = replace(sname, "'", schr) sname = replace(sname, &

R: Levels/Labels for ordinal variables and the boxplot function -

i used have ordinal data plain numbers in data frame (i.e. 1-3). worked out fine, had remember numbers stood (in case: 1=low, 2=medium, 3=high). to make things easier me trying r display names/labels instead of 1-3 in generic fashion, i.e. regardless of whether using tables, boxplots, etc. however, can't work. i tried data$var <- ordered(data$var, levels = c(1, 2, 3), labels = c("low", "medium", "high")) after this, a boxplot(data$var) does not work anymore. why not? the command didn't work because boxplot expecting first argument (the x argument), numeric. if you're looking simple solution, plot data integers (as factors ordered, therefore in right integer order) suppress original axes , add new 1 right axis labels. boxplot(as.integer(data$var), yaxt = "n") axis(2, @ = c(1, 2, 3), labels = c("low", "medium", "high"))

mysql - Select distinct column value from date range -

i created sqlfiddle outlines i'm trying do: http://sqlfiddle.com/#!9/41f3c/2 basically, need search unique posts in table contains meta information. meta in instance series of dates represent exclusions (think of booking system hotel). i pass in start , end date. want find post_id not contain date falls in range. i'm close, can't quite figure out. select distinct post_id wp_facetwp_index facet_name = 'date_range' , facet_value not between '$start_date' , '$end_date' this works if excluded dates in table in range, if out of range, still post_id. thanks looking. do not forget, in sql, filters (where clause, etc.) applied on record basis. each record evaluated independantly others. so, since (1, 511, 'date_range', 'cf/excluded_dates', '2015-07-31', '2015-07-31') validates condition, 511 returned. since post_id not unique, need proceed exclusion on sets, opposed exclusion on records you&

r - sqlSave pads numeric/integer with space -

i have data trying upload table in database. example: df <- data.frame(name = c("fred", "george", "david"), data = c(10, 100, 1000)) when using rodbc::sqlsave function (with fast = false insert 1 row @ time) however, padding numeric or integer values spaces. in database, entries under data column " 10", " 100", "1000" . example, if upload above dataframe , query data using following tmp = rodbc::sqlquery(ch, query = "select * my_tbl") then output this: > str(tmp) 'data.frame': 3 obs. of 2 variables: $ name : chr "fred" "george" "david" $ data : chr " 10" " 100" "1000" the database data type data column of type varchar(10) data have leading letter. in case working however, there numbers involved. my question why sqlsave function padding numeric data , there can stop doing so? note: know sqlsave function causing is

angularjs - Meteor.users subscribe only return current user -

i'm trying user username, when use meteor.users.findone , return current user. , if user meteor.users.find , returns current user document, , profile.firstname , profile.lastname of right matched username. meteor.publish('userbyusername', function(username) { return meteor.users.findone({ username: username }, { fields: { 'profile.firstname': 1, 'profile.lastname': 1, } }); }); how can user match username? i think want not publish, method access particular username. publish/subscribe great datasets change - posts on stackoverflow, facebook feed, news articles, etc. you looking first/last name of particular user, not change. want create server method returns first/last name of user. , can call method client access data. if (meteor.isclient) { //get username var meteor.call('finduser', username, function(err, res) { console.log(res.profile.firstname + " &qu

javascript - Form with Table, submit all values to IEnumerable Controller action -

i have form data listed in table structure @model ienumerable<mytype> @html.antiforgerytoken() @using (ajax.beginform("save", "noc", null, ajaxopts, new { @enctype = "multipart/form-data", @id = "myform", @name = "myform" })) { <table> <tr> <td><input type="hidden" name="mytype[0].id" id="mytype[0].id" value="16" /></td> <td><input type="text" name="mytype[0].name" id="mytype[0].name" value="jim" /></td> <td><input type="checkbox" name="mytype[0].selected" id="mytype[0].selected" checked /></td> </tr> <tr> <td><input type="hidden" name="mytype[1].id" id="mytype[1].id" value="17" /></td> <td><input type="text" name="mytype[1].name" id="mytype[1].name

php - Datetime as arrays and convert dateformat and insert into database -

i'm importing data csv file database through html form, having multiple datetime in format 23/06/2015 12:00 convert 2015-23-06 follwing code $datetime = $emapdata['1']; //format 23/06/2015 12:00 $convertdatetime = datetime::createfromformat('d/m/y', $datetime); $newdatetime = new datetime($convertdatetime); $newdate = $newdatetime->format('y-m-d'); here have date in desire format (2015-06-23) $newtime = $newdatetime->format('h:i'); here have time in format (7:00) one solution repeat above code changing variables name convert other datetime in csv did , things working fine i'm thinking use arrays, load datetime arrays , convert datetime , insert converted datetime database. $datetimearray = array( '2/17/2015 13:59', '2/20/2015 18:59', '2/05/2015 05:59', '2/15/2015 03:59', '2/19/2015 12:59', '2/10/2015 14:59' ); and foreach foreach ($datetimearray $datetime){ $convertda

MySQL how to write SQL to find excessive transactions in 15 minute windows? -

mysql lets there credit card processing company. every time credit card used row gets inserted table. create table tran( id int, tran_dt datetime, card_id int, merchant_id int, amount int ); one wants know cards have been used 3+ times in 15 minute window @ same merchant. my attempt: select card_id, date(tran_dt), hour(tran_dt), merchant_id, count(*) tran group card_id, date(tran_dt), hour(tran_dt), merchant_id having count(*)>=3 the first problem give excessive transactions per hour, not per 15 minute window. second problem not catch transactions cross hour mark ie @ 1:59pm , 2:01pm. to make simpler, ok split hour 5 minute increments. not have check 1:00-1:15pm, 1:01-1:16pm, etc. ok check 1:00-1:15pm, 1:05-1:20pm, etc., if easier. any ideas how fix sql? have feeling maybe need sql window functions, not yet available in mysql. or write stored procedure can @ each 15 block. http://sqlfiddle.com/#!9/f2d74/1 you can convert date/time secon

opencv - error LNK2019: unresolved external symbol _ Open CV program -

i learning open cv , same trying few programs. referring link. http://docs.opencv.org/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.html i using visual studio 10 run same, , think somewhere have messed configuration. facing same problem in couple of more programs (picked same source) , the error follows:- 1>main.obj : error lnk2019: unresolved external symbol "int __cdecl cv::waitkey(int)" (?waitkey@cv@@yahh@z) referenced in function __catch$_main$0 1>main.obj : error lnk2019: unresolved external symbol "class cv::mat __cdecl cv::subspacereconstruct(class cv::_inputarray const &,class cv::_inputarray const &,class cv::_inputarray const &)" (?subspacereconstruct@cv@@ya?avmat@1@abv_inputarray@1@00@z) referenced in function __catch$_main$0 ..... (more such unresolved external symbol error) 1>main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall cv::_inputarray::em

php - JQuery autocomplete with database values not working (Laravel 5) -

goal : show suggestions in form's text box based on data database <script> $(function() { $( "#activitynamebox" ).autocomplete({ source: '{{url('getactivitydata')}}', minlength: 1, //search after 1 character select:function(event,ui){ $('#response').val(ui.item.value); } }); }); </script> the problem code 1: works expected public function suggestion() { $return_array = array('1' => 'example1', '2' => 'example2'); echo json_encode($return_array); } code 2: values database, doesn't work: public function suggestion() { $term = 'programming'; $array = db::table('activities') ->where('type', '=', 'work') ->take(5) ->get(); foreach($array $element) { $return_array[$element->id] =