Posts

Responsive page height as a div expands html css -

my situation: on page have multiple collapsible panels in right hand column of main content. @ moment happens when expand panel (which contains large amount of text) goes off page. therefore meaning user can't read it. due fact height hard coded. want happen when div expands, if reaches max height of page, page height expands incorporate of text. question: there way make possible page height expands along div? my css: .container { width: 1000px; margin: 0px auto; background-color:white; height: 0px auto; } #page { overflow: hidden; width: 900px; padding: 0px 50px 50px 50px; background-color: #ffffff; } #content { float: right; width: 580px; } thankyou suggestions instead of using height try set position "absolute" , 0px top , bot on .container? .container { width: 1000px; margin: 0px auto; background-color:white; top: 0px; bottom: 0px; }

c - Why am I getting a segfault here? -

code split data training / test subsets below. note data_points 1 long vector of size items*attr, , data_labels vector of size items. int split_data(int items, int attr, double *data_points, int *data_labels, double **split_train_points, int **split_train_labels, double **split_test_points, int **split_test_labels) { srand(time(null)); int i, j; double temp0, temp1; double sorter[items][2]; *split_train_points = malloc(floor(split_prop*items * attr) * sizeof(double)); *split_train_labels = malloc(floor(split_prop*items ) * sizeof(int)); *split_test_points = malloc(ceil((1-split_prop)*items * attr) * sizeof(double)); *split_test_labels = malloc(ceil((1-split_prop)*items ) * sizeof(int)); // create 2d array element number in 1 column , random number in other (i = 0; < items; i++) { sorter[i][0] = i; sorter[i][1] = rand() / (double)rand_max; } // sort random number column (i = items-1; > 0; i--) { (j = 1; j <= i; ...

jQuery Variable width slider -

i hate asking these kind of questions, running out of time. i prefer write sliders , carrousels etc own time limited. having tried numerous different carrousels, none seem want. what need carousel full-width , has fixed height. items shown should variable , widths of items, width of slider should filled slider items, if shown partially , should circular. i created jsfiddle: http://jsfiddle.net/bfs3q/ mighy explain question better, used caroufredsel plugin need not show items partially. perhaps if knows how caroufredsel, here used: $("#slider").caroufredsel({ width: "100%", align:"left", height: 150, direction :"left", items: { minimum: 1, start: 8, width: "variable", height: 150, visible: "variable" }, scroll: { items: 1, easing: "linear" }, auto:...

Using Portable Class Libraries with Windows 8 / Windows Phone 8 MVVM - Page Navigation -

i'm developing app both windows 8 , windows phone 8. chose implement portable class library , share between 2 platforms. problem can't figure out how handle page navigation in pcl. i've used example folowing tutorial: using portable class library highly appreciated. thanks. the best approach create own abstraction around navigation. i'd create interface inavigationservice , , in non-pcl assemblies each platform create implementation of interface wrapping appropriate control (frame winrt , phonenavigationframe windows phone 8). i'd recommend looking @ source of caliburn.micro has similar approach abstract navigation. here sample shows how this: sharing code: adding navigationservice

.net - menu loading error in XNA project to load 3D menu -

i trying 3d menu in xna getting error following "the name 'item_ontap' not exist in current context." new xna programming.thank in advance. //modelmenugame.cs public class modelmenugame : microsoft.xna.framework.game { graphicsdevicemanager graphics; spritebatch spritebatch; spritefont font; model menuitemmodel; vector3 cameraposition; matrix view; matrix projection; list<modelmenuitem> menu; int totalmenuitems = 4; rectangle leftregion; rectangle rightregion; int currentindex = 0; public event eventhandler ontap; public modelmenugame() { graphics = new graphicsdevicemanager(this); content.rootdirectory = "content"; targetelapsedtime = timespan.fromticks(333333); // extend battery life under lock. inactivesleeptime = timespan.fromseconds(1); } ...

javascript - swipeJS with jquery mobile -

Image
i tried implement swipejs in jquery mobile application. here code of page on implement swipejs. full code: http://jsfiddle.net/unths/ (output on jsfiddle not same) <div id="slider" data-role="page"> <div data-role="content" id="contentslider"> <div id='myswipe' style='max-width:500px;margin:0 auto' class='swipe'> <div class='swipe-wrap'> <div><b>1</b></div> <div><b>2</b></div> <div><b>3</b></div> </div> </div> <div style='text-align:center;padding-top:20px;'> <button onclick='myswipe.prev()'>prev</button> <button onclick='myswipe.next()'>next</button> </div> </div> my problem is, following output. every "picture" on side. no picture slide. i have no idea whats problem is. :( i got workin...

nsurl - how to convert %20 to space in Iphone SDK -

i working on app, in interacting web-service of time. getting problem when added space on somewhere convert space %20 when converting url request. googled couldn't find healthy solution according requirement because changing when url request. here doing. url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; request = [nsurlrequest requestwithurl:[nsurl urlwithstring:url]]; nslog(@"request : %@", request); [[nsurlconnection alloc] initwithrequest:request delegate:self]; and on nslog show me %20 ever space given. if know kindly suggest me better way solve issue. great me. in advance. you converting spaces %20 instruction: url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding] but necessary in order correct nsurlrequest , characters need conversion. you can reconvert them "normal" characters using other nsstring method: – stringbyreplacingpercentescapesusingencoding

iphone - UIScrollView in IOS -

i have gridview using, has header, side bar , gridview inside, have setup scrolling it's not working way want it. i'm trying make scrolling when scroll horizontally left side bar stay while grid scrolls when scroll vertically want move grid. , wanted header @ top same, vertically scrolling make stay , horizontally scroll make move grid. i have done scroll view moves , doesn't work right. so can please me, thanks. the best way so, move inside views of scollview in opposite direction of scrollview example have uiview called "bar" in scrollview, need detect every time scollview scolls delegate , move "bar" it: - (void)scrollviewdidscroll:(uiscrollview *)scrollview { // move horizontal if (self.lastcontentoffsetx != scrollview.contentoffset.x) { [bar setframe:cgrectmake(scrollview.contentoffset.x,bar.frame.origin.y, bar.frame.size.width, bar.frame.size.height)]; } // move vertical if (self.lastcontentoffsety != sc...

c# - Starcounter LogSource -

i'm trying out starcounter beta, , create logsources. i did find class starcounter.logsources , has property hosting of type starcounter.logging.logsource . but don't understand how define own log source, appreciated. sorry documentation wasn't enough in case; it's 1 of things working on improve. the starcounter.logsources class single place keep few well-known log sources, sql , hosting (that mentioned). these used database engine. to create , start logging own source, it's easy as: var log = new logsource("foo"); log.logwarning("i've break loose!"); just make sure you've referenced starcounter.logging assembly.

html - addClass, removeClass, css jquery functions does not work -

i found this page , need change font color black white. i tried these ways did not work: jquery add class function (to add class span tag) jquery remove class function(to remove class scrollingnews marquee tag) jquery css function (to add css span tag) code: $(document).ready(function() { $('#tickerv span').addclass('test'); $('marquee').removeclass('scrollingnews') $('#tickerv span').css({color: white}); }); please can help? thanks try this $('span').css({ 'color': 'red'});

Java code to generate JSON hierarchical path -

i working on project need parse json in java , display hierarchical path of json key/node mentioned below. i'm developing program in java using jackson api not able readily available api return me hierarchical path of current key/node json. json data - {“tomcat-users”: { “role”:[ {“@rolename”:”manager-gui”}, {“@rolename”:”manager-script”}, {“@rolename”:”manager-jmx”}, {“@rolename”:”manager-status”} ], ”user”:{ “@username”:”admin”, ”@roles”:”manager-gui,manager-script”, ”@password”:”admin” } } } output should like - column 1 column 2 --------------------------------------------------------------------------- tomcat-users -> role[1] -> @rolename manager-gui tomcat-users -> role[2] -> @rolename manager-script tomcat-users -> role[3] -> @rolename manager-jmx t...

php - How to Select 1 Row From Each 10 Rows in MySQL -

i recording real time change of given signal database table. then draw line graph visualize change of signal level. i want (10n+1) th rows in table make rough graph. 10 arbitrary. user may change value. does know how make just using mysql query if no, go php after selecting data. here table structure is: |id |signal1 |signal2 | signal 3 | +----------+----------+----------+------------+ |1 |0.41452 | 1.32135 | 0.31231 | ... if have auto_incrememt id column, can select rows divisible n select * tablename1 mod(id,10)=0; // id divided 10 remainder equal 0 (exact) or without sequential column id's select * ( select @row := @row +1 rownum, colname1 ( select @row :=0) r, tablename1 ) ranked rownum % 10 = 1

KeyListener error -

i have problem adding keylistener aplication: app.game not abstract , not override abstract method keyrelased(java.awt.event.keyevent) in java.awt.event.keylistener i try create new public class keyadapt . gives same error. code of application the: public int x = 100, y = 100; public class game extends jframe implements keylistener { public game() { super(); setdefaultcloseoperation(jframe.dispose_on_close); setlocationrelativeto(null); setundecorated(true); setlayout(null); setvisible(true); } public void paint (graphics gdc) { gdc.clearrect(0, 0, getsize().width, getsize().height); getgraphics().drawoval(x, y, 20, 20); } public void keypressed(keyevent e) { if (e.getkeycode() == keyevent.vk_up ) { y++; } if (e.getkeycode() == keyevent.vk_down ) { y--; } if (e.getkeycode() == keyevent.vk_right ) { x++; ...