Posts

Showing posts from September, 2014

file - Telerik RadFileExplorer And Server side codes -

i have file explorer below : <%@ page language="c#" autoeventwireup="true" codebehind="searchbar.aspx.cs" inherits="fileexplorer.searchbar" %> <%@ register assembly="telerik.web.ui" namespace="telerik.web.ui" tagprefix="telerik" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="head1" runat="server"> <title></title> <script type="text/javascript"> // function onclientfileopen(oexplorer, args) { // args.set_cancel(true); // radopen(args.get_item().get_url()); // } function onclientfileopen(oexplorer, args) { var item = args.get_item(); var fileextension = item.get_extension(); var filedown...

c# - How can I create a WPF behavior that refers to multiple controls? -

i have scrollviewer contains large image. want user able hold mouse down , drag image move side side, , i'm trying implement using behavior. problem mouse down event doesn't seem able fire on scrollviewer when user presses down on mouse button. code behind, handle event on image, behavior attached 1 control don't know how approach issue. what approach should use create system.windows.interactivity.behavior attaches both objects? the mouseleftbuttondown event raised fine on scrollviewer. problem scrollviewer handling event (e.handled = true). , since handled behavior not receive it. depending on doing might able use previewmouseleftbuttondown event instead. way doesn't matter if scrollviewer handle since behavior receiving first. you try use drag&drop events directly. i'm not sure if work.

ASP.NET MVC Load page with AJAX -

