Posts

Showing posts from May, 2014

math - (A^x) % Mod == (A^(x % (Mod - 1)) % Mod. if Mod is Prime. True when A is a matrix? -

(a^x) % mod == (a^(x % (mod - 1)) % mod. if mod prime. is property true when 'a' matrix? suppose a= 1 0 1 1 0 0 0 1 0 x=1000000007 , mod=1000000007 then ( a^x ) % mod is 097981108 432592815 646971665 646971665 451009450 432592815 432592815 214378850 451009450 but (a^1)%mod [ as, ( x % (mod-1) )=1 ] same matrix. that property ( assuming understood correctly ) false. just consider a = 1 0 // 0 2 x = 3 mod = 2 you a^3 % 2 != a^0 % 2 because left : 1 0 // 0 0 right: 1 0 // 0 1

Simple jquery slider freezes on browser previous -

i've done simple jquery slider $(document).ready(function(){ $('li').hover(function(){ $(this).children('div').slidetoggle(); }); }); like this. works perfectly, div 's hidden , display when hover li item, there's problem. when press "back" button in browser slidetoggle "freezes" in "opened" position (meaning div displayed) , start working backwards. ideas fix? try sliding them document ready, so: $(document).ready(function(){ $('li > div').slideup(); $('li').hover(function(){ $(this).children('div').slidetoggle(); }); }); this assure divs slide upwards , prevent working 'backwards'.

c - what is the best way for loading assets (images) into memory using opengl? -

this question not regarding specific platform , related opengl es. my brother , creating simple 2d adventure game both new pure opengl programming , missing obvious. we loading simple png texture game background. texture full hd (1920x1080) png file has size on disk of 2.7mb. once loaded in memory same file holds 9mb in memory. here sample of code in charge of loading file. int texture_gl_create(texture_t* texture) { int err; if (texture->id) { err = texture_gl_delete(texture); if (err) { return err; } } gl_check(glgentextures, 1, &texture->id); logd("texture has id: %d", texture->id); gl_check(glbindtexture, texture->target, texture->id); switch (texture->byte) { case 1: glpixelstorei(gl_pack_alignment, 1); break; case 2: glpixelstorei(gl_pack_alignment, 2); break; case 3: case 4: glp

How can I find the client machine name in classic ASP? -

i know how ip address there way me client machine name? addr = request.servervariables("remote_addr") you can't. http not transmit information. windows network does, not http.

perl - How to properly use a Getopt::Long to parse optional arguments? -

i use getopt::long command line options perl script. pass optional argument can if value specified, , else if option called, no value passed. the script invoked this: /root/perlscripts/pingm.pl --installdaemon for no argument specified, and: --installdaemon=7.7.7.7 for specifying optional argument. then i'd this: getopt::long::configure(qw(bundling no_getopt_compat)); getoptions ('installdaemon:s' => \$daeminstall) or die ("error in command line arguments\n"); the next step doubtful. if do: if ($daeminstall) { print "i called!\n"; $installdaemon=1; } then, if block never called if script called /root/perlscripts/pingm.pl --installdaemon , because according perldoc, optional argument take '' string if no value specified. so how can check whether option specified without passing value? check defined $daemsintall instead. if defined, corresponding option specified; can compare empty strin

selenium - Why .sendKeys(Keys.chord(Keys.CONTROL, "a")) does not work in Chrome -

i trying select text in text field , delete it. use chromedriver linux. this code: loginpage.getpasswordfield().sendkeys(keys.chord(keys.control, "a")); loginpage.getpasswordfield().sendkeys(keys.delete); but not work (actually first line). why? how make work? versions: chrome: version 28.0.1500.95 chromedriver: chromedriver_linux64_2.1/chromedriver_linux64_2.2 have tried use action builder? example, our automation suite: public void selectanddeletetextviakeyboard() { selecttextviakeyboard() deleteviakeyboard() } public void deleteviakeyboard() { actions builder = new actions(webdriverproxy.getwebdriver()); builder.sendkeys(keys.delete) .release().perform(); } public void selecttextviakeyboard() { actions builder = new actions(webdriverproxy.getwebdriver()); action select= builder .keydown(keys.control) .sendkeys("a") .keyup(keys.control) .build(); sele

php - Codeigniter Email class connect to smtp server from behind a proxy -

i created simple mailing list system application using personalized mailer spark. this spark uses codeigniter email class connect smtp server , send mails. the problem server i'm working on uses proxy connect internet when tested mailing list didn't work despite worked when tested on local server. is there way modify codeigniter email class support connecting smtp server using proxy? ok, send email server have make tunnel through fsockopen , use tunnel connect smtp. can't tell changes have made in codeigniter class know class can send email via http proxy http://www.phpclasses.org/package/14-php-sends-e-mail-messages-via-smtp-protocol.html and following test script in there option configure proxy. http://www.phpclasses.org/browse/file/31.html in case if wondering how done , wan't populate same logic in codeigniter class, have first read through lines 884 - 953 of file smtp.php . in opinion, instead of mimicking code of class onto codeign

javascript - Why is my forms textboxes auto filling with previous textbox value? -

i have drupal 7 site , have noticed with text forms. have form 4 textboxes. fill first 1 value "john". if click or tab through next few textboxes, if don't fill them out auto filled "john". if go , try clear them, , click outside box or 'tab' out of box gets filled in again value cleared. know causing this? guessing there may .blur() somewhere doing don't know is. tried $('.form-text').unbind('blur'); still happening. appreciated. thx! i not sure causing auto fill had similar issue in past , found adding autocomplete="off" html on tag fixed problem me. help.

php - How show checkbox value before submit OR there itself when ticked? -

i have following codes: <form method="post"> <input type="checkbox" name="fruit[]" value="apple" id="apple" /><label for="apple">apple</label><br /> <input type="checkbox" name="fruit[]" value="pinapple" id="pinapple" /><label for="pinapple">pinapple</label><br /> <input type="checkbox" name="fruit[]" value="grapefruit" id="grapefruit" /><label for="grapefruit">grapefruit</label><br /> <input type="submit" name="go" /> </form> <?php $fruitlist = implode(', ', $_post['fruit']); echo $fruitlist; ?> it show checked items after submit. possible show ticked items values inside input box before submitting. the way can think of attach event checkboxes , display clicked ones on area. ass

jquery - Retrieving values of checked checkboxes -

i have table (below) containing value associated checkbox. <table id="testtable"> <tbody> <tr id="tr1"> <td><input type="checkbox" value="value1"></td> <td>row 1</td> <td>a</td> </tr> <tr id="tr2"> <td><input type="checkbox" value="value2" ></td> <td>row 2</td> <td>b</td> </tr> <tr id="tr3"> <td><input type="checkbox" value="value3"></td> <td>row 3</td> <td>c</td> </tr> </tbody> once user has selected combination of checkboxes, need determine values associated checkbox has been checked (after user clicks on 'finished' button). this have far $('#finished').click(function() {

Visual Studio Ultimate 2013 Preview does not Install Phone SDK 8 in VM -

i download windows 8.1 / ie 11 vm modern.ie, start in vmplayer , want install visual studio 2013 preview. installer not offer optionally install windows phone sdk 8. thought reason might phone emulators need hyper-v. changed vm operating system type windows 8 hyper-v , checked box "virtualize intel ..." in processor settings. when call systeminfo on command line in virtual windows 8.1 reads: vm monitor mode extensions: yes virtualizaion enabled in firmware: yes second level address translation: yes data execution prevention available: yes is possible run phone sdk in virtual windows 8.1? i have no idea installer checking before offering (or not) install phone sdk. virtualization might issue guess. sort of. can install sdk separately if don't install emulator, cannot run emulator because you're in hyper-v vm, inception vms not allowed. ms let connect vs sibling vm someday.

.net assembly - Elusive processor architecture mismatch during publish of a web application -

our team developing web application targeted x64. project references , dependencies targeting x64 (i verified .csproj files , assemblies). there no latebound references in configuration files. everything compiles , runs fine under iis 8.x express. when publishing see invalid assembly platform or contenttype in file in fusion log. occurs during run of aspnet_compiler.exe part of publish. seems indeed, there kind of processor architecture mismatch, where? i checked target framework , target profile. web project's framework .net 4.5. dependencies 4.5 or lower, , profile non-client one.

objective c - iOS objects return nil soon after creation -

so i'm writing obj-c ios, , "strange" happening.. i have mvc, uitableview (private): @interface mvc () @property (strong, nonatomic) iboutlet uitableview *tableview; @property (strong, nonatomic) cellvc *cell1; @property (strong, nonatomic) cellvc *cell2; @end i load table view few custom cells. custom cell class uiviewcontroller... instantiate few, , set cell.contentview corresponding cellvc.view inside tableview:cellforrowatindexpath: method. custom cell class: @interface cellvc : uiviewcontroller @property (strong, nonatomic) iboutlet uiknob *knob1; @property (strong, nonatomic) iboutlet uiknob *knob2; @property (strong, nonatomic) iboutlet uiknob *knob3; @property (strong, nonatomic) iboutlet uiknob *knob4; @end in case you're wondering, i've written subclass of uicontrol named uiknob... in cellvc's viewdidappear: method, i've set breakpoint check values of every knob. each knob non-nil, happy... have been created. my goal se

c# - Visual Studio Express 2012 not building exe in Release folder -

Image
i have compiled simple 'hello world' program. program compiled without errors. can see working executable in bin folder. release folder of project totally empty. i don't know if there settings problem or problem in building. apparently, don't see error. you can change build mode in top of visual studio: dependently on mode build solution, visual studio generate .exe in either bin\debug folder or bin\release folder.

Chef Omnibus: run export PATH=/opt/rumm/embedded/bin:$PATH after package install -

we have chef omnibus package installs gem-based command line tool. how run script after omnibus unpacks? want able add omnibus embdded/bin path. on linux use package-scripts/<project>/postinst , package-scripts/<project>/postrm . on osx, use package-scripts/<project>/makeselfinst . and add line: ln -sf $dest_dir/embedded/bin/<project>/usr/bin || error_exit "cannot link <project> /usr/bin" make sure have dest_dir defined: dest_dir=/opt/<project>

maven - What might be causing these errors about JavaServer Faces and JAX-RS? -

i have following errors(in problem's view) want fix, javaserver faces 2.2 can not installed : 1 or more constraints have not been satisfied. javaserver faces 2.2 requires dynamic web module 2.5 or newer. jax-rs (rest web services) 2.0 can not installed : 1 or more constraints have not been satisfied. jax-rs (rest web services) 2.0 requires dynamic web module 3.1 or newer. jax-rs (rest web services) 2.0 requires java 1.7 or newer. how fix this.here web.xml , pom.xml files. web.xml <!doctype web-app public "-//sun microsystems, inc.//dtd web application 2.3//en" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>web application</display-name> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</fil

.htaccess - Amazon Elastic beanstalk : Use nginx/apache to forward subdomains to subfolders -

i've created node.js app on ebs 2 subrouters 'foo' , 'bar', accessible via 'example.com/foo' , 'example.com/bar'. i'd reverse proxy of ebs forward subdomains "foo.example.com" , "bar.example.com" these subfolders... i.e. "foo.example.com/xxx" "example.com/foo/xxx" "bar.example.com/yyy" "example.com/bar/yyy" etc. i know how configure nginx this, can't figure out access nginx config files on ebs... someone asked the same thing on year ago , seems ebs has developped deal since... know if sort of thing doable. you can use configuration file customize nginx configuration. create .ebextensions directory in top-level of source bundle. create configuration file, /your_app/.ebextensions/custom.config . type following inside configuration file configure forward settings. (i have created gist ) files: "/etc/nginx/conf.d/custom.conf" : content: |

ruby on rails - How can I route to a page any time no route is available? -

i want make simple page button odd case user enters url page there not route for. for instance, route foo is: resources :foos, :except => [:index] the user enters: mysite.com/foos i want display page says "this page doesn't exist" , button. where put html.erb file , how account in routes.rb? thanks at end of routes.rb write: match '*path', :controller => 'some_controller', :action => 'some_action' or match '*path' => 'some_controller#some_action' source: rails handle 404 url redirect

javascript - What is the easiest way to inject a script in to someone else's domain? -

for example if i'm on www.facebook.com , want inject script analyze dom? 1 way open console , use like document.createelement('script'); and set src attribute, etc. is best way it? if trying inspect someone's dom, it's easiest use js console or debugger (if browser offers natively or add-on firebug). you use proxy server, burp or zap, intercept responses website , inject own javascript. you duplicate site web crawler. should permission first, ensure don't violate terms of service, , make sure have lots of space. can play site heart's content :) as alternative, use engine xssshell, loading website want examine in xssshell compromised web browser, loading code want load xssshell. or, set own dns server specifies local ip address foo.facebook.com, else facebook.com. depending upon how fb manages site (new http headers, cookie paths) may able run javascript local server, while browsing fb. if really, want write code executes in c

javascript - redirecting to another controller with onchange -

<th>@html.dropdownlist("tables", new list<selectlistitem> { new selectlistitem { text = "a", value = "admin/index"}, new selectlistitem { text = "b", value = "admin/index"} }, "www",new { @onchange="location=this.value" })</th> this code works 1st time, later instead redirect controller "admin/index" starts copy itself.so have address this localhost/admin/admin/index instead of localhost/admin/index i have tried, same effect @onchange="document.href.location=this.value @onchange="window.href.location=this.value how make correct js, redirecting work time. you can add slash values, starts root: <th>@html.dropdownlist("tables", new list<selectlistitem> { new selectlistitem { text = "a", value = "/admin/index"}, new selectlistitem { text = "b", value = "/admin/index"} }, "www&q

django - 'staticfiles' is not a valid tag library: Template library staticfiles not found -

hey guys trying django-oscar tutorial http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html getting 'staticfiles' not valid tag library: template library staticfiles not found, tried django.templatetags.staticfiles,django.contrib.flatpages.templatetags.staticfiles,compressor.templatetags.staticfiles,oscar.templatetags.staticfiles,haystack.templatetags.staticfiles,treebeard.templatetags.staticfiles,sorl.thumbnail.templatetags.staticfiles any ideas?? traceback: environment: request method: request url: http://localhost:8000/ django version: 1.4.2 python version: 2.7.3 installed applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.flatpages', 'south', 'compressor', 'oscar', 'oscar.apps.analytics', 'oscar.apps.order', 'oscar.apps.chec

Highchart configure appearance when x-axis has many categories -

i choose bar chart, because graph has many categories, think it's better aproach column chart. i choose following source code making start: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/bar-stacked/ however, when put many categories, category labels overlapped 1 each other. firstly solved making container higher. result not expect, because got lot of "padding" between beginning of graph , first category label, between last label , end of graph: see fiddle: http://jsfiddle.net/ra6mc/20/ the code below: $(function () { var categories = ["analogo","analogo klorner","aÑadir una pieza ","aÑadir resto piezas","arandela de oro","arandela zocalo","cajita","calcinable","calcinable diametro 4","calcinable klorner","carilla empres","completa definitiva","completa provisional

How to avoid AngularJS to parse string which is not JSON? -

i using angularjs , working static text files data. used factory return $resource as, app.factory('timeseriesdata', function ($resource) { return $resource('data/timeseriesdata.txt'); }); i tried $http angularjs trying parse json using function in angular.js function fromjson(json) { return isstring(json) ? json.parse(json) : json; } i have plain text data in text file not in json format. parsing causing error in console. how avoid angularjs stop parsing json ?

chromecast - How to update the volume indicator provided by the MinimalMediaRouteProvider -

when registering minimalmediarouteprovider/mediaroutebutton androids chromecast sdk, standard dialog connecting existing cromecast devices. once connected device, same dialog provides way set volume using draggable seek bar. having trouble synchronizing position of volume seek bar actual volume set in chromecast device. as part of registering minimalmediarouteprovider provide com.google.cast.mediarouteadapter implementation. onsetvolume(volume) of interface called when user drags volume seekbar above. gives god way update volume level of connected chromecast channel using messagestream.setvolume(volume). the problem once update volume, there no way tell minimalmediarouteprovider ui volume has changed can position accordingly - shows volume 0. what proper way notify minimalmediarouteprovider current volume level can update volume ui? looking @ mediaroute sample included support library 7, there seem way create mediaroutedescriptor, update volume there , communicate mediarout

css - How to show tags in my tumblr theme? -

i installed this theme , i've been trying show tags. i've tried adding code show tags, , while show them, totally messes format of theme. not sure i'm doing wrong, appreciated! (: go customize section after log in click on theme tab click use custom html this bring edit box contains html , tumblr code used theme. put code tags somewhere between opening {block:posts} , closing {/block:posts} tags. to start off easy, let's put tags @ bottom of post types. where see following line: {/block:posts} insert following starting chunk this: {block:hastags} {block:tags} <a href="{tagurl}">{tag}</a> {/block:tags} {/block:hastags} {/block:posts} click update preview in lower right corner of edit box (or update itself) click save + close in upper right of dashboard. refresh tumblr blog , should see tags display. you can read more of specific tags markup needed on t

c# - Event is null after restarting app -

current have event in app.xaml.cs public partial class app : application { public static event eventhandler settingssaved; private async void application_launching(object sender, launchingeventargs e) { if (settingssaved != null) { settingssaved(this, null); } } and in mainpage.xaml.cs public mainpage() { initializecomponent(); app.settingssaved += app_settingssaved; } void app_settingssaved(object sender, eventargs e) { //do here } settingssaved works fine when app launched first time, when app launched second time, settingssaved becomes null. there way make sure settingssaved works same when app launched first time? i'm novice coder , i'm pretty sure i'm missing fundamental here. instead of putting in public mainpage(), maybe try putting in app.initialize event ensure absolutely happens on start-up.

Windows Azure VM Remote desktop connection issue -

i created windows azure vm windows server 2008 r2. status of server running. port open. cannot rdp it. gives me error remote desktop can’t connect remote computer 1 of these reasons: remote access server not enabled the remote computer turned off the remote computer not available on network make sure remote computer turned on , connected network, , remote access enabled. any ? created twice no luck edit i able connect home. not work network. work network restrictions. suggest should next step make accessible work rdp port (3389) blocked network administrators of corporations. need either of: talking network administrator @ work , ask permission use rdp port connect azure virtual machine configure different public port rdp endpoint . setting 443 (the https standard port) or 22 (standard ssh port) might solve issue without contacting system administrator of course, if use vm secure web (which works on 443) have chose port number.

php - Invalid argument supplied for foreach() in -

i keep getting error code though works should when run in browser, when called include_once doesnt work due error foreach(($hostlist->uploaded) $uploaded) { if (strcmp($uploaded->url,"http://someurl.com/")==0) { $host = simplexml_load_file($config['hostlist']); unset($host->uploaded->url); unset($host->uploaded->pass); $host->uploaded->addchild('url',"http://anotherurl.com/"); $host->uploaded->addchild('pass',"anotherpass"); $host->uploaded->asxml($config['hostlist']); $host->asxml($config['hostlist']);` echo "url changed http://anotherurl.com/"; } } knowing variables follows: $config['hostlist'] = 'xml/host.xml'; $hostlist = simplexml_load_file($config['hostlist']); and sample of xml file: <host> <uploaded> <work>yes</work> <url>http://someurl.com

runtime.exec - Java - Command Execution in Runtime -

i tried out simple program execute linux command @ run time. following program gets compiled , runs without error, text file not getting created intended.is there wrong in program? import java.io.*; class executejava { public static void main(string args[]) { string historycmd = "cat ~/.bash_history >> documents/history.txt"; try { runtime runtime = runtime.getruntime(); process proc = runtime.exec(historycmd); } catch(exception e) { system.out.println(e); } } } the append operator >> meant interpreted part of command shell. use string[] historycmd = { "bash", "-c", "cat ~/.bash_history >> documents/history.txt"};

objective c - posting array of dictionaries with Restkit 0.20 -

im having issues getting function correctly. i have mapped key value pairs of json payload inject request end failure on each post. the following lines show me creating reqeust: rkobjectmapping *requestmapping = [wdmappingprovider createreginitrequestticketmapping]; rkrequestdescriptor *requestdescriptor = [rkrequestdescriptor requestdescriptorwithmapping:[requestmapping inversemapping] objectclass:[wdticketsmodel class] rootkeypath:nil]; [registrationmanager addrequestdescriptor:requestdescriptor]; i create path post , put in data post request: //make object params wdregistrationinitializerequestmodel *requestmodel = [[wdregistrationinitializerequestmodel alloc] init]; requestmodel.eventid = [params objectforkey:@"eventid"]; requestmodel.arrayofticketdictionaries = [params objectforkey:@"arrayofticketdictionaries"]; nsstring *postpath = [nsstring stringwithformat:@"api/v1/registrations/initialize?eventid=%@", requestm

html - How to simplify my CSS stylesheet? -

i trying simplify css selector in css sheet i have like .table_test .div, .table_name .div, .table_company .div{ color:black; } .table_test .div table input, .table_name .div table input{ color:red; } my html like <div class='table_test'> <div class='div'>...... <table> <tr> <td><input>...</td> </tr> </table> </div> <div class='table_name'> <div class='div'>...... <table> <tr> <td><input>...</td> </tr> </table> </div> i feel there many selectors clustered , wondering if there way make simpler. help! a few things: don't use generic class names div . there's element element called div . if want target based on nesting, using css. .table_name > div {} /* or .table_name div */ and not... .table_name .div {} use specific selectors. there reason why nee

MySQL Find previous date that a song was played -

i'm looking why code here isn't working anymore. sql fiddle links original , modified code. had database in 2 different tables , code worked fine. select date_format(a.show_date,'%m/%d/%y') show_date, a.song_order, a.show_id, b.song_name, a.song_id, ( select ifnull(max(date_format(show_date,'%m/%d/%y')), 'new song') tbl_shows c a.show_date > c.show_date , a.song_id = c.song_id ) prevdate tbl_shows a, tbl_songs b a.song_id = b.song_id , a.show_id = 899 the tables were: create table tbl_songs (`song_id` int, `song_name` varchar(11)) ; insert tbl_songs (`song_id`, `song_name`) values (51, 'song name a'), (368, 'song name b'), (168, 'song name c'), (568, 'song name d'), (13, 'song name e') ; create table tbl_shows (`song_id` int, `song_order` int, `show_date` datetime, `show_id` int) ; insert tbl_shows (`song_id`, `song_order`, `show_date`, `show_id`) values (51, 1, '2013-07

ios - MvvmCross: How to use FlyoutNavigation component with MvvmCross -

is there example on how use mvvmcross flyoutnavigation component xamarin. i getting error when tried set viewcontrollers using menu views mainnavigationviewmodel. error got "system.reflection.targetinvocationexception: exception has been thrown target of invocation." here sample code: public class mainnavigationviewmodel : mvxviewmodel { public mainnavigationviewmodel() { menuone = new menuoneviewmodel(); } private menuone _menuone; public menuoneviewmodel menuone { { return _menuone; } set { _menuone = value; raisepropertychanged(() => menuone); } } } [register("mainnavigationview")] public sealed class mainnavigationview : mvxviewcontroller { protected mainnavigationviewmodel mainnavviewmodel { { return base.viewmodel mainnavigationviewmodel; } } public mainnavigationview() { viewdidload(); } public override void viewwillap

Why were FEXPRs abandoned in Common Lisp? -

many lisps had fexprs not included in cl. read because fexrps don't work static analysis. can explain this? from wikipedia article on fexprs : at 1980 conference on lisp , functional programming, kent pitman presented paper "special forms in lisp" in discussed advantages , disadvantages of macros , fexprs, , condemned fexprs. central objection that, in lisp dialect allows fexprs, static analysis cannot determine whether operator represents ordinary function or fexpr — therefore, static analysis cannot determine whether or not operands evaluated. in particular, compiler cannot tell whether subexpression can safely optimized, since subexpression might treated unevaluated data @ run-time.

performance - Android Threads: FinalizerWatchDogDaemon -

Image
what these android threads? system threads? seems thread 2 cause's 1 of activities periodically not gc'd. understand if these have app or if system threads not worry about. in advance. 1). finalizerdaemon, 2). finalizerwatchdogdaemon

jQuery UI resizable Min width is too large -

in following jsfiddle - i've reproduced issue i'm having jquery ui resize . when try resize div 1px wide - automatically increases in size , result can not don it's original size (or smaller newly created div size). has encountered issue? tried tagging min-width: 1px; in .css had no effect. css 1px wide bar below; .task { position: absolute; height: 25px; width: 1px; background-color: yellow; cursor: move; white-space:nowrap; top: 0; font-family: corbel; font-size: x-small; line-height:2.5em; text-indent: 0.5em; z-index: 1; border: 2px outset; border-bottom: 1px solid black; } thanks in advance, http://jsfiddle.net/cyvyq/24/ you close. need set minwidth in resizable properties, , not in css. the default minwidth 10 , can set 1 desired behavior. .resizable({ //containment: "parent", minwidth: 1, handles: 'e, w', }); the updated jsfiddle .

php - How to use count method with my_model -

i'm trying work jamie rumbelow's my_model , i'm running issue figuring out how can use count method array. i want count total number of personal unread messages logged user has received. so going try following call: $unread_messages = $this->personal_messsages->count_by(); however, need pass in user_id of user , integer know if message unread or read. any ideas on how perform this? unfortunately, count_by() works off single field & value, not array (unless he's updated). you'll have write own this have @ link see examples of my_model functions: http://codebyjeff.com/blog/2012/01/using-jamie-rumbelows-my_model edit: may stand corrected on one: try passing in array('user_id'=>$user_id, 'status'=>1); (adjusted own values), may work

javascript - Render an array of objects in mustache js -

[object, object] 0: object 0: object id: 1 name: "xvxvxcv" semester: 2 1: object how can render array of objects in mustache js? can't use {{#data}} {{/data}} iterate because hasn't name. [object, object] 0: object 0: object id: 1 name: "xvxvxcv" semester: 2 1: object probably output shown in js console. got output entering variable. of course, must have assigned object variable. when have variable assigned object, can directly access variable in mustache code this, {{#object}} {{key}} : {{value}} {{/object}}

javascript engine - v8::Object::SetAccessor - How does it work? -

there's no documentation on "v8::object::setaccessor" - correct assume can set different setter , getter function each specified property name? how affect object if created object template? (yes, know can set on template, i'm curious possible conflicts)

basics of android activity life cycle functions -

i testing out code shows state activity in public class activity101activity extends activity { string tag = "lifecycle"; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // setcontentview(r.layout.main); setcontentview(r.layout.activity_activity101); log.d(tag , "in oncreate() event"); } public void onstart() { super.onstart(); log.d(tag , "in onstart() event"); } public void onrestart() { super.onrestart(); log.d(tag , "in onrestart() event"); } public void onresume() { super.onresume(); log.d(tag , "in onresume() event"); } public void onpause() { super.onpause(); log.d(tag , "in onpause() event"); } public void onstop() { super.onstop();

css3 - Hide on :hover, DIV over DIV -

i have div on top of div. what want achieve hide div on top able access div below. i've tried opacity, since top div still there, transparent, won't allow me interact content of div below. i've tried display:none;, visibility: hidden; , z-index. none of work. how achieve css3, can use transition? html: <li class="panel-box"> <div class="front box-style"> </div> <div class="back"> </div> </div> </li> css: .panel-box { margin: 5px; padding: 0; display: inline-block; clear: none; float: left; width: 310px; height: 200px; position: relative; } .box-style { background-color: red; } .front { width: 310px; height: 200px; z-index: 5; opacity: 0; display: block; position: absolute; top: 0; left: 0; } .front:hover { opacity: 0; display: none; } .back { width: 310px; height: 200px; background-c

c++ - Draw a dashed and dotted bezier curve in QML -

i've seen there example implementation of a bezier curve in qml , i'm looking hint how implement dashed or dotted bezier curve line. far see, tha authors of bezier curve example using qsggeometrynode store inside qsggeometry qsgflatcolormaterial material applied on it. create list of points , draw segments between them. is possible write shader , apply qsgflatcolormaterial (to display line dashed , dotted , etc)? eventually, possible store more 1 qsggeometry inside qsggeometrynode ? update i implement in "pure qtquick " - not in "old" interfaces (like qpainter etc ) - because not want use something, switches context (opengl , cpu). prefer solution custom shader (if doable) - because i'll have more possibilities in implementing custom , feel (dashed, doted, colored, maybe animated etc). if not possible, i'll use qpainter . i don't think task candidate implementing using qsggeometrynode , easier implement using qpainte

Why can't I install mysql2 on Ruby On Rails? -

i don't know how install mysql2. i'm using: ruby on rails 3.2.14 ruby 2.0.0 mac os x 10.9 ("mavericks") installing mysql2 (0.3.13) error occurred while installing mysql2 (0.3.13), , bundler cannot continue. make sure `gem install mysql2 -v '0.3.13'` succeeds before bundling. gem::installer::extensionbuilderror: error: failed build gem native extension. /system/library/frameworks/ruby.framework/versions/2.0/usr/bin/ruby extconf.rb *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. gem files remain installed in /users/kimingi/.bundler/tmp/1983/gems/mysql2-0.3.13 inspection. results logged /users/kimingi/.bundler/tmp/1983/gems/mysql2-0.3.13/ext/mysql2/gem_make.out error occurred while installing mysql2 (0.3.13), , bundler cannot continue. make sure `gem install mysql2 -v '0.3.13'` succeeds before bundling. er

using and storing json text in JavaScript -

i'm making 2d, top-down zelda-style web single player rpg... i'd store dialog in json format... currently i'm getting json external javascript file. json stored such in js/json.js: function getjson() { var json = { "people" : [ {//npc 1 - rescue dog etc... then use in main game javascript file such <script src="js/json.js"></script> ..` var json = getjson(); then use such: labels[index].text = json.people[index].dialogs.start.texts[0]; does matter if keep json js file in javascript function? or should stored .txt file parsed? thanks! it not matter json data javascript store .js , later on can add more data related functions if needed, btw data file has getjson function doesn't make sense store .txt on other hand if api serving data need not have extension @ all.

java - Can't fix "Error: Input length must be a multiple of 16 when decrypting with a pad cipher" -

ello! working chat application encrypts it's data through aes/cbc/pkcs5 padding. works through client sending encrypted message server sent , decrypted. unfortunately, whenever decrypt message, error follows: javax.crypto.illegalblocksizeexception: input length must multiple of 16 when decrypting padded cipher. encryption based of program :( http://www.scottjjohnson.com/blog/aeswithcbcexample.java ) works fine , cannot see difference between code , 1 except must convert string byte array. here code code: client (encryption): string message = textfield.gettext(); // generate key keygenerator keygen = keygenerator.getinstance("aes"); keygen.init(128); // use 256 bit keys, need "unlimited strength" encryption policy files sun. byte[] key = keygen.generatekey().getencoded(); secretkeyspec skeyspec = new secretkeyspec(key, "aes"); // build initialization vector. example zeros, // value or generated using random number generator. byte[] iv = {0,

java serialization and deserializaion -

i have created simple program serializes string input cmd .ser file.. part of requirement program must able append new input , able read new input plus old input.. streamcorruptedexception if read after 2nd input.. here run on cmd.. how solve streamcorruptedexception , why happen??. codes given below. c:\users\msi\desktop\codes java>java writefile cc.ser enter text , press ^z or ^d end. hah haha hahaha try ^z c:\users\msi\desktop\codes java>java writefile cc.ser enter text , press ^z or ^d end. asd asd asd asd asd ^z c:\users\msi\desktop\codes java>java readfile cc.ser 1: haha 2: haha 3: hahaha 4: hahaha error : java.io.streamcorruptedexception: invalid type code: ac @ java.io.objectinputstream.readobject0(objectinputstream.java:1375) @ java.io.objectinputstream.readobject(objectinputstream.java:370) @ readfile.main(readfile.java:23) writefile.java: import java.io.*; public class writefile implements java.io.serializable { public static void main(

dynamic data - Dynamically adding seeds from a database in Crawler4J -

This summary is not available. Please click here to view the post.

linux - C programming structure access -

i found line in linux audio drivers soc-core.c inside sound folder: int regsize = codec->driver->reg_word_size * 2; can please explain meaning of * 2 ? multiply contents of codec->driver->reg_word_size 2. guess translation between size in words size in bytes.

java - Mongo Db schema -

i have save different profiles of user various social media.for example user may have 1 facebook , 2 twitter profile. if save each profile inserted new document in different collections facebook , twitter collections , how relate document another. used dot notation in mongodb. if relate facebook , twitter profile of same user means easy fetch record.how design schema ? , how avoid duplication ? possible use facebook id twitter id unique? new mongodb . how join documents different collections this ruby implementation, hoping able translate schema logic java code. class user has_one :facebook_profile has_one :twitter_profile end class twitterprofile belongs_to :user end class facebookprofile belongs_to :user end you can enforce unique indexes on collections so: db.twitter_profiles.ensureindex({user_id: 1 }, {unique: true}) db.facebook_profiles.ensureindex({user_id: 1}, {unique: true}) you can use whatever field want enforce uniqueness @ us