Posts

Showing posts from May, 2010

import - Importing ICS into Google Calendar with correct timezone -

i'm trying import simple ics file google calendar. however, though have timezone specified, google calendar still imports wrong event time. (although wrong time in correct timezone.) here sample of ics file: begin:vcalendar begin:vevent description: test_description dtend;tzid=us-pacific:20140606t180000 dtstart;tzid=us-pacific:20140606t170000 location:test_location summary:test_summary uid:20140606t150000@nl end:vevent end:vcalendar this event should show occurring on june 6, 5pm-6pm pacific standard time. however, on calendar shows occurring on june 6, 10am-11am pst. i think (although have not implemented) hack change utc , adjust event time accordingly might work. however, little annoying implement , google calendar should able handle simple of import. does have suggestions deal this, or see bugs in ics file? thanks! normally required include vtimezone objects. many people starting omit that, if do, @ least use olson-identifier. should enough google cal

ios - how to show different markerInfoWindow? -

i'm using gms ios. , i'm facing problem can't detect marker did tapped!(custom markerinfowindow) you can see code custom markerinfowindow : here i'm creating markers : -(void)createmarks{ (int l=0 ; l<self.nsmuatablearray.count; l++) { cllocationcoordinate2d pos = cllocationcoordinate2dmake([[[self.nsmuatablearray objectatindex:l] objectforkey:@"lati"] doublevalue],[[[self.nsmuatablearray objectatindex:l] objectforkey:@"longi"] doublevalue]); gmsmarker *marker = [[gmsmarker alloc]init]; marker.position=pos; marker.draggable = no; marker.map = mapview_; }} here delegate : -(uiview*)mapview:(gmsmapview *)mapview markerinfowindow:(gmsmarker *)marker{ custominfowindow*infow = [[[nsbundle mainbundle] loadnibnamed:@"infowindow" owner:self options:nil] objectatindex:0]; (l=0; l<self.nsmuatablearray.count; l++) { infow.title.text =[[self.nsmuatablearray objectatindex:l ]objectforkey:@"title"

javascript - RequireJS and Class Inheritance -

i'm trying implement classical inheritance in javascript using requirejs modules build game engine using html5. i've tried using john resig's class.js doesn't seem work way expected. here github rep project, app can run w/o server if download files , open index.html in client folder. in app create base class called entity. entity base class objects in game , extended number of other classes. sprite class extends entity class , includes animation methods. player class extends sprite class. the issue appeared when created class named image extend entity class. both player , image classes extend entity (player goes entity->sprite->player), when player sets velocity effects instances of images? added console.log prints objects velocity in image's think function (game loop tick). if press arrow keys make player walk around see player's velocity coming image think print. shouldn't independent objects individual attributes? that's i'm goin

android - button in fragmentlist only responds once, then "releases" when clicking on the row -

when click button in listview, see toast once. further clicks don't show when click away button , in empty space in listview, button click events not responding earlier appear @ once (many toasts pop 1 after another). idea how fix this? class adapter extends arrayadapter { hashmap<integer, view> rowviews = new hashmap<integer, view>(); public adapter(context context) { super(context, r.layout.manage_member_row, members); } @override public view getview(int position, view convertview, viewgroup parent) { final view rowview; if(rowviews.containskey(position)) { rowview = rowviews.get(position); } else { rowview = inflater.inflate(r.layout.manage_member_row, parent, false); ((textview) rowview.findviewbyid(r.id.manage_member_row_name)).settext(members.get(position).name); rowviews.put(position, rowview);

c# - Batch updating UI component through observable collection with large amounts of data WinRT -

i have winrt application fires notifications everytime recieves data device. have ui control databound observable collection wish add new data to while have made capable of updating observable collection, causes ui become laggy, amount of data generated fast. therefore better batch update, maybe every few hundred milliseconds. below shows snippet of code. first create periodic timer timerelapsedhandler f = new timerelapsedhandler(batchupdate); createperiodictimer(f, new timespan(0, 0, 3)); below event handler when new data comes in, along temporary list stores information list<financialstuff> lst = new list<financialstuff>(); async void mydata_valuechanged(gattcharacteristic sender, gattvaluechangedeventargs args) { var data = new byte[args.characteristicvalue.length]; datareader.frombuffer(args.characteristicvalue).readbytes(data); lst.add(new financialstuff() { time = "datetime.utcnow.tostring("mm:ss.ffffff&

putting digit between digits in Excel -

Image
in country bank account number has secondary key named sheba, , there formula calculate sheba account number. for example if account number 801-800-125954-1 , sheba of number ir0008010080000125954001. as can see, changing account number sheba has been done putting handful of 0 between account number's digits (however it's not simple). so, want write formula in excel can put 0 - or other digit - between our number of customer accounts. mean, write function in it's input number , output same number plus digit between number if can split string after each ' - ' , can pad each 1 appropriatz number of '0'. se " add leading zeroes/0's existing excel values length " ( using text ) 801 become "ir"+text("800","000000")

ios - Can't render polygon (can't reserve indicies: XX): featureID: X key: XXXX -

i have use mac os x 10.9.3 , xcode 5.1.1 in app have use mkmapview , it's working fine in ios 6.1, have stranger error display in console, such like, can't render polygon (can't reserve indicies: 1482): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 570): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 30): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 390): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 330): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 18): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 30): featureid: 0 key: 0.0.1 (512) can't render polygon (can't reserve indicies: 18): featureid: 0 key: 0.0.1 (512) like this question. i want know error , why displaying in ios 6.1 , how can solve it? my code is: self.mapview

python - win32api.keybd_event stopped working -

these 2 lines of code used work (sending keyboard event of letter focused window). stopped working recently, i'm guessing since windows update. import win32api win32api.keybd_event(0, win32api.mapvirtualkey(66, 0), 0, 0) is known bug/issue , there workaround? keydb_event unreliable instead use sendinput function

Mounting remote fs - post mount and pre unmount scripts (linux) -

i'm trying figure out way run script when specific remote fs cifs or nfs mounted , when it's unmounted. have entries in fstab mounting icons automatically created on desktop. need mount overlay fs when specific remote fs mounted , unmount before remote fs gets unmounted. udev monitor see add/remove notifications attributes pretty useless: ~$ udevadm monitor monitor print received events for: udev - event udev sends out after rule processing kernel - kernel uevent kernel[41113.912505] add /devices/virtual/bdi/cifs-2 (bdi) udev [41113.913868] add /devices/virtual/bdi/cifs-2 (bdi) ^ ~$ udevadm info -a -p /devices/virtual/bdi/cifs-2 udevadm info starts device specified devpath , walks chain of parent devices. prints every device found, possible attributes in udev rules key format. rule match, can composed attributes of device , attributes 1 single parent device. looking @ device '/devices/virtual/bdi/cifs-2': kernel=="cifs-2" subsys

java - MongoDB: error code - 10068, invalid operator: $oid -

i tried query in mongodb database using java code, throws java.lang.illegalargumentexception: cannot parse query: { _id: {$oid:"myid"}} i run same query in mongodb shell > db.collection.find({ _id: {$oid:"myid"}}) but fails error error: { "$err" : "invalid operator: $oid", "code" : 10068 } what reason of error , how solve problem? as error message says invalid operator $oid you can query using 1 of those db.collection.find({_id: "your_id"}); db.collection.find({_id:objectid("5408c3aaca92988d9c70343d")});

ruby on rails - undefined method `receive_message_chain' -

surprisingy can't find this. trying stub chain of methods: twitter::rest::client.new(<some credentials>).user.followers_count what want this: allow_any_instance_of(twitter::rest::client).to receive_message_chain(:user, :followers_count).and_return 0 but did not work. gave error undefined method 'receive_message_chain' . so found tutorial on rspec-mocks 3.0: https://github.com/rspec/rspec-mocks/blob/master/features/method_stubs/receive_message_chain.feature and tried this: subject = twitter::rest::client allow(subject).to receive_message_chain(:user, :followers_count).and_return 0 expect(twitter::rest::client.new.users.followers_count).to eq 0 just try out - , did not work either. there i'm doing wrong? i have rspec-mocks (3.0.0.beta1) in gemfile.lock . other types of stubs (like .to receive(:method) work fine. the method receive_message_chain introduced in 3.0.0.beta2, described in https://github.com/rspec/rspec-mocks/blob/mas

ios - Problems with PKRevealController -

i'm trying use pkrevealcontroller storyboard. how appdelegate looks @ startup mainnavcontroller* navcontroller = [[uistoryboard storyboardwithname:@"main" bundle:nil]instantiateviewcontrollerwithidentifier:@"mainnavcontroller"]; mainviewcontroller* mainviewcontroller = [[uistoryboard storyboardwithname:@"main" bundle:nil]instantiateviewcontrollerwithidentifier:@"mainviewcontroller"]; leftviewcontroller* leftviewcontroller = [[uistoryboard storyboardwithname:@"main" bundle:nil]instantiateviewcontrollerwithidentifier:@"leftviewcontroller"]; pkrevealcontroller *revealcontroller = [pkrevealcontroller revealcontrollerwithfrontviewcontroller:navcontroller leftviewcontroller:leftviewcontroller]; revealcontroller.animationduration = 0.25; revealcontroller.delegate = self; self.window.rootviewcontroller = revealcontroller; so seems work fine, , app launches no problems, when swipe right, left view controller shows , c

visual studio 2008 - C++ Convert Sytem::String^ to LPCOLESTR -

i write in mixed mode (c++/cli) , can not resolve problem: string ^progid = "matrikon.opc.server"; clsid clsid; hresult result = clsidfromprogid(progid, &clsid); error c2664: 'clsidfromprogid' : cannot convert parameter 1 'system::string ^' 'lpcolestr' how can convert string^ lpcolestr ? thanks! first, lets convert system::string char* intptr p = marshal::stringtohglobalansi(progid); char *pnewcharstr = static_cast<char*>(p.topointer()); second, casting char * lpcolestr using atl conversion macro: lpcolestr converted_string = a2cole(pnewcharstr);

php - Zend Framework delete rows doesn't work? -

i have same problem of zend_db_table: delete multiple entries , code of fireeyedboy sames not working. haven't errors db entries still exist. can do? code in model identically in effect: public function deleteusers($usernames) //elimina più utenti passati con una stringa { $where = array(); foreach ($usernames $username) { $where[] = $this->getadapter()->quoteinto('username in (?)', $username); } $this->delete($where); } where $usernames array dinamically created multicheckbox selection. assign parameters array in way in controller: $list=$this->getrequest()->getparam('utenti'); $this->_adminmodel->deleteusers($list); $this->_redirector->gotosimple('success', 'admin', null); for same reason code go successaction not deleting. omit foreach loop. if $usernames array of usernames, deleteusers method should this: public f

html - Extjs Locking Grid... how to make it appear in a div? -

this seems simple enough question, yet i've spent 3 hours , found no information on how it. purchased ext js 4, , i'm trying "locking grid" appear on 1 of web pages. grid simple in end, no fancy ajax or anything, grid display info. went through quick start tutorial, , tells paste code javascript file, , include ref javascript file in header of page. well, nothing. no grid appears. , why it, haven't told grid appear. how tell grid appear in particular div on page, or appear on page @ all? either use renderto config or use render method. sure read notes these, should not use render/renderto on items going inside container, top level components.

java - Boolean expression (x / 2) * 2 == x to test -

this 1 of lab questions. you can test see if integer, x, or odd using boolean expression (x / 2) * 2 == x. integers make expression true, , odd integers make expression false. use loop iterate 5 times. each iteration, request integer user. print each integer user types, , whether or odd. keep number of , odd integers user types, , print “done” when finished, user won’t try type integer. finally, print out number of , odd integers entered. i know question requires me do. however, don’t quite understand why boolean expression, (x/2)*2 == x, can test whether integer ever number or odd number. lets number 59, odd integer obviously. 59 divided 2 29.5. 29.5 times 2, equals 59. no matter x is, (x/2)*2 equals x. how make expression false when integer odd. can determine should print. because you're dealing integers, there's rounding down nearest round number. 59/2 = 29 when elements integers. multiplying result 2 gives 58 , since 2 numbers aren't same, deduce n

Python coverting list to dictionary -

i trying write function takes list of strings containing names , marks parameter. , return dictionary of (mark, [list of names got mark]) example: def example(["john,5", "jessica,5", "jack,7"]): returns: {'5' : ["john", "jessica"], '7' : "jack"} i find tricky problem... how solve using split(',') this i've done far: def create_marks_dict(my_list): dictionary = {} name in my_list: if name not in dictionary: dictionary[name] return dictionary you'll need use defaultdict collections use lists in dictionary from collections import defaultdict def create_marks_dict(my_list): dictionary = defaultdict(list) item in my_list: name, marks=item.split(',') dictionary[marks].append(name) return dictionary output: {'5' :

css - how to change font of menu in fruitful wordpress theme? -

i want change fonts special elite font in website. have used wp google font plugin. worked other text except menu. want change menu fonts special elite font. how can that? other alternative that? is possible add special elite font in options of fruitful theme? link site http://mycompany.co.nf/2/

c# - Change the text of label from javascript -

so first problem happen when click button? page refresh or else, because i'm working on small project , facing problem <script language="javascript" type="text/javascript"> var totaltime = 0; var interval = 0; var min = 0; var hr = 0; var sec = 0; var secstr = 0; var minstr = 0; var flag = 0; window.onload = startresettimer function startresettimer() { totaltime = 20; hr = math.floor(totaltime / 3600); sec = totaltime % 60; if (sec == 0) min = (totaltime / 60) % 60; flag = 1; interval = setinterval(function () { if (flag == 1) { if (totaltime <= 0) { flag = 0; pagemethods.callit(); } else { totaltime--; hr = math.floor(totaltime / 3600) sec = totaltime % 60 if (sec == 0)

mysql - Database structure suggestion (serialization or separate table) -

i making database, , truth told i'm not @ (kinda being forced it). game database, , have table called game_table use storing game sessions users create. the question is, best way store list of invited users, requested users, confirmed users, declined users , pending users? serializing user ids (e.g. invited users = "11235|2510|34630|45715|64530"). however, main problem field becomes not searchable, , becomes problem if want retrieve list of games user invited to. solve problem, store separate field in user_table invited_games (also serialized game ids). the problem that, is getting hard maintain whenever want add new features, , easy make mistakes keeping serialized data in sync. better have separate tables like: invited_users_table game_id | user_id 51 | 5193 51 | 10458 51 | 235 901 | 1536 901 | 4573 or there other better way of storing these types of data? please help, , thanks! from say, sounds need 1 table

php - How do I get rows to correspond to other rows based on a parent_id , all from the same table -

i assuming not easy way of doing , it's home assignment, bear me please. i have table in mysql 'menu' following structure : id - number parent_id - number (0 root) title - string link - string the parent_id links id of row , in case product1 products . example : 1 | 0 | | about.html 2 | 0 | products | products.html 3 | 2 | product1 | product1.html 4 | 2 | product2 | product2.html 5 | 2 | product3 | product3.html my goal make set of ul 's : <ul> <li><a href="about.html"> </a></li> <li><a href="products.html"> products </a> <ul> <li> <a href="product1.html"> product 1 </a></li> <li> <a href="product1.html"> product 1 </a></li> ... </ul> </li> ... </ul> so far i've mad

java - how do i make a JButton fill out two spaces in a gridlayout? -

Image
i have jpanel set gridlayout this: rightpane = new jpanel(new gridlayout(0,2)); in gridlayout, have bunch of jbuttons, how can make 1 of buttons take 2 columns , 1 row, rather 1 row , 1 column? you need gridbaglayout in case instead of gridlayout . have @ how use gridbaglayout explained in details along sample code of below snapshot. is want?

Jquery toggle incorrectly removing element from page -

can tell why works correctly add , remove "hover" class existing buttons on page: $(".button").click(function () { $(this).toggleclass("hover"); }); but when try instead, buttons inline "display:none" tag attached them , disappear off page? $(".button").toggle(function () { $(this).addclass("hover"); }, function () { $(this).removeclass("hover"); }); i'm on win7 using jquery 1.11.1 , able re-create issue in ff, chrome ie. this strictly learning excercise, appreciated. i think misunderstood .toggle method. http://api.jquery.com/toggle/ according documentation, it's used hide or display element.

python - Get Fabric to email me when aborting -

i'm using fabric manage remote deployment of blog uses static site generator pelican. whenever drop new file in dropbox, use dropbox webhooks launch series of tasks on heroku server. tasks managed using fabric. because done remotely, have manually inspect logs whenever realize went wrong. i'd fabric email me whenever aborts due error. how can catch fabric abort can have send me email? you can catch systemexit exception thrown failing task , send email in exception handling block. see relevant topics: how catch auth errors in fabric , retry? how continue task when fabric receives error

graph - make barplot start from number other than 0 in base R graphics and plot values beneath this startpoint -

is possible make barplot start number other 0 in base r graphics , plot values beneath startpoint? example, create barplot origin on y-axis 1 , draw boxes go 4 , down -3. for example, draw barplot starting 1, instead of drawing bars 0. barplot(c(4,-3)) this question distinct from: different starting point (not 0) in barplot y-axis? , plots values above startpoint different 0. plot them below new startpoint. one hackish possibility -- tweak values , adjust axis accordingly: barplot(c(4,-3)-1,axes=false) axis(side=2,at=(-3:4)-1,labels=(-3:4)) abline(h=0)

php - How to work with integrate 2 different array? -

i working 2 different array want integrate both of become result want. have no idea how it. this array return current result me : foreach($getvote $option){ $data['id'] = $option['option_id']; $data['option'] = $option['option']; } and result : array ( [id] => array ( [0] => 1 [1] => 2 ) [option] => array ( [0] => option 1 id 2 [1] => option 2 id 2 ) ) but want : array ([0]=>array( [id] => 1 [option] => option 1 id 2) [1]=>array( [id] => 2 [option]=> option 2 id 2 ) ) this $getvote result : array ([0] => array ( [id] => 2 [option_id] => array ( [0] => 1 [1] => 2 ) [option] => array ( [0] => option 1 id 2 [1] => option 2 id 2 ) [subject] => test 2 [type] => 1 ) ) i don't know asking correct question. hope can all. in advanced. try for($i =0; $i<count($getvote[0]['option_id

XSLT custom date formatting - GSA -

i trying format xslt in dynamic navigation render dates in particular format. code generates following error: "an unknown error occurred." xslt code is: <xsl:template name="customdate-dn"> <xsl:param name="d"/> <xsl:value-of select="format-date($d, '[d01] [mn,*-3] [y0001]', 'en', (), ())"/> </xsl:template> <xsl:template match="pv" mode="display_value"> <xsl:param name="js_escape"/> <xsl:choose> <!-- customizations - fancy date --> <xsl:when test="../@t = 4"> <xsl:call-template name="customdate-dn"> <xsl:with-param name="d" select="@v"/> </xsl:call-template> </xsl:when> <!-- end of customization --> ... if replace <xsl:value-of select="format-date($d, '[d01] [m

android - date time change in onlocation changed -

ive created android app posts web services. supposed check users location , provide relative information gps update in terms of position , date time. rest of functions work fine date time remains same , have no idea why. insight prove helpful. here of code. locationlistener string lati, longi, alti, timestamp; float speed; int counter = 0; date date = new date(); dateformat dateformat = new simpledateformat("yyyy-mm-dd't'hh:mm:ss'z'"); @override public void onlocationchanged(location location) { // todo auto-generated method stub log.d("location", "hello world"); lati = string.valueof(location.getlatitude()); longi = string.valueof(location.getlongitude()); alti = string.valueof(location.getaltitude()); speed = location.getspeed(); timestamp = dateformat.format(date); counter++; requestinfo requestinfo = new req

r - Horizontal lines in errorbars disappearing -

i'm having troubles errorbars in ggplot (r) similar this problem in python . horizontal errobars disappearing when using scale_y function. can me find solution? data here . my code is: data_sac_ggplot <- ggplot(yeast_sac, aes(x=factor(day), y=mean_count, colour=yeastsample, group=c("low","high"))) + scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x), labels = trans_format("log10", math_format(10^.x))) + geom_line(size=0.8) + geom_point(size=2, shape=21, fill="white") + theme_bw() data_sac_ggplot + geom_errorbar(aes(ymin=mean_count-low, ymax=mean_count+high), width=0.1, position=pd) data_sac_ggplot + scale_y_log10(breaks=c(1000,10000,100000,1000000,10000000,100000000,1000000000)) thanks! picture of plot:

sql - Converting the comma seperated string in oracle to the format for the in clause -

i trying achieve '2611','2616','3306' '2611,2616,3306' select replace( '2611,2616,3306', ',', ''',''' ) dual; the above giving me output of 2611','2616','3306. can tell how first , last comma you concatenate them front , back: select '''' || replace( '2611,2616,3306', ',', ''',''' ) || '''' dual; which result '2611','2616','3306'.

actionscript 3 - check if an air android app is installed on the mobile -

i have air application , inside have many package ids of air apps. want know if specific id app installed or not on phone. how can that? thank you! you should take @ extension https://github.com/sticksports/ane-can-open-url it's quite old , might not work expected, worth shot.

perl - grep filename in directory -

i have directory named - "requests" inside have below files transition-request-201405061735.html requisition-request-201405061735.html transition-request-201405061735.txt transition-request-201405061735.csv output.txt i need filter transition-request-201405061735.txt the code came far below #!/usr/bin/perl use strict; use warnings; $request = "/tmp/requests"; opendir(dir, $request) or die $!; @inputfiles = grep { /ion-request-/ && \/\.txt$/ && -f "$request/$_" } readdir(dir); print "@inputfiles\n"; output below transition-request-201405061735.html transition-request-201405061735.csv transition-request-201405061735.txt requisition-request-201405061735.html i seeking experts advise in using valid grep statement filter desired file - transition-request-201405061735.txt this due escape character: \/\.txt$/ # ^ here just remove it: .... /ion-request-/ && /\.txt$/ ...

windows - Set process priority on already running process batch file -

how change priority of running posses can use start posses: start /high notepad.exe how change running notepad. if 1 can this. use wmic (wmi command-line): wmic process name="notepad.exe" call setpriority "high priority" the priority can "idle", "below normal", "normal", "above normal", "high priority", "realtime", or integer value. integer values priorities can found on this msdn page .

c# - Unit Testing void returning method -

i using moq first time , not sure on correct approach testing void returning method have. have read post helpful didnt include many snippets of code guidance. method updates db responses external webservice list of car objects my method below: public void updatedbwithwebresponse(response response, list<car> cars) { try { if (response == null) { //exception logged } foreach (var webresponse in response.responses) { var car = cars.first(c => c.id == webresponse.id); if (response.detailresponse == null || response.detailresponse.values == null) { //exception logged } foreach (var detailresponse in response.hazardresponse.values) { updatedetailresponseoncar(detailresponse, car); } } //update db

c# - Pass type parameters to attached behaviors -

i implementing attached behavior in wpf application. need pass type parameters behavior, can call method void newrow(table<t> table) on sqliteboundrow . if instantiating object in xaml, pass type parameters using x:typearguments , don't see way when setting attached behavior, because uses static property. code attached behavior looks this: public abstract class sqliteboundrow<t> t : sqliteboundrow<t> { public abstract void newrow(table<t> table); } public class datagridbehavior<t> t:sqliteboundrow<t> { public static readonly dependencyproperty isenabledproperty; static datagridbehavior() { isenabledproperty = dependencyproperty.registerattached("isenabled", typeof(bool), typeof(datagridbehavior<t>), new frameworkpropertymetadata(false, onbehaviorenabled)); } public static void setisenabled(dependencyobject obj, bool value) { obj.setvalue(isenabledprop

java - Redirecting log output to HTML text area -

i in process of writing web application using jsp , have logging setup being written file during app's running lifetime. log information in case important user , display somehow. @ first thought of using kind of actionlistener on logger object , using scriptlet inside jsp append text text area element i'm not quite sure if work. there easy or known way this? feedback , appreciated. right using regular apache logger object open using outside libraries such log4j or other options achieve need. am not able this? text area need updated without refreshing whole page each time there info written logger. if not able done, popup processing advisable? done popup, perhaps jswing may ugly. have considered doing simple periodic ajax polling? here small example using jquery posts jsp , calls javascript function update textarea: function dopoll(){ $.post('ajax/log.jsp', function(data) { updatetextarea(data); // process results here settimeout(dop

php - codeigniter form not working -

i trying create search form in codeigniter site header, everytime form submitted, receive 404 error saying page cannot found! have attempted create link test page , gave me same error. please observe code below. view(site_header) <?php echo doctype(); ?> <html lang="en"> <link href="<?php echo base_url(); ?>styles/style.css" type="text/css" rel="stylesheet"/> <head> <title>/title> <div id="container"> <div id="search"> <?php echo form_open('search_keyword'); echo form_label("stumble search ", "searchfor"); echo form_input("search","search"); echo form_submit("getsearch","search"); echo form_close(); ?> </div> </div> <

c# - How to modify existing column value on a DataBound in GridView using if else -

Image
i use data source populate grid view. need able se every column value equals 01/01/00 nothing. here code , image of values: the gridview no border lines. doing wrong? first of all: not paste code in image. secondly, equals method supposed check whether value equal 1 pass in parameter. intstead of that, use row.cells[9] = "";

ios - Trying to detect if tableview scroll is over indexpath.row 0 -

i trying determine if user has scrolled beyond top of table can refresh it. far, have been unsuccessful because seem getting unique situation: if (indexpath.row < 0) { the above not work. if (_tableview.contentoffset.y < -64) { this works, when pull extremely far (pull content bottom of tableview work). somehow need make need pull little bit, oddly enough, when put @ -63 reacts though @ -64 , continually refreshes. if(self.tableview.contentoffset.y < (self.tableview.contentsize.height - self.tableview.bounds.size.height)) { this works, when pull extremely far (pull content bottom of tableview work). somehow need make need pull little bit, oddly enough, when put @ -63 reacts though @ -64 , continually refreshes.

How to transfer binary files from a C#/websocket server to the client? -

i have tcp server have implemented websocket server communicate client, , works great. i have requirement send files server client, know can open file , send data browser , receive in onmessage event of websocket , don\t know how create file on client side , how can write received data file. it seems simple thing don't know how ? any sample code appreciated.

mysql - simple delete query using php -

i trying create delete query html using php: html: <form method="post" action="" > id<input type="text" name="x" /> <input type="submit" value="delete" name="del"/> </form> php: <?php $connection = mysql_connect("localhost","root","") or die ("couldn't connect server"); $db = mysql_select_db("smap", $connection) or die ("couldn't select database"); if(isset($_post['del'])) { $a = $_post['x']; $sql = mysql_query("delete syracuseone id ='$a'";) if(mysql_query($sql)) { echo "deleted"; } else { echo "fail"; } } ?> i error: notice: undefined index: x any assistance stack? it means post value not passed next page, can $a = isset($_post['x']) ? $_post["a"] : 0; take look, here

sqlite3 - SQLite - Foreign key referencing rowid alias. Legal or not? -

in sqlite documentation says: the parent key of foreign key constraint not allowed use rowid. parent key must used named columns only. the parent key must named column or columns in parent table, not rowid. but apply alias of rowid? example in sqlite if have integer primary key column column alias of rowid: with 1 exception noted below, if rowid table has primary key consists of single column , declared type of column "integer" in mixture of upper , lower case, column becomes alias rowid. such column referred "integer primary key". (exception omitted; not relevant here) there similar question here: sql - why referencing sqlite rowid cause foreign key mismatch? - stack overflow if take example , modify use alias (my integer primary key column) appears work: sqlite> create table foo(a integer primary key, name); sqlite> create table bar(foo_rowid references foo(a)); sqlite> insert foo values( null, "baz"

how to use liquibase diffChangeLog with the current changelog as reference (to generate incremental change set) -

i have existing database , have used generatechangelog command line create initial changelog. works fine :-) but want developers use tools/processes know/use develop database , code , use script generate incremental change sets appropriate. that is: diff against current state of developer's database (url/username/password in properties file) using current changelog (changelogfile in properties file) base reference. there seems no easy way - best i've come is: create new temporary database. use liquibase initialise temp database (to in changelog) overriding connection url: liquibase --url=jdbc:mysql://localhost:3306/tempbase update use liquibase generate changeset in changelog diff'ing 2 databases: liquibase --referenceurl=jdbc:mysql://localhost:3306/tempbase --referenceusername=foo --referencepassword=baz diffchangelog drop temporary database. synchronise changeset: liquibase changelogsync but there must better way... you right liquibase cannot

apache - Name Based Virtual Hosting url not found -

i trying set website name based virtual hosting. when visit website, lukej.us, url not found error. here conf file <virtualhost *:80> servername www.lukej.us serveralias lukej.us *.lukej.us documentroot /vars/www/html/lukej.html </virtualhost> <directory /vars/www/html/> allowoverride order allow,deny allow </directory> documentroot supposed directory . root folder files served. attempted specify file, gets interpreted directory, since expects directory . trying serve directory /vars/www/html/lukej.html/ doesn't exist. you wanted this: <virtualhost *:80> servername www.lukej.us serveralias lukej.us *.lukej.us documentroot /vars/www/html/ directoryindex lukej.html </virtualhost> this serve files /vars/www/html/ directory, , show lukej.html index file (when access path / web).

html5 - Initializr Bootstrap. Knowledgebase. How to create and edit content? -

i in process of creating knowledgebase website office , find bootstrap pretty awesome. now, people @ work, may not html savvy, creating new articles , posting them knowledge base. is there can recommend allow such type of user create document on somthing similar microsoft word web based , publish? or have write scratch? thanks help.

delphi - cxgrid custom menuitem (open with) for Image field -

in cxgrid have column "image" type.(properties=image,graphicclassname=tjpegimage). popupmenulayout - menuitems have added custommenuitem called "open with...". how can implement custom menu item opens underlying image paint (windows paint)? or @ least trigger "open with.." windows dialog. if have image stored in database first have save image file on computer. then can use shellexecute opening image default image viewing/editing program. shellexecute works same if user have double-clicked on file. problem doublec-licking on image file opens preview of if need edit image using of shellexecute might not best way. now in order sure image opened editing rathen in preview have read windows registry information program used viewing , editing of specific image format , use createprocess api cal instead. you make sure image opened specific program starting program using createprocess api call , passing image location startup parameter (most imag

javascript - window.location.replace(document.URL) not triggering if url contains '#?' at the end -

in sample website, trying redirect page using javascript window.location.replace method. need refresh page, used document.url . works well. noticed not working without giving error. found links adds # in address bar , 1 of javascript add ? same. @ time code window.location.replace(document.url) wont execute. due characters in url? here function(sample) function sample() { alert(document.url); window.location.replace(document.url); } the alert showing url http://localhost/something/#? . , @ time not refresh page. use of these location.reload(); window.location.reload(); window.location.href=window.location.href

how to send apple push notification that is not overwrite on banner bar in ios -

i'm new apple push notification(apns).i want know how send apple push notification not overwirte on banner bar. if recipient device online, receives , processes message. if device offline, message not queued , delivered next time device online. in time, can see last message. that's problem occured. in advance. apple's local , push notification programming guide docs explicitly mention behavior only 1 recent notification particular application stored. if multiple notifications sent while device offline, each new notification causes prior notification discarded. behavior of keeping newest notification referred coalescing notifications. if device remains offline long time, notifications being stored discarded

XMPP traffic logging (ejabberd 13.12) -

it seems mod_logxml module not compatible ejabberd 13.12 version. ejabberd fails start when module installed. my question - there way how log (file, database, etc) xmpp packets send , received ejabberd? i've changed mod_logxml.erl work ejabberd 13.12. have put in ejabberd/src/ configs ejabberd.yml format: mod_logxml: stanza: [message, other] direction: [external] orientation: [send, recv] logdir: "/var/jabber/logs/" timezone: universal rotate_days: 1 rotate_megs: 100 rotate_kpackets: no check_rotate_kpackets: 1 repository

SWTBOT selecting text of a dialog -

i'm running swtbot test , don't know how select text(message) of dialog. i can text of shell like: bot.activeshell().gettext().equals("login error") seen method tooltip not message. thanks shell.gettext() return shell title. if want message inside dialog, have "find" it. you'll need use "bot.label()" , similar methods.

.net - Selecting overload with tracking reference -

in c#, can have code following: void add(vector3 a, vector3 b, out vector3 c) { add(ref a, ref b, out c); } void add(ref vector3 a, ref vector3 b, out vector3 c) { c.x = a.x + b.x; c.y = a.y + b.y; c.z = a.z + b.z; } however, in c++/cli, compiler (understandably) not able select correct overload: void add(vector3 a, vector3 b, [out] vector3% c) { add(a, b, c); } void add(vector3% a, vector3% b, [out] vector3% c) { c.x = a.x + b.x; c.y = a.y + b.y; c.z = a.z + b.z; } how indicate compiler want select second overload? as hans passant said in comment post, not possible. point of value types should small enough efficient copy, , if aren't, should not value types. there therefore no need second overload in cases. edit: hans said not true. generates (almost) exact same il c# version (the difference adds modopt([mscorlib]system.runtime.compilerservices.isexplicitlydereferenced) ): void add(vector3 a, vector3 b, [out] vector3% c) { add(&a, &

how to visualize nodes using in igraph -

i have visualize network , using igraph. each of vertices has attribute groups vertices clusters. layout graph according links, retain attribute grouping, that, instance, vertices label "a" not mixed vertices label "b". is there option other tkplot() , manually adjust result, retrieve coordinates , plot final result? here can find 2 solutions: either set between-cluster , within-cluster edge weights, , apply spring force layout; or iterate on clusters, , apply layout.norm() set each cluster specific area of plot.

c# - How do I detect if I'm running in the console -

is there simple way have code library automatically detect if it's being called console application or windows application? i'd library not report windows event log if it's being called console window, instead report console window. if however, it's not being run within console window, should report windows event log. i thought requiring logging component passed log target, neat if automatically handle these 2 targets natively. don't yet require extensive log4net, indeed, if becomes necessary provide support log database/file , other yet unknown logging targets, may recommend such solution. though, having component auto-detect environment , log console or event log according environment plenty. architecturally, passing logging context library component right choice. library doesn't, , indeed shouldn't, know context environment it's being run in. because want support these 2 special cases natively within library, i'd suggest unifi

windows - How to do a taskkill in cmd based on the partial content of the windowtitle name? -

i starting command window "start "dummycommandwindow" able close window "taskkill /fi "windowtitle eq dummy*" /f /t" want close window based on partial name of window title, in, "taskkill /fi "windowtitle eq *commandwindow" /f /t". how do this?? following command kills process starts 'chrom'. taskkill /f /im chrom* /f: force (use cmd prompt in admin mode only) /im: image name i hope familiar wildcards you can refer following msdn article

ruby on rails - Get checked status of checkbox in controller -

i have form in index-view create multiple checkboxes. 1 checkbox every entry. looks this: index.html.erb <%= form_for :user, url: usersupdate_path() |f| %> <%= render @users %> <%= f.submit 'test', :class => 'btn btn-primary' %> <% end %> _user.html.erb <%= check_box_tag "checked[#{user.id}]","#{user.id}",true %> description: form want allow admin uncheck users - users want send controller , update attributes. there 2 problems: 1) have refresh site until can send form controller - don't know why 2) when print array looks this: {"1"=>"1", "2"=>"2", "4"=>"4"} user 3 unchecked me. what want this: {"1"=>"true", "2"=>"true", "3"=>"false", "4"=>"true"} but how can send checked value of checkbox controller? in controlle

sql - How can I SUM a COUNT(*) subquery to find two string values per ID? -

i'm trying build sql server query spit out numbers. specifically, need know how many people both pizza , soda displayed showing proper count relationship. i have 2 tables this: people : 1 andy relative 2 jim friend 3 anderson friend 4 pamela relative likes : 1 pizza 1 soda 2 pizza 3 soda 4 pizza 4 soda my desired output following. list of how many relatives , how many friends pizza , soda: relative 2 friend 0 this pretty i'm @ wholly incorrect: select relation, (select count(*) likes lik id = lik.id , pizzavalue = 'pizza') + (select count(*) likes lik id = lik.id , pizzavalue = 'soda') dbo.people inner join likes lik on ps.id = lik.id try: select relation, count(*) people p join likes l1 on l1.id = p.id , pizzavalue = 'pizza' join likes l2 on l2.id = p.id , pizzavalue = 'soda' group relation this first join person table likes table , leave every person like

rtmp - Playback of Beatsmusic audio API not working -

i have followed instructions here no avail: https://developer.beatsmusic.com/docs/read/web_playback_api/getting_started everything loads, no music plays. i have tried simple example: https://developer.beatsmusic.com/docs/web_playback_api/examples but again, no streaming occurred. in both cases, no errors thrown, no music. i've tried multiple debug techniques, etc. suggestions? thanks! in simple example on jsfiddle makes bam_engine object 500px x 300px. see black console window when run html? see when load simple example page @ jsfiddle? if can't see in local html page, can see on jsfiddle, not have location of html file set trusted location. setting trusted location explained on getting started page.

c# - how to efficiently create a view model from multiple tables -

i have following viewmodel: public class employeecatalogmodel { public list<stringcatalogmodel> employeetype { get; set; } public list<intcatalogmodel> jobtitle { get; set; } public list<intcatalogmodel> profitcenter { get; set; } public list<intcatalogmodel> location { get; set; } public list<intcatalogmodel> holidaytemplate { get; set; } } each property can stringcatalogmodel or intcatalogmodel depending on identity of each table: model id integer public class intcatalogmodel { public int id { get; set; } public string description { get; set; } } model id string public class stringcatalogmodel { public string id { get; set; } public string description { get; set; } } ok, magic happens here... bring stored procedure 5 selects (for each catalog) , have create employeecatalogmodel there. what have is: using(dbcommand cmd1 = _db.ge

ruby on rails - Bundler failing to install gems: i18n gem v 0.6.10 issue -

i have run issue when trying push rails 4 app heroku. fails install gems via bundler , says cannot find i18n .6.10 it seems current version of i18n .6.9. i uninstalled gem i18n , reinstalled. on installation, says installed .9 when bundle show i18n, shows version 10. i have never seen problem i18n or of gem file.lock gems before. how force use 9? thank you 0.6.10 was yanked recently . should see gem depends on yanked version of i18n inspecting gemfile.lock . also, try specify version of i18n explicitly in gemfile : gem 'i18n', '0.6.9' and run bundle update .

SQL Server : aging based on last date -

rn lsd ed aging ------------------------------------------ 11111111 09-feb-2017 06-feb-2017 3 22222222 09-feb-2017 02-feb-2017 7 33333333 20-jan-2017 29-nov-2016 44 33333333 20-jan-2017 07-dec-2016 44 33333333 20-jan-2017 29-nov-2016 44 33333333 20-jan-2017 30-nov-2016 44 33333333 20-jan-2017 29-nov-2016 44 44444444 12-dec-2016 19-nov-2016 17 44444444 12-dec-2016 19-nov-2016 17 44444444 12-dec-2016 25-nov-2016 17 55555555 07-feb-2017 04-dec-2016 56 55555555 07-feb-2017 04-dec-2016 56 55555555 07-feb-2017 13-dec-2016 56 how can update aging column based on last (max) ed date column grouping rn column? i recommend changing date format yyyy-mm-dd makes easier in calculation , sorting. should able work out difference sql query. syntax datediff(datepart, startdate, enddate) example select datediff(day, '2014-08-05', '2014-06-05') diffdate

Eden-net Python : Error when i type the command 3 install.bat -

i can not install eden net sdk searched on internet found nothing relevant solution. tried quite few things can not solve problem. if have idea not hesitate contact me. find attached error shows me when type command: install.bat enter image description here

javascript - How to implement Multi Column Textbox -

Image
is there method can use add multi column textbox in fabricjs? short of ideas here. appreciated. currently using code textbox. var newtext = new fabric.textbox('double click me edit contents.', { fontweight: 400, fontsize: 28 / canvas.currentzoom, fill: '#000', removeoncancel: true, name: 'text' }); canvas.pages[canvas.activepageindex].fabric.add(newtext); newtext.settop(25); newtext.setleft(25); canvas.pages[canvas.activepageindex].fabric.setactiveobject(newtext); canvas.pages[canvas.activepageindex].fabric.renderall(); here pictorial representation trying achieve in fabricjs

json - Country name in PHP, not showing -

i have problem code wrote. i've tested code several times , working fine, thing if run php file in 1 specific server (namecheap) there functions don't work correctly , when run in server (1and1) goes 100% well. want country name based on ip stablish market , have code in namecheap, $country_name not shown in 1and1 certenly does. i'm wondering if has php version? if guys, can refer me documentation see if i'm capable solve on own. i hope i'm being clear enough. in advance. links of file on servers here namecheap , 1and1 here php code: <?php /* --------------------------------------- / * xx. ip , country (market). * -------------------------------------- */ // gets client's ip. $ip = getenv("http_client_ip")?: getenv("http_x_forwarded_for")?: getenv("http_x_forwarded")?: getenv("http_forwarded_for")?: getenv("http_forwarded")?: getenv("remote_addr"); // matchs gotten ip api values , r