i have situation: a page accordion 2 tabs, 1 has list of paymentmethods, second has summary of order orderlines, amounts , totals (rendered partialview). selecting paymentmethod causes order totals recalculated, costs etc might apply. what recommended way display new ordersummary after paymentmethod selected, using ajax? doing ajax call , getting new amounts, orderlines, etc , setting these values using js seems inefficient me. ideal situation if make ajax call selected payement method , call return html can use replace old summary. is bad render partialview html on server , return using json? best practice situation? in action method return partialview([view name]) . then can jquery: var req = $.ajax({ type:"get",//or "post" or whatever url:"[action method url]" }).success(function(responsedata){ $('targetelement').append($(responsedata));}); where 'targetelement' selector element want inject content. ...

sql - Always overwrite if exists? -

my table looks like: _id, subid, textinput, attribute1, attribute2 when create new record, saves 5 rows... same subid. if create record same subid, saves 5 rows, giving me total of 10 rows subid. what if subid exists overwrite rows there. how go doing that? you can use insert or replace, you'll have put unique index on subid. alternatively, can query table subid , if found, use simple update instead. if not found, use standard insert.

php - refresh multiple iframes based on a variable "id" from one button -

i have php page has multiple iframes on page. these iframes contain button if will. when clicks on "button" im firing javascript refresh frame on page id=xxx works fine. problem want able refresh multiple frames on page cant have same id value how done. <iframe id="12345"></iframe> <iframe id="12345"></iframe> <iframe id="12345"></iframe> this works on single iframe (i know cant have multiple ids same on 1 document.) idea want this. parent.document.getelementbyid('12345').contentwindow.location.reload(); sorry sloppy example, ive been awake far long. :) just assign different ids , call parent.document.getelementbyid(customid).contentwindow.location.reload(); multiple times, once each every iframe want reload.

Python: clockwise polar plot -

how can make clockwise plot? ask similar question here : how make angles in matplotlib polar plot go clockwise 0° @ top? dont understand this. import matplotlib.pyplot plt import numpy np fig = plt.figure() ax = fig.add_subplot(111, polar=true) ax.grid(true) theta = np.arange(0,370,10) theta = [i*np.pi/180.0 in theta] # convert radians x = [3.00001,3,3,3,3,3,3,3,3,3,3,3,3,3,2.5,2,2,2,2,2,1.5,1.5,1,1.5,2,2,2.5,2.5,3,3,3,3,3,3,3,3,3] ax.plot(theta, x) plt.show() edit: import matplotlib.pyplot plt import numpy np matplotlib.projections import polaraxes, register_projection matplotlib.transforms import affine2d, bbox, identitytransform class northpolaraxes(polaraxes): ''' variant of polaraxes theta starts pointing north , goes clockwise. ''' name = 'northpolar' class northpolartransform(polaraxes.polartransform): def transform(self, tr): xy = np.zeros(tr.shape, np.float_) t = tr[:,...

Mysql random rows from all values of another table -

i have table 15,000 rows each having unique id , table b 10,000,000 rows multiple rows each unique id in table a. need check table b each id table , select 1 random row each of matching ids. once query runs end 15,000 random rows table b (each unique table id). i'd assume intense rand() alone or loop it's got involved select. looked involves 1 table http://explainextended.com/2009/03/01/selecting-random-rows/ not able adjust need. what this? select distinct b.a_id b inner join on a.id = b.id order rand(10000000)

javascript - Creating a modal dialog - content disappearing -

i trying make jquery modal dialog. (please not "use plugin"). i aware js using crap, once trying hack basic functionality, once have basic functionality down rewrite jquery plugin own use. anyway, i have got dialog appearing, , in center of page, dialog sized content. in specific example content has fixed width. i trying handle case content bigger page width. i getting strange issue where, if page resized content seems literally cut off, no scroll bars. what issue? example: http://jsbin.com/egowo3/edit css: body { padding: 0; margin: 0; color: #fff; } #overlay { position:fixed; width:100%; height:100%; background: rgba(0,0,0,0.8); z-index: 9999; display: none; } #dialog { display: none; background: #000; border: 1px solid #0000ff; position: fixed; z-index: 99999; } #test { display: none; width: 1300px; } javascript $(function(){ $('button').click(function(){ var body = $('body'); var...

c# - Cascade on delete not cascading with EF -

i have simple sqlite database 2 tables. when manually delete (using sqlite expert)an entry in table datasets, coresponding entry in oned deleted expected. when delete entry in datasets entity framework not cause coresponsing entry in 1 d deleted. there no error generated. any idea why? regards here database definition: create table [datasets] ( [datasetid] integer not null on conflict fail primary key autoincrement, [description] text(128)); create table [oned] ( [onedid] integer not null on conflict fail primary key on conflict abort autoincrement, [datasetid] integer not null on conflict fail unique on conflict abort references [datasets]([datasetid]) on delete cascade, [stocksheetlength] integer not null on conflict fail); here how delete entry ef var datasets = ds in context.datasets select ds; foreach (var ds in datasets) context.datasets.deleteobject(ds); context.savechanges(); return true; from s...

.net - Handle special URL from desktop application -

i need way of having ssrs report 'talk' our desktop application. ssrs has open url command, thinking simple example; special://openconfigwindow/ , config window open in our application. i'm not sure happen web page though? unless there better way? this way, , how tomtom website communicates desktop client. believe you'll have register application against protocol in registry, can automated. this article point in right direction.

jquery - Tigerstipe rollover conundrum -

so have list of divs have alternating background colors through jquery. these have rollovers change background color. problem is, rollover function allows me animate class 1 background color on mouseout, said before, have alternating background color. how can handle in jquery? code below attempt @ if, else statement , odd, don't know proper syntax. $(document).ready(function() { $('.whycapad_staff:even').css({"background-color":"#eaebeb"}); $('.whycapad_staff').hover(function() { $(this).stop().animate({"background-color":"#5facf8"}, 300); }, function(){ if ($(this = ':even')){ $(this).stop().animate({"background-color":"#eaebeb"}, 300) }; else { $(this).stop().animate({"background-color":"#ffffff"}, 300) } }) }) just use css: .whycapad_staff:nth-child(even) { background-colo...

jquery - How can I change the CSS (BG Color) of a specific element with JavaScript Hover events? -

please patient me, new programmer , extremely unfamiliar client-side programming. first live project , wish quite few things not have knowledge of. the page in question can found @ http://paysonfirstassembly.com/ i attempting accomplish simple task. need change background color of specific element (can referred id, of course) when hovered over. know there other methods of doing this, frankly, brain fried being sick. also, if helps, using jquery. you use css, not jquery things this. in stylesheet, add :hover selector css style of element. new style deceleration gets rendered when element hovered: #original_element { background-color: blue; } #original_element:hover, .hover { background-color: red; } to support poor people ie6 , js (this works without js too), can use jquery function: $('#original_element').hover(function() { $(this).addclass('hover'); }, function { $(this).removeclass('hover'); });

jquery - Issue structuring JavaScript (separation of view and model logic) -

i'm working on javascript-heavy piece (using jquery) website (at moment, i'm working on getting prototype going). to summarize i'm doing, have series of 'icons'. each icon, @ moment, image. have series of 'buckets'. icons start in single bucket. user able create new buckets , drag icons around bucket bucket. icons can turned on , off clicking on them (although still remain in bucket). i have working fine @ moment, @ moment it's bunch of img elements getting moved around div div. when i'm ready start implementing server-side logic, i'm going need way communicate what's going on server. what need 'model' object reflecting what's going on view. it'd if when user ready send data server, i'd have object serialize representing need. example, if user has dragged email.png icon bucket options bucket, reflected in model object (i.e. { 'options': ['email'] }). the issue is, logic occurring based on events...

Linq Using Contains On An Array -

im trying query datatable using linq, ideally compare column of strings array of strings, returning match. any ideas? cheers in advance cm you need use 1 of field<t> methods of datarowextensions . var foo = r in dt.asenumerable() bar.contains(r.field<string>("barcolumn")) select r;

