Posts

Showing posts from July, 2010

css - Fixed table layout overflow to the side -

problem i have fixed width table (which must be) , 1 of cells contains text long fit within it, overflows outside cell right. i need have table cells' text aligned right. i ideally don't want change of markup. what i'm looking for i'm in need of finding someway (text in example) "longlonglong" overflow left on other previous cells , maintain it's aligned right state. code html <table width="120"> <tr> <td width="30">text</td> <td width="30">text</td> <td width="30">text</td> <td width="30">very longlonglong text</td> </tr> </table> css td { text-align: right; border: 1px solid black; vertical-align: top; } table { border: 1px solid red; table-layout: fixed; } example http://jsfiddle.net/xareyo/evkgz/ thankyou time. see http://jsfiddle.net...

c# - Static string using File.ReadAllText -

i attempting use file.readalltext static readonly string. issue compiling .netz , when program starts looks string , if not found nasty exception. possible around using if/else somehow? usually have popup messagebox or in label stating file not found.using .netz if file not found error message , program not start. this static string used throughout program static readonly string config = file.readalltext("config.ini"); i using .netz include dll. rather doing inline declaration, move work static constructor. becomes trivial add try/catch blocks handle error cases see fit: public class myclass { static readonly string config; static myclass() { try { config = file.readalltext("config.ini"); } catch (filenotfoundexception) { //do else //use default configuration? //report user? //crash , burn? } } } note there many re...

javascript - Highcharts data plugin decimal separator -

if got highcharts 3 data plugin read values table. not problem english because of . decimal separator. in dutch table uses , decimal separator. graph don't show because of data plugin can't see 5,5 same 5.5. this javascript code: <!-- language: lang-js --> $('#grafiek620').highcharts({ chart: { type: 'bar' }, credits: { enabled: false }, data: { table: document.getelementbyid('datatable620') }, title: { text: jquery('#datatable620').data('labeltitle') }, xaxis: { labels: { rotation: 0 }, title: { text: jquery('#datatable620').data('labelx') } }, yaxis: [{ min: 0, title: { text: jquery('#datatable620').data('labely') }, labels: { rotation: 0 } }, { opposite: true, title: { text: jquery('#datatable620').data(...

node.js - Are there any good patterns for controlling flow based on sequences of events in Node? -

in node it's easy create evented architecture. if have client of streaming api (via socket.io) don't control, , client needs react differently based on varying sequences of events. example of 2 different sequences: first order placed > 2nd order placed first order placed > first order hit trade > 2nd order placed so far using transform streams , i'm thinking of creating complicated custom logic buffers desired messages when need , acts upon them, wanted know if there best practices deal kind of situation. thanks the idea define set of objects define event sequences , when first event matches, copy sequence , pop elements of array until have no more elements. if encounter event doesn't match, reset current buffer. var events = [ { sequence : ['event 1', 'event 2', 'event4'] handler: firstsequencehandler }, { sequence : ['event 3', 'event 2'] handler: secondsequencehandler } ]; subscribe event...

php - $_COOKIE suddently does not return any value -

i have have problem code used run 6 month , yesterday page went blank! after debug found cause $_cookie. have cookie variable : $_cookie['company']; used return number doesn't return nothing. have no idea why did happened! didn't change thing in file.. can cause cookie not return value anymore? any idea appreciated thanks sounds cookie in web browser expired. login page somewhere on site reset it.

asp.net mvc 3 - Partial View vs Json In MVC3 -

i using mvc3 razor new stuck below point. in code giving ajax call using jquery json passing array of selected list on button click on controller side , performing opration there , trying call "partial view" can not see contents of partial view on page(not got render). can on this. jquery code: $(function () { $('#btnadd').click(function () { var selectedlist = []; $("#ddlsupplementalcalculationlist option:selected").each(function (i, selected) { var $this = $(this); selectedlist.push({ id: $this.val(), value: $this.text() }); }); getcalculationlistgrid(selectedlist) }); }); function getcalculationlistgrid(selectedlist) { $.ajax( { url: "addselectedlist/supplementalpricing", type: "post", datatype: "json", traditional: true, data: {selectedli...

jquery - mouseenter same item on mouseleave -

i have edited script act need it.. i need #currentitem mouseenter on page load, mouseleave when item triggers mouseenter (so not overlap). i have problem works intended. apart when mouseleave #currentitem need dropdown stay visible. time not visible (or mouseenter) when mouseenter other menu items. i have created jsfiddle current item 'about us' menu: http://jsfiddle.net/qfs84/2/ $(document).ready(function(){ $("#currentitem a").trigger('mouseenter'); }); $(".submenu").mouseenter(function(){ $("#currentitem").trigger('mouseleave'); }); $(".submenu").mouseleave(function(){ $("#currentitem a").trigger('mouseenter'); }); any appreciated. i've made progress on issue helps little. http://jsfiddle.net/z2zmz/5/ $('#currentitem').mouseout(function(){ $("#currentitem > a").trigger('mouseenter'); }) this biggest problem looking events happened...

Mobile option to view site in fullscreen (wordpress theme: twentytwelve) -

i have modified twentytwelve theme responsiveness on website. it, client option on mobile view website in full width. is possible? maybe plugin? maybe somehow can put link on mobile website removes "viewport" meta tag it'll viewed in full screen? to create version of website not responsive can go twentytwelve's style.css file , edit media queries. scroll down media queries section , edit "min-width" property, default set 600px. basically query saying every browser width larger 600px, full desktop version of site shown. if change min-width 1px, example, desktop version shown.

android - Is it ok to put large no. of images in drawable -

i new android in app using around 600 images. there jpeg of average size of 4.0kb, total auround 2.4mb. have these images in res/drawable/. ok have many images in drawable ? or should move them in sd card. considered store them in sqllite see not recommended. there other alternative ? 2.4mb isn't much, should fine. however, if expect go up, or require 2.4mb each drawable folder, should consider downloading them sd card when required. internal storage on devices limited mostly, , users uninstall apps take space quite often. you set installlocation in manifest auto allow app moved sd card

sql - Tablix headers not repeating in SSRS 2008 -

i have created new report & add table it. when select "tablix properties" , check on columns headers -> "repeat cheader columns on each page" header columns not repeat on each page. tried "repeat header rows on each page". "add page break before" seems work ok. using vs 2008 9.0.30729.1 sp i tried deploying still not work on deployed version. interestingly, reports migrated 2005 & unchanged seem ok. any ideas? not setting properly? in grouping section there pull-down let switch advanced mode. click that. once you've got advanced mode activated see number of (static) objects show in groups -- these headers. highlight static row above =(details) in row groups, in properties pane static group option repeatonnewpage; setting true repeat headers. here blog post found this.

javascript - How do I change the default text in dropzone.js? -

i using dropzone.js upload files. however, i'm having difficulty changing default text. i've tried instantiating dropzone class: $(document).ready(function(){ $(".foo").dropzone({ dictdefaultmessage: "hello" }); }); with markup: <div class="span4"> <form action="http://localhost/post" method="post" accept-charset="utf-8" id="drop3" class="foo" enctype="multipart/form-data"> </form> </div> <div class="span4"> <form action="http://localhost/post" method="post" accept-charset="utf-8" id="drop4" class="foo" enctype="multipart/form-data"> </form> </div> this gives me ability upload files default text blank. i tested following: $(".foo").dropzone(); and appear same result - no default text. so.. how change default text? ...

ios - How can I convert my transparent PNG image to a Hexadecimal string? -

within sdk i'm using within 1 of apps there images. these images not listed image files hexedecimal encoded strings like: unsigned char mastclosebutton_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa8, 0x86, 0x3b, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x2e, 0x23, 0x00, 0x00, 0x2e, 0x23, 0x01, 0x78, 0xa5, 0x3f, 0x76, 0x00, 0x00, 0x0a, 0x4d, 0x69, 0x43, }; no i'd adjust image within sdk unfortunately don't know how convert .png file hexadecimal string listed above. are there tools convert .png image (with transparency) hexadecimal string? try following code, might helpful you: nsdata *imagedata = [[nsdata alloc]initwithdata:uiimagepngrepresentation(myimage.image)]; nsstring *imagestr = [gtmbase64 stringbyencodingdata:imagedata]; or follow: http://kelp.phate.org/2012/05/high-p...

c - segmentation fault while running the programme -

i have written code parsing string words. here code. can 1 here fix segmentation fault error during run time? calling fun : int main() { int count = 0, i; // count hold numbr of words in string line. char buf[max_lenths]; // buffer hold string char *options[max_orgs]; // options hold words got after parsing. printf("enter string"); scanf("%s",buf); count = parser(buf,options); // calling parser for(i = 0; < count; ++i) printf("option %d %s", i, options[i]); return 0; } called function: int parser(char str[], char *orgs[]) { char temp[1000];//(char *)malloc(strlen(str)*sizeof(char)); int list = 0; strcpy(temp, str); *orgs[list]=strtok(str, " \t "); while(((*orgs[list++]=strtok(str," \t"))!=null)&&max_orgs>list) list++; printf("count =%d",list); return list; } note : i'm trying learn c these days, c...

visual studio 2012 - Web Essentials v2.8 LESS import error -

Image
for better organization, have main .less file imports other .less files using @import syntax. in order web essentials preview window work have @import-once @ top of each .less file imports variables.less file. this solution worked wonderfully until upgraded web essentials 2.8. i'm unable import .less file has @import or @import-once declared in it. main .less file no longer compiles. if remove @import-once statements, preview window useless since can't see compiled css without importing variables file. i had case imported .less file ruleset, defined lesscss.org in importing ruleset section. no longer works since upgrade v2.8. has else experienced these issues or have resolution? thanks this seems bug -> feature in latest version of webessentials because of new feature in less 1.4.0. anwar describes. see the changelog of less : 1.4.0 beta 1 & 2 (2013-03-07) default behaviour of import import each file once. @import-once has be...

javascript - Onclick Menu opening slowly -

i have jquery onclick menu works great in ie9+, chrome , firefox. in ie8 opens extremely slowly. takes approximately 10 seconds menu show, , none of animations play, menu appears. the menu uses latest version of jquery (v1.10.2) , uses slide , animate open , close different parts of menu. have tried googling various combinations of slow jquery, slow loading menus , slow animations ie8 , jquery can, , cannot find remotely issue i'm having. you can see problem going website here . visit ie8 , notice slow speeds when click on test category 1 or 2. has come across kind of issue before? know causes , solution working fine? edit i have noticed it's not affecting menu, carousel. if @ animations not sliding either, in ie9 + slide. i'm not sure if 2 linked seems odd it's both jquery effects being affected. edit 2 after more testing have noticed if bottom of menu falls on tabs below carousel bit on tabs shows straight away, if on tabs. same happens when close me...

MySQL : Select on timestamp column, change seconds to 00 and round minutes down to nearest 10 -

i have table timestamp column this: 2013-04-05 22:33:50 2013-04-05 22:42:03 2013-04-05 22:42:03 i want make select on , receive results seconds 00 , minutes rounded down nearest 10. as: 2013-04-05 22:30:00 2013-04-05 22:40:00 2013-04-05 22:40:00 how done? cannot update or insert on table, select. here go: select date_sub(date_sub(ticktick, interval mod(minute(ticktick),10) minute), interval second(ticktick) second) `table`

android - Unable to install a release build of APK -

i created app worked in emulator , in devices when tested. used export option generate signed apk release. apk not installing , showing error message "unable install" when installed sd-card. debug version works well. how should proceed. once have installed app, can not install version of app if signed different certificate. need go settings , remove installed version.

query optimization - What's the sqlite's cost model? -

i found "sqlite uses cost-based query planner estimates cpu , disk i/o costs of various competing query plans , chooses plan thinks fastest." documents of documents, there paper or book specify cost function more details ? thx. there source code ( where.c ). query planner details tweaked in every version.

IPython Notebook doesn't see environment variables with "bash magic" -

i running ipython notebook on vagrant virtual machine, , port-forwarding local machine can view notebook in web browser. run bootstrap script sets an environment variable jython_home in /etc/environment with: sudo echo "jython_home=/usr/lib/jvm/jython" | sudo tee -a /etc/environment source /etc/environment the boot script later starts ipython notebook. when open notebook, %%bash cat /etc/environment yeilds path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" jython_home=/usr/lib/jvm/jython but %%bash echo $jython_home prints empty line. i have tried append export line ~/.profile, /.profile, ~/.bashrc, , etc/profile, same result. know notebook operating root, can't seem able see environment variable. can include in boostrapping script remedy this? i needed export variable in script itself. sudo echo "jython_home=/usr/lib/jvm/jython" | sudo tee -a /etc/environment source /etc/environment expor...

c++ - VS2010E Qt 5.1 compilation error LNK2001 LNK2019 -

i'm trying build simple qt window photoshop plugin i put libraries belongs in include directory : e:\program_files\qt32\5.1.0\msvc2010\include; e:\program_files\qt32\5.1.0\msvc2010\include\qtwidgets\; in library directory : e:\program_files\qt32\5.1.0\msvc2010\lib; e:\program_files\qt32\5.1.0\msvc2010\lib\cmake\qt5core; in link>general>directory of additional libraries e:\program_files\qt32\5.1.0\msvc2010\lib\cmake; e:\program_fi les\qt32\5.1.0\msvc2010\lib\cmake\qt5core; i alos added in link editor>entry>additional dependency qt5cored.lib; qt5core.lib; qt5gui.lib; here have : (i use vs2010 express can't use vsadd-in) i've tried a lot of things without luck thanks 1> création de la bibliothèque .\..\..\..\output\objs\tempproj\release/tempproj.lib et de l'objet .\..\..\..\output\objs\tempproj\release/tempproj.exp 1>gradientselector.obj : error lnk2019: symbole externe non résolu "__declspec(dllimport) public: vo...

c# - Need guidance on creating a post request and getting back a value -

Image
i trying make web service need crawl data from. problem site need data from, in asp gridview has paging in it.. need is, read html, postback page - give me next page of gridview, , new html code (the response) whom can parse , data need... i tried in many ways solve problem, did not succeed. tell me where/what doing wrong? code: [webmethod] public string enabavki2() { webclient client = new webclient(); client.encoding = encoding.utf8; string htmlcode = client.downloadstring("https://site.com/default.aspx"); string vsk = getbetween(htmlcode, "id=\"__viewstatekey\" value=\"", "\" />"); webrequest request = webrequest.create("https://site.com/default.aspx"); request.contenttype = "application/x-www-form-urlencoded"; request.method = "post"; var webrequest = (httpwebrequest)request; webrequest.useragent = "mozi...

javascript - Passing POST Data to PHP via JS fails -

first time i've added huge, mixing js, php, 3 , lot of other stuff. i've tried. when clicks on three.js scene onto human body, selects parts of human body , javascript adds want save selected things database using php / mysql. the three.js scene works, can select / unselect things , generated dynamic html output works to. example form generated this: <canvas width="1680" height="949"></canvas> <div id="description">will added database:</div> <form id="bodyparts" method="post" action="index.php?s=cinput"> <input type="checkbox" id="leg_right" name="leg_right" disabled="" value="leg_right"> <div id="leg_right_description">rechtes bein</div> <input type="checkbox" id="leg_left" name="leg_left" disabled="" value="leg_left"> <div id=...

postgresql - how to use composite data types (e.g. geomval) in SQLAlchemy? -

i'm trying replicate nested raw postgresql/postgis raster query using sqlalchemy(0.8)/geoalchemy2(0.2.1) , can't figure how access components of geomval data type. it's compound data type returns 'geom' , 'val'. here raw query works: select (dap).val, (dap).geom (select st_dumpaspolygons(rast) dap my_raster_table) thing and sqlalchemy query i'm working with: import geoalchemy2 ga2 sqlalchemy import * sqlalchemy.orm import sessionmaker metadata = metadata() my_raster_table = table('my_raster_table', metadata, column('rid', integer), column('rast', ga2.raster)) engine = create_engine(my_conn_str) session = sessionmaker(engine)() q = session.query(ga2.func.st_dumpaspolygons(my_raster_table.c.rast).label('dap')) and i'd access in subquery, this: q2 = session.query(ga2.func.st_area(q.subquery().c.dap.geom)) but syntax doesn't work, or wouldn't posting questio...

google apps script - Adding text to GMail message before forward -

i wanted add small text emails before forward them, little "notice" line. can add text/html part in html email, not in text/plain part. here's plan body of message: content-type: multipart/alternative; boundary=20cf303ea8aab6b10304e1b6fd7e --20cf303ea8aab6b10304e1b6fd7e content-type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes at last!!!! --20cf303ea8aab6b10304e1b6fd7e content-type: text/html; charset=iso-8859-1 [this email forwarded 'forward many' gmail gadget, more info https://sites.google.com/site/replytomany] at last!!!! --20cf303ea8aab6b10304e1b6fd7e-- anyone know how/if it's possible it? cheers. if "forward" in gmail have not possibility add text orignal message prepended with ---------- forwarded message ---------- from: <amsmota.dev@gmail.com> date: 19 july 2013 11:00 subject: fwd: beta test to: i exact same thing, should open request this? seems such trivial ...

sql - Missing select keyword from exported Oracle View DDL -

i'm having difficulties exporting / , importing database using impdm, , expdp. i have valid schema, couple of working views created using statements similar to: create or replace force view someview (column1, column2, etc) select column1, column2, etc sometable; i can query views no problem, , valid results: select * someview; however if try export ddl views, using expdp, or simple dbms_metadata.get_ddl query. i.e.: select dbms_metadata.get_ddl('view','someview','someschema') dual ... of view ddls missing select keyword. instead of getting original ddl used create view in first place, like: create or replace force view someview (column1, column3, etc) column1, column2, etcfrom sometable; this preventing me doing image export / imports on import step things blow on: ora-39083: object type view failed create error: ora-00928:missing select keyword suggestions? i'm using oracle 11.2 on windows. here work around mi...

Opencv Surf Bug error -

Image
anyone familiar error? tested surf descriptor in real-time , worked after few seconds crashes , got error. it related when no points detected. run code again , have detected object stays more 2 mins , still no error. when removed object , there no points, crashes again after 40 secs. #include <stdio.h> #include <iostream> #include <fstream> #include <string> #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/nonfree/features2d.hpp" #include "opencv2/legacy/legacy.hpp" using namespace cv; using namespace std; char key = 'a'; int framecount = 0; surffeaturedetector detector(1000); surfdescriptorextractor extractor; flannbasedmatcher matcher; mat frame, des_object, image; mat des_image, img_matches, h; std::vector...

facebook - Difficulty using Django All-Auth in my own project - url/migration problems -

i'm having difficulty using django-allauth in own project, title suggests. i'm using south, new south, can source of problems. below i'll detail steps took , right now. first, moved allauth folder root of project. then, moved example code's templates our startup app - made "plain/example/index.html" template our startup template (127.0.0.1:8000). in our project's urls, added: #allauth stuff: url(r'^accounts/profile/$', templateview.as_view(template_name='plain/example/profile.html')), url(r'^accounts/', include('allauth.urls')), and project settings this: # django settings penguin project. import os debug = true template_debug = debug admins = ( # ('your name', 'your_email@example.com'), ) managers = admins db_path = os.path.abspath(os.path.join(os.path.abspath(__file__),'..','..','..','db','peng.db')) databases = { 'default': { ...

Trouble with MySQL update joining with a view -

i'm trying update table values view. i'm using code: update member, temp_status_date set member.status_date = temp_status_date.status_date member.status_date != temp_status_date.status_date which in phpmyadmin giving error "#1054 - unknown column 'temp_status_date.status_date' in 'where clause'" doing wrong? isn't correct syntax, according official mysql documentation? try this: update member join temp_status_date on member.status_date != temp_status_date.status_date set member.status_date = temp_status_date.status_date;

c# - Visualization using Parallel methods -

i using parallel.foreach loop issue requests in parallel. wanted know if there way see visually happening behind scenes when these requests issued? ( way see being issued in parallel). i using vs 2010 you can write test prints in each requests. something like... console.writeline("start request."); console.writeline("processing xxx"); console.writeline("finishing request."); this way can see outputs while program running. can print out timestamps desired.

TinyMCE Spellcheck expected JSON Response in Rails -

i using tinymce , have rolled own spellchecker using ffi-hunspell. i rendering hardcoded response when click spell check button in wysiwyg editor, says there aren't misspelled words. render :json => {:id => "#{params[:id]}", :result => {"presents" => ["presnts"], "motor" => ["moors"]}}.to_json so, json supposed like? i using tinymce_rails gem. have thought using newer version. anyways, found link describes in detail how request/response should look: https://github.com/spohlenz/tinymce-rails . effectively, response older version of tinymce this: render :json => ({:id => nil, :result => ['badk', 'wirds'], :error => nil}).to_json also, uses second request suggestions. , should like: render :json => ({:id => nil, :result => ['bad', 'bed'], :error => nil}).to_json

android - Retrieving phone number from SIM card error -

this code telephonymanager mtelephonymgr = (telephonymanager)context.getsystemservice(context.telephony_service); string sdeviceid = mtelephonymgr.getdeviceid(); string ssimserial = mtelephonymgr.getsimserialnumber(); string ssimlinenumber = mtelephonymgr.getline1number(); with of want read user phone number his/her sim card add read_phone_state permission in manifest file. eclipse showing no error in code still nothing in end. there wrong code? see this thread more information on issue. specifically, below comment on accepted answer: actually, not perfect. last time tried method, reported phone number phone had, before old mobile number ported on it. still does, settings app still shows defunct number. also, there reports sims cause method return null. being said, i'm not aware of better answer. – commonsware it seems getting user's phone number not simple asking os hand over, reasons beyond control of developer. alternative populate w...

c# - Adding functions to a webpage where visibility is restricted by your domain login/role -

i working on small, simple project. have list of users stored in database so: id (uniqueidentifier primary key), firstname(varchar), lastname(varchar), phoneno(varchar), domainac(varchar) i displaying information on webpage : <%@ page language="c#" inherits="system.web.mvc.viewpage<ienumerable<whois.models.employee>>" %> <!doctype html> <html> <head runat="server"> <meta name="viewport" content="width=device-width" /> <title>index</title> </head> <body> <p> <%: html.actionlink("create new", "create") %> </p> <table> <tr> <th> <%: html.displaynamefor(model => model.fullname) %> </th> <th> <%: html.displaynamefor(model => model.phoneno) %> </th> ...