sql - Mysql Query perfomance. Which one is best? -

hi want know kind of queries multiple tables. for eg: select table1.id, table1.name table1,table2,table3 table1.id=table2.id , table2.id=table3.id or select table1.id, table1.name table1 inner join table2 on table1.id=table2.id inner join table3 on table2.id=table3.id 1 or select table1.id, table1.name table1 join table2 on table1.id=table2.id join table3 on table2.id=table3.id 1 which kind of query best performance? they should same. might want read corresponding section mysql manual (which syntax, not performance, however).

c# - Color item in a datagridview combobox column -

i have winform datagridview combobox column. possible color specific item in comboboxes? if yes, how can (in c#)? use combobox1_drawitem protected void combobox1_drawitem(object sender, system.windows.forms.drawitemeventargs e) { float size = 0; system.drawing.font myfont; fontfamily font= null; //color , font based on index// brush brush; switch(e.index) { case 0: size = 10; brush = brushes.red; family = font.genericsansserif; break; case 1: size = 20; brush = brushes.green; font = font.genericmonospace; break; } myfont = new font(font, size, fontstyle.bold); string text = ((combobox)sender).items[e.index].tostring(); e.graphics.drawstring(text, myfont, brush, e.bounds.x, e.bounds.y);

asp.net - SSO - Share single User table between several websites or somehow keep multiple User tables in sync? -

i'm working on single sign-on solution 2 asp.net mvc3 websites. sites on separate subdomains. i'm using forms authentication , far working well. when sign a.example.com i'm automatically signed in b.example.com too. nice. each application has own database. my question - if want keep user information in sync between 2 sites (say last activity date or user preference) should have user table in both databases , somehow keep them in sync or should a.example.com's database have user table , b.example.com somehow reads , writes it? thanks advice. edit: adam i'm leaning towards storing user data in separate database. pass authenticated user's username , id each application in authentication cookie. can offer advice around maintaining referential integrity between 2 databases? most sso solutions i've seen have central accounts portal users can maintain settings, change email address etc. think google: google.com/reader google.com/analyti...

OpenGL Math - Projecting Screen space to World space coords -

time little bit of math end of day.. i need project 4 points of window size : <0,0> <1024,768> into world space coordinates form quadrilateral shape later used terrain culling - without gluunproject for test only, use mouse coordinates - , try project them onto world coords resolved here's how exactly, step step. 0) obtain mouse coordinates within client area 1) projection matrix , view matrix if no model matrix required. 2) multiply projection * view 3) inverse results of multiplication 4) construct vector4 consisting of x = mouseposition.x within range of window x - transform values between -1 , 1 y = mouseposition.y within range of window y - transform values between -1 , 1 - remember invert mouseposition.y if needed z = the depth value ( can obtained glreadpixel) - can manually go -1 1 ( znear, zfar ) w = 1.0 5) multiply vector inversed matrix created before 6) divide result vector it's w component after mat...

wpf - How can I add sorting by clicking on the column header in this GridView? -

ipmo wpk $connectionstring = $connectionstring = "server=localhost;integrated security=true" $conn = new-object system.data.sqlclient.sqlconnection $conn.connectionstring = $connectionstring $conn.open() function invoke-sql1 { param( [string]$sql, [system.data.sqlclient.sqlconnection]$connection ) $cmd = new-object system.data.sqlclient.sqlcommand($sql,$connection) $ds = new-object system.data.dataset $da = new-object system.data.sqlclient.sqldataadapter($cmd) $da.fill($ds) | out-null return $ds.tables[0] } function show-bockmarks ($conn) { new-listview -name listview -view { new-gridview -allowscolumnreorder -columns { new-gridviewcolumn "title" } } -show -on_loaded { $ff_sql = @" select 'abc' title union select 'xyz' title union select 'efg' title "@ $tableview = $window | get-childcontrol listview ...

Android loading different contents in the same screen but different activities -

i new android , facing problem in calling different activities same screen same user interface. want implement d functionality of tab activity instead of tabs providing buttons , buttons should act tabs. unable that. going wrong where. can me please..... homescreen class is: public class homescreen extends activity implements onitemclicklistener { public integer[] images = { r.raw.mobile, r.raw.note_books, r.raw.ac, r.raw.drivers, r.raw.camera, r.raw.home_theaters, r.raw.pda, r.raw.tv, r.raw.washing_machines, r.raw.scanners }; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.grid); gridview gv = (gridview) findviewbyid(r.id.gridv); layoutinflater inflater = getlayoutinflater(); gv.setadapter(new gridviewadapter(images, inflater)); gv.setonitemclicklistener(this); if (staticutils.scheckstatus){ parsedat...

svn - Continuous Integration: managing configuration files targeting different environments? -

i'm setting ci our development , wanting know ideas/best practices on managing configuration files targeting different environments. the first approach comes mind keep environment-specific configuration files in different directories under version control, , use build platform such nant copy right configuration file environment in order: for instance, ci process follows process: subversion -> 1. buildarea -> 2. test env -> 3. beta. env. -> 4. live have 3 folders under version control called: dev.config/: global.asa, app.config test.config/: gloval.asa, app.config live.config/: global.asa, app.config and during successive steps 2, 3, 4 use nant copy right configuration file environment. perhaps might not ideal. tools focused more on continuous delivery rather continuous integration model environments you're deploying deployment process. ones allow specific environment specific parameters, , update template configuration file (and keep secret ...

java - Android with SDL compatibility -

i don't know if right place ask that, i'm looking start programming on android. i've completed few tutorials, train myself sdl library. i've seen on forums , websites sdl , android compatible, didn't see how, me on ? link ? thanks in advance you find description of how use official sdl android port here: http://www.libsdl.org/tmp/sdl/readme.android

Android EditText's cursor position tracking when clicking or toching by first time itself -

i struggling edittext morethan day. goal know current cursor positon user's first click on edittext. assume current cursor @ position "5", click edittext widget @ position "8", at moment getselectionstart() retrieve previous value "5". click edittext widget @ position "8" again, getselectionstart() retrieve position become "8", (this correct, need click twice @ same position) click on new position, situation repeat step3. just try: getselectionend() (if action doesn't contain selecting range of text.)

Google Cal API Python : Multiple delete with ExecuteBatch failure -

i try delete events of calendar using google api python. if delete events 1 one works fine it's long , not unoptimized try same thing using executebatch use insert lot of entries in calendar (and works fine before insert). def deleteallentryofcalendar(calendar_client, name_calendar): #request_feed doing delete request_feed = gdata.calendar.calendareventfeed() #get uri of cal we've delete entries uri = geturi(calendar_client, name_calendar) feed = calendar_client.getallcalendarsfeed() a_cal in feed.entry: if a_cal.title.text == name_calendar: calendar = a_cal #for each entry in cal, delete request entry in request_feed query = gdata.calendar.client.calendareventquery() query.max_results = 1000 feed = calendar_client.getcalendareventfeed(uri=uri, q=query) an_entry in feed.entry: an_entry.batch_id = gdata.batchid(text='delete-request') request_feed.adddelete(entry=an_entry) ...

objective c - IOS: change UIImageView with tag value -

i have 20 uiimageview , want change image; don't want create 20 iboutlet, , want use tag value change image; set tag value in interface builder , after? if want change image @ imageview number 15? how can do? if use tags can identify tagged view (uiimageview subclass of uiview, has tag attribute) this: - (uiview *)viewwithtag:(nsinteger)tag so if call method on superview (which uiimageviews reside in), should this: uiimageview *myimageview = (uiimageview *)[myawesomesuperview viewwithtag:15]; ( documentation found using google). p.s: if think work add 20 iboutlets, recommend create uiimageviews programmatically well. way not need xib file @ all, write small piece of code , have better maintenance less effort.

java - Recursive Table/Row Generator -

i'm having tough time wrapping head around following situation. best way explain may example i have map<column,set<row>> object. let's contains following data: columna['abc','def'] columnb['efg','hij','klm'] columnc['nop'] columnd['qrs','tuv','wxy','zzz'] i trying generate following output: row1[abc,efg,nop,qrs] row2[abc,efg,nop,tuv] row3[abc,efg,nop,wxy] row4[abc,efg,nop,zzz] row5[abc,hij,nop,qrs] row6[abc,hij,nop,wxy] etc... so in case there 24 rows total. however, number of columns , rows both dynamic. feel needs recursively done somehow i'm not sure start. any appreciated. update - made tree structure seems work. defaultmutabletreenode root = new defaultmutabletreenode(); set<defaultmutabletreenode> curnodes = new hashset<defaultmutabletreenode>(); curnodes.add(root); final set<column> keys = map.keyset(); (final colum...

ios - how to retrieve google calendar event's description using gdata? -

i retrieving google calendar events using gdata library in objective c iphone application, doing this, - (void)eventsticket:(gdataserviceticket *)ticket finishedwithentries:(gdatafeedcalendarevent *)feed error:(nserror *)error { if( !error ){ nsmutabledictionary *dictionary; for( int section=0; section<[data count]; section++ ){ nsmutabledictionary *nextdictionary = [data objectatindex:section]; gdataserviceticket *nextticket = [nextdictionary objectforkey:key_ticket]; if( nextticket==ticket ){ // we've found calendar these events meant for... dictionary = nextdictionary; break; } } if( !dictionary ) return; // should never happen. means couldn't find ticket relates to. int count = [[feed entries] count]; // count number of events callendar //0999999999999999999999999999999999666666666666666699999999999999999999999996666666666666666999999999999999999999999999999999999999999999999999999999...

postgresql - error connecting to database -

folks working fine few day ago. but getting following error when trying connect postgres database web application. org.apache.jasper.jasperexception: javax.servlet.servletexception: javax.servlet.jsp.jspexception: unable connection, datasource invalid: "org.postgresql.util.psqlexception: connection refused. check hostname , port correct , postmaster accepting tcp/ip connections." org.apache.jasper.servlet.jspservletwrapper.handlejspexception(jspservletwrapper.java:491) org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:401) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:313) org.apache.jasper.servlet.jspservlet.service(jspservlet.java:260) javax.servlet.http.httpservlet.service(httpservlet.java:717) root cause javax.servlet.servletexception: javax.servlet.jsp.jspexception: unable connection, datasource invalid: "org.postgresql.util.psqlexception: connection refused. check hostname , port correc...

javascript - How to upload/POST multiple canvas elements -

i have create image uploader future project (no flash, ie10+, ff7+ etc.) image resizing/converting/cropping on clientside , not on server. so made javascript interface user can 'upload' files , resized/cropped in browser directly, without ever contacting server. performance ok, not good, works. the endresult array of canvas elements. user can edit/crop images after got resized, keep them canvas instead of converting them jpeg. (which worsen initial performance) now works fine, don't know what's best way upload finished canvas elements server now. (using asp.net 4 generic handler on server) i have tried creating json object elements containing dataurl of each canvas. the problem is, when got 10-40 pictures, browser starts freezing when creating dataurls, images larger 2 megabyte. //images = array of uploadimage (var = 0; < images.length; i++) { var data = document.getelementbyid('cv_' + i).todataurl('...

MySQL update based upon postal code -

i have usertable includes field named zip (postal code) have geo table latitude, longitude values, based upon zipcodes. so: usertable table_1 contains fields: zip, latitude,longitude (in last 2 fields values null) geotable: table_2 contains fields: zip, latitude,longitude the zipcode in table_1 has format: 1111 aa (4 numbers, 2 letters, split empty character) the zipcode in table_2 has format: 1111 (only 4 numbers) i trying find out how update query should like? i want update usertable values geotable, search query can done without joins. search queries used queries on site, updates/checks seldom. thanks in advance help! you write update table_1 set latitude = (select latitude table_2 table_1.zip concat(table_2.zip, '%')), longitude = (select longitude table_2 table_1.zip concat(table_2.zip, '%')); unfortunately don't believe there syntax quite similar colin suggesting. may find more efficient select values table_2 first , inse...

graphics - Help to understand Pixelate effect -

i'm new hlsl , i'm trying understand pixelate sample. however, haven't been able find reference how couple of operations are. here shader example: //-------------------------------------------------------------------------------------- // // wpf shadereffect hlsl -- pixelateeffect // //-------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------- // shader constant register mappings (scalars - float, double, point, color, point3d, etc.) //----------------------------------------------------------------------------------------- float horizontalpixelcounts : register(c0); float verticalpixelcounts : register(c1); //-------------------------------------------------------------------------------------- // sampler inputs (brushes, including implicitinput) //-------------------------------------------------------------------------------------- sampler2d ...

c# - Watchdog for COM Thread -

i developing wcf application not adhere idea world of true soa in have few basic calls. 1) start process 2) check if process still running 3) results this fine, in order execution return 'start process' running code in separate thread using othread = new thread(new threadstart(wbrt.calculate)); the problem has been known (though rare) com call hog , sit @ 50~100% cpu , consume lots of memory. there nothing can prevent this. what want have watchdog thread kill off com call if still running after time (say 5 minutes). is there best practice here? have been reading following blog: http://weblogs.asp.net/israelio/archive/2004/06/19/159985.aspx in makes use of 'autoresetevent' , 'waitone' problem here waitone blocking i'd have have thread within thread. could use simple thread timer here? saw timer execute if thread has closed (i.e. finished ok) problem if use flag or stop use of dead objects? also creating com object using activator.creat...

firefox addon - Use Remote Content Script File/Javascript in Page-Mod -

is there way use remote javascript file content script page-mod api ? i trying build simple addons own use automate repetitive stuff. because pages modding change time time, , need updating "content script" javascript accordingly, nice if had edit on server , addon/extension work again without editing , repacking xpi. i'm pretty sure able hack accomplish this, if there easy way i'm ears :) the content script should never remote script, security vulnerability. content script can insert remote script web page: var pagemod = require("page-mod"); pagemod.pagemod({ include: "...", contentscript: 'var script = document.createelement("script");'+ 'script.src = "...";'+ 'document.body.appendchild(script);' });

java - How to retrieve an Element mixed children as text (JDOM) -

i have xml following: <documentation> value must <i>bigger</i> other. </documentation> using jdom, can following text structures: document d = new saxbuilder().build( new stringreader( s ) ); system.out.printf( "gettext: '%s'%n", d.getrootelement().gettext() ); system.out.printf( "gettextnormalize: '%s'%n", d.getrootelement().gettextnormalize() ); system.out.printf( "gettexttrim: '%s'%n", d.getrootelement().gettexttrim() ); system.out.printf( "getvalue: '%s'%n", d.getrootelement().getvalue() ); which give me following outputs: gettext: ' value must other. ' gettextnormalize: 'this value must other.' gettexttrim: 'this value must other.' getvalue: ' value must bigger other. ' what wanted content of element string, namely, "this value must <i>bigger</i> other." . getv...

Copying options and optiongroups with jQuery -

i have found great jquery snippet allows copying of option 1 selector , back. i modify add option groups , when options moved 1 side another, have option group removed empty group , add full group in new selector. can accomplished using jquery? html: <select multiple id="select1" class="w100p"> <optgroup label="group 1"> <option value="1">option 1a</option> <option value="2">option 1b</option> </optgroup> <optgroup label="group 2"> <option value="3">option 2a</option> <option value="4">option 2b</option> </optgroup> </select> <a href="#" id="add">add >></a> <br> <a href="#" id="remove"><< remove</a> <select multiple id="select2" class="w100p"></sel...

Facebook Page -- Dynamic HTML Based on User -

i'm looking create facebook page dynamic content based on user visiting page. example, if user has "liked" consisting of "soccer" display little module soccer... or if liked "baseball" display baseball. i guess overall question is: "what content fb allow developers scrape , use in code?" want utilize on static fbml application. thanks in advance! you may want check open graph documentation: http://developers.facebook.com/docs/opengraph/ graph api: accessing profile data http://developers.facebook.com/docs/reference/api/ in order request , receive extended information profile need setup signed request graph api. can done custom facebook app.

c# - Line Chart with date and time on X axis -

i working line chart using zedgraph , c# in visual studio 2010. values ​​are coming serial port. date , time entering x axis, each interval number of seconds change , seems weak , lacking harmony. how solve this? this video shows problem. maybe try using: mypane.xaxis.type = axistype.date; mypane.xaxis.scale.format = "hh:mm"; mypane.xaxis.scale.majorstepauto = false; mypane.xaxis.scale.minorstepauto = false; mypane.xaxis.scale.majorunit = dateunit.minute; mypane.xaxis.scale.minorunit = dateunit.minute; mypane.xaxis.scale.minorstep = minor; mypane.xaxis.scale.majorstep = major; mypane.xaxis.scale.min = min; mypane.xaxis.scale.max = max; mypane.xaxis.scale.maxauto = false; mypane.xaxis.scale.minauto = false; mypane.yaxis.scale.min = min_rr; mypane.yaxis.scale.max = max_rr; for minorstep , majorstep must use value 3, 5, 30 etc. max , min use eg: ...

css - Why part of an 'absolute' positioned DIV element in a table cell is not shown (in Google Chrome only) -

to demonstrate issue, below html file displays tall div (named div1), initial hidden, , button show or hide div1. open in google chrome, click on button show div. notice div displayed, there no way see lower part because tall fit in window , chrome not display scroll bar. if open in firefox, there no such issue. firefox displays scroll bar when div1 shown can scroll see lower part. <html> <head> <script src="http://api.prototypejs.org/javascripts/pdoc/prototype.js" type="text/javascript"></script> </head> <body> <input type="button" onclick="$('div1').toggle();" value='toggle'></input> <table> <tr> <td> <div style="position:relative"> <div style="position:absolute"> <div id='div1' style="position:absolute; height:1500px; width: 200px; border: 1px solid gray; d...

iphone - "Application failed codesign verification" on non-wildcard provisioning on Xcode 4.2 -

on xcode 4.2, validate binary signed wildcard provisioning, not non-wildcard provisioning (for push notification). anyone has same problem? for push notifications, have have unique app id (without *). app ids specific bundle id can used apns. cannot use “wild-card” application id.

android - linear layout are not getting divided equally when the text width inside them are changing -

i have linear layout (horizontal) inside there 3 linear layouts, each of them have textview inside them. now wanted divide these linear layouts equally. added weight them 1. works perfect. but when text width inside them varying no more of equal weight :( say linear layout removed text, or wrote smaller text or varying length text loosing equal distribution. do make layouts uniformly distributed. and 1 more thing know text width increases max allocated width these layout (these given dynamically may doing width = 1), how move text next line. make sure set width 0dip each item inside linearlayout.

How to remove row based on clicking on a separate div in Jquery/Javascript? -

i want know best way accomplish following. i have table: <table> <tr><td>1</td><td>some1</td></tr> <tr><td>2</td><td>some2</td></tr> <tr><td>3</td><td>some3</td></tr> </table> when click on td (1,2,or 3), div visible id "#removediv" has basic text "remove". click on div, , row had clicked on div show, removed. i imagine have pass information row or index "#removediv" object #removediv event handler know row remove. not sure how best go doing this. var remove = null; var caller = null; $(function() { remove = $('#removediv'); $('td').click(function() { caller = $(this).parent('tr'); remove.show(); }); remove.click(function() { caller.remove(); $(this).hide(); }); });

python - APScheduler not starting? -

i run python script during night , thinking of using apscheduler. i'll start running @ 1am of following night , run once every night my scheduler script looks (scheduler.py): from apscheduler.scheduler import scheduler datetime import datetime, timedelta, time, date def myscript(): print "ok" if __name__ == '__main__': sched = scheduler() startdate = datetime.combine(date.today() + timedelta(days=1),time(1)) sched.start() sched.add_interval_job(myscript, start_date = startdate, days=1) in shell, do: python myscheduler.py & disown (i'm running remotely, want run in background , disown it. immediately, number (pid) appears below line, every other python script do. when ps -e | grep python, number not there. tried kill -9 pid , got message saying job not exist. is scheduler running? if yes, how can stop it? if not, doing wrong? you have keep script running otherwise after sched.add_interval_job(myscript, start_dat...

php - � appears using character_limiter() with strip_tags() and utf-8 charset -

Image
i'm getting � characters when combine codeigniter's character_limiter() php's native strip_tags() . here code i'm using: <?php echo character_limiter(strip_tags($block->body), 60); ?> $block->body html string stored in database. not unexpected output if use 1 of functions. looks this: this html looks like: i didn't paste actual html because string modified posting here, see below here codeigniter function character_limiter : function character_limiter($str, $n = 500, $end_char = '&#8230;') { if (strlen($str) < $n) { return $str; } $str = preg_replace("/\s+/", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str)); if (strlen($str) <= $n) { return $str; } $out = ""; foreach (explode(' ', trim($str)) $val) { $out .= $val.' '; if (strlen($out) >= $n) ...

asp.net - No overload for 'GridView_RowUpdating' matches delegate 'System.Web.UI.WebControls.GridViewUpdateEventHandler' -

i have gridview defined in aspx page defined below: have defined event handler in codbehinb following signature: protected void applicantgridview_rowupdating(object sender, gridviewupdatedeventargs e) { e.newvalues["fk_workerid"] = workersdropdownlist.selectedvalue; } i able build web project sucessfully, when open page in browser above error. <asp:gridview id="applicantgridview" runat="server" autogeneratecolumns="false" datasourceid="applicantsobjectdatasource" datakeynames="applicantid" onrowupdating="applicantgridview_rowupdating" > <columns> <asp:commandfield showeditbutton="true" showdeletebutton="true" itemstyle-verticalalign="top"> <itemstyle verticalalign="top"></itemstyle> </asp:commandfield> <asp:dynamicfield datafield="casename" headertext="case name...

Scala Set Hashcode -

assume have 3 sets of strings in scala. 1 has elements a,b,c. 2 has elements b,c,d. , 3 has elements j,k,i. my first question is, there way hashcodes 2 of these sets same? second question is, if add d 1 , 2 new sets one.n , two.n, hashcodes one.n , two.n same? question 1) in general yes, entirely possible. hashcode limited number of bytes long. set can size. hashcodes cannot unique (although are). question 2) why not try it? scala> val 1 = collection.mutable.set[string]("a", "b", "c") one: scala.collection.mutable.set[string] = set(a, b, c) scala> one.hashcode res3: int = 1491157345 scala> val 2 = collection.mutable.set[string]("b", "c", "d") two: scala.collection.mutable.set[string] = set(b, d, c) scala> two.hashcode res4: int = -967442916 scala> 1 += "d" res5: one.type = set(a, b, d, c) scala> 2 += "a" res6: two.type = set(b, d, a, c) scala> one.hashcode res7...

MySQL configuration: when to use hyphen and when to use underscore -

in mysql configuration options use _ , use - . there way identify when use 1 versus other?. no. it's 1 of things happen when team of people design product. different conventions used leading inconsistency. see here: http://dev.mysql.com/doc/refman/5.5/en/mysqld-option-tables.html and scroll options starting ssl , you'll see mean.

iphone - how to access mp3 files other than resource folder's mp3 files -

please tell me there way access mp3 files other resource folder's mp3 files. i thankful stackoverflow code: - (bool)uploadimage:(nsdata *)imagedata filename:(nsstring *)filename{ nsstring *filepath = [[nsbundle mainbundle] pathforresource:@"rockstar" oftype:@"mp3"]; nsdata *mydata = [nsdata datawithcontentsoffile:filepath]; } i want access mp3 files iphone library or other folder. although not possible directly access files in folder outside application, can search user's music library , play music using mediaplayer framework. there complete guide at: http://developer.apple.com/library/ios/#documentation/audio/conceptual/ipodlibraryaccess_guide/introduction/introduction.html

VS 2010 - Entity Framework with MySql Stored Procedure doesnt seem to work -

i want work entity framework (edmx file) , mysql database. tables , views, vs 2010 works fine, said, can generate model classes, csdl, ssdl etc files well. but, stored procedures doesn't work. here happens.. right clicked on sp model browser, select [add function import]. opened dialog box filled appropriate values like, function import name, stored procedure name click on [get column information]. results grid filled @ bottom of button. in grid, there column named [edm type]. column shows [not supported] due unknown reason :( now, clicked on [create new complex type]. goes ok, without error now, clicked on ok button after doing above steps, there no complex type created in code however, problem. can please help? i 'solved' lettting entity framework create paramerterless definition , associations , manually added parameters xml & generated cs file. public virtual objectresult<nullable<int>> <stored_procedure>(datetime d...

ruby on rails - Partial rendering one time too many for collection -

creating simple blog application, i have partial .comment %p %b namn: = comment.name %p %b kommentar: = comment.content %p = link_to 'destroy comment', [comment.post, comment], :confirm => 'are sure?', :method => :delete and called from = render :partial => 'comment', :collection => @post.comments it renders partial 1 time many? edit: it has form = form_for ([@post,@post.comments.build]) as depicted in comments of question, @post.comments.build culprit. change to = form_for ([@post, @post.comments.new]) and additional item when rendering collection should gone. there post difference of build , new here: build vs new in rails 3

c++ - Accessing derived objects in boost::ptr_vector -

i using boost::ptr_vector < class > , use store objects of class b : public class a. want able access class b objects in vector; how cast access? ideally, a should provide virtual interface allows access parts of b need. if need access actual b objects, need use dynamic_cast on reference yielded iterator container (you use static_cast if knew certainty iterator pointed @ b object): // create container , insert new element it: boost::ptr_vector<a> s; s.push_back(new b()); // reference element inserted: b& b_ref = dynamic_cast<b&>(*s.begin()); if wanted iterate on b elements in container (and skip on non- b elements), using combination of boost's transform_iterator (to convert each a& b& ) , filter_iterator (to skip on non- b elements in container).

c# - Problem adding datapoint dynamically to chart. No value shows up -

i'm trying learn charting control in asp.net, having problems. all want make simple column chart. every column should have name. want manipulate data database in codebehind , add column chart, name on column. the examples i'm reviewing adds them in .ascx file. doing same thing in codebehind should straight forward, somehow not work. example i'm looking @ this: <asp:chart id="chtnbachampionships" runat="server"> <series> <asp:series name="championships" yvaluetype="int32" palette="berry" charttype="column" chartarea="mainchartarea" isvalueshownaslabel="true"> <points> <asp:datapoint axislabel="celtics" yvalues="0" /> <asp:datapoint axislabel="lakers" yvalues=" /> <asp:datapoint axislabel="bulls" yvalues="6" /> ...

c - How can I stop scanf-ing input after a certain character? -

i'm working on function takes filepaths , dices them smaller sections. for example, if input parameter "cd mypath/mystuff/stack/overflow/string", want able return "cd" "mypath", "mystuff", "stack", "overflow", , "string" in succession. while continually use "getchar", appending results ever-increasing string, stopping when getchar returns '/', feel there must more elegant way achieve same functionality. any ideas? you can use char * strtok ( char * str, const char * delimiters ); using / separator. an example here: http://www.cplusplus.com/reference/clibrary/cstring/strtok/ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { if (argc != 2) { fprintf(stderr, "usage: %s path\n", argv[0]); exit(exit_failure); } char* saveptr = null; (char* str = argv[1]; ; str = null) { char *token ...

Two Flash questions -

what _level0,_parent , _root mean in flash? what's difference between absolute path , relative path? levels in flash base root element of everything. every level has associated _root element, base of attached movieclips, whether on stages or dynamically loaded. _parent previous element along element hierarchy. example, if _root has movie clip n loaded it, n._parent == _root . absolute path , relative paths mean exact same thing in os. relative path relative initial container clip. absolute path absolute os.