Posts

Showing posts from March, 2010

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 27830 (ple.myfragexample) -- only on Android 4.1.2 -

i using fragmentactivity in application several fragments. each of these fragments hold image , text animation. when user swipes on screen, fragment changes. now have been working on since 10 days , have tested fragmentactivity on different devices different android versions. reason stuck on last 10 days getting crash fatal signal 11 (sigsegv) @ 0x00000000 (code=1), thread 27830 (ple.myfragexample) now, error occurs when test fragmentactivity on android 4.1.2 particularly. run fine on android 2.3.3, 4.0.3, 4.0.4, 4.2 , 2.2. error log below: 08-07 14:34:13.843: d/dalvikvm(27830): gc_for_alloc freed 3845k, 14% free 35407k/40903k, paused 4ms, total 14ms 08-07 14:34:13.848: i/dalvikvm-heap(27830): grow heap (frag case) 39.590mb 3932176-byte allocation 08-07 14:34:13.878: d/dalvikvm(27830): gc_concurrent freed 3k, 5% free 39244k/40903k, paused 11ms+4ms, total 30ms 08-07 14:34:13.928: d/dalvikvm(27830): gc_for_alloc freed 0k, 5% free 39244k/40903k, paused 16ms, total 16ms 08-07 1...

overlay - Creating thumbnails of Overlayed images in jquery -

i tying address problem facing in creating thumbnails of overlayed images. the problem have database of samller images , static image. user select few smaller images needs overlayed on static image. user selects position on static image smaller images needs overlayed. of not creating seperate image of newly created overlayed image, storing images , co-ordinate information. when user logs back, want show thumbnail view of overlayed image[though dont store overlayed image seperately, have selected image, co-ordinates overlaying images, etc stored in db]. there jquery plugin avaialable or other pointer achieve same? rgds, sandep if want produce stored, combined image of static 1 , smaller ones; have process in back-end. if using php, gd2 library available. if audience html5 compatible, can use html5 canvas overlay images, output raw-pixel-data js image() object, , display on page.

sql server - SQL - Convert results into comma separated string -

using article on stackoverflow ( how split date ranges based on months in sql server 2005 ) have run select statement splits date range month , returns 2 columns ( datefrom, dateto ) in sql. declare @sdate date = '2012/08/01' declare @edate date = '2013/09/01' select dateadd(month, n.number, @sdate) datefrom, dateadd(day, -1, dateadd(month, n.number, dateadd(year,-1,@edate))) dateto master.dbo.spt_values n n.number < datediff(month, @sdate, @edate) , n.type = 'p' i need add each of returned rows string separating columns | ( dateto|datefrom ) , each row , . for example if run code above result (just example im using first 4 rows need of them in 1 string): r | date | date 1 | 2012-08-01 | 2012-08-31 2 | 2012-09-01 | 2012-09-30 3 | 2012-10-01 | 2012-10-30 4 | 2012-11-01 | 2012-11-30 code: declare @stralldates varchar(max) /* set @stralldates = insertcode */ print @stralldates what need print return: 2012-08-01|20...

codeigniter - PHP namespace error -

Image
i have problem php api library supposed work. using codeigniter framework. i trying use phpevecentral library eve_market_model. can see library composed of several files using namespaces. use library, have include main file phpevecentral. here, can find screenshot of arborescence folders. namespace phpevecentral; class phpevecentral { ... public function marketstat($typeid = array()) { return new \phpevecentral\requests\marketstat($typeid); } } so, when call phpevecentral->marketstat() function, php error : class 'phpevecentral\requests\marketstat' not found in c:\wamp\www\eve-board\application\libraries\phpevecentral\phpevecentral.php on line 68 when include phpevecentral\requests\marketstat.php file, there not error anymore have other error other file, have include , on. do have manually include each file of library? hope there other way because it's bit boring. thanks help. edit i extended codeigniter loader class ad...

using magentos server-side validation -

i using magento version 1.7.0.2 , have created custom module, in there form allows user pass information in database. i need validate user input , looking around google can see front-end validation tutorials, assume magento has server side validation tools? based on assumption had in mage/core/customer/block/form/register.php , mage/core/customer/helper/data.php have been unable find of help, looking in wrong place? i aware zend has validation, , use if magento has not got it's own/extended zend validation. in short, magento have it's own validation apart javascript validation tools? magento uses zend validation, can take inside mage/customer/model/customer.php @ method validate()

sql - Column aliases from a function in PostgreSQL -

i've started using postgresql (i've history mssql , mysql) , have question aliases. if have following sql declared in function: return query select "table"."col1" "column 1", "table"."col2" "column 2" "table"; highlighting , running alone gives me expect: column 1 | column 2 ------------------------ contents | contents of | of col1 | col2 however calling function outside seems ignore aliases set: select * "f_function"(); gets: col1 | col2 ------------------------ contents | contents of | of col2 | col2 i tried changing return type definition of function in case of higher naming priority parent process: ... returns table (col1 integer "column 1", col2 integer "column 2") ... but syntactically wrong. as said i've started using postgresql might missing obvious, ...

objective c - Are storyboards widely used on iOS apps? -

i developing ios framework other developers use. intend use "ecslidingviewcontroller" framework , add webview slide-up. have working on 2 projects use storyboards in it. my search sample projects test framework raised big question. 9 out of 10 of samples didn't use storyboard. so question is: should start developing framework non-storyboard apps or situation happening in sample projects. what mean sample projects. all applications prior ios 5.0 non-storyboard type. if intend support versions prior 5.0 only, have leave out option support storyboard. if supporting older 5.0 + versions have build storyboard non storyboard applications.

css - How do I use the drop down box from Flat UI Kit (free)? -

i have managed include flat ui (free) css in project styled buttons , text boxes (along normal text) cannot manage style drop down button shown on demo site . the problem if add class select-block (which in demo) select item in html, drop down isn't styled @ all. i prefer designmodo website free drop down tutorial. html <div id="switch">hover me <ul id="switch-menu"> <li><a id="ml">menu 1</a></li> <li><a id="en">menu 2</a></li> </ul> </div> css #switch { width: 500px; height: 50px; background-color: #3498db; color: white; cursor: pointer; padding: 13px 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: background-color 0.5s ease 0s; -moz-transition: background-color 0.5s ease 0s; -ms-transition: background-color 0.5s ...

Neo4j Cypher: How to stop duplicate SET if multiple CREATES -

i have complex cypher query creates multiple nodes , increments counters on nodes. sake of example here simplified version of trying do: start = node(1), e = node(2) create a-[r1]->(b {})-[r2]->(c {}), e-[r3]->b-[r4]->(d{}) set a.first=a.first+1, e.second=e.second+1 return b the issue because there 2 create commands set commands run twice , values incremented 2 instead of 1 intended. have looked see if can merge multiple create statements , cannot. my initial idea separate out different creates batch query, wondering if there option. where executing query? version of neo4j using? i went console.neo4j.org , ran following , correctly added 1 both a.first , e.second: start = node(1), e = node(2) create a-[r:knows]->b-[r2:knows]->c, e-[:knows]->b-[:knows]->d set a.first=a.first+1, e.second=e.second+1 return b

C# continue in one line ForEach -

why can't ? how manipulate code ? system.io.directory.getfiles(@"..\data\data", "*.pdf").tolist().foreach(item => item.contains("toprint") ? continue : system.io.file.delete(item)); i add where before foreach system.io.directory.getfiles(@"..\data\data", "*.pdf") .where(item => !item.contains("toprint")).tolist() .foreach(f=> system.io.file.delete(f));

c++ - Method Overloading Of >> Binary Operator To Print A String -

i want stringclass class overloading >> binary operator follows: stringclass teststring; teststring = "test"; printf("%s", teststring >> 5); and there testtesttesttesttest printed (five times.) for needs. discourage things, here is. and yeah, bad static variable. bad practices. cares. #include <string> #include <cstdio> using namespace std ; const char* operator >> (const string &str, const int n) { static string ret_string ; ret_string.clear() ; (int i=0 ; i<n ; i++) { ret_string += str ; } return ret_string.c_str() ; } int main() { string str="test" ; printf("%s", str>>5) ; return 0 ; } as can see, define >> operator return whatever want. warning static variable, no reentrant, blah,blah,blah :) hope helps. if wish, can enclose operator definition inside class (if not string class). ** p0w initial code structure.

algorithm - Given a true random number generator which outputs either a 1 or 0 per call, how do you use this to pick a number from an arbitrary range? -

if have true random number generator (trng) can give me either 0 or 1 each time call it, trivial generate number in range length equal power of 2. example, if wanted generate random number between 0 , 63, poll trng 5 times, maximum value of 11111 , minimum value of 00000. problem when want number in rangle not equal 2^n. wanted simulate roll of dice. need range between 1 , 6, equal weighting. clearly, need 3 bits store result, polling trng 3 times introduce 2 eroneous values. ignore them, give 1 side of dice lower odds of being rolled. my question of ome deals this. the easiest way accurate result rejection sampling. example, generate random value 1 8 (3 bits), rejecting , generating new value (3 new bits) whenever 7 or 8. in loop. you can arbitrarily close accurate generating large number of bits, doing mod 6, , living bias. in cases 32-bit values mod 6, bias small impossible detect, after simulating millions of rolls.

aspnet regiis.exe - Importing RSA Keys from file using aspnet_regiis -

trying import file fails, saying exists: c:\windows\system32>c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regiis -pi "myrsakey" c:\key.xml microsoft (r) asp.net regiis version 4.0.30319.17929 administration utility install , uninstall asp.net on local machine. copyright (c) microsoft corporation. rights reserved. importing rsa keys file.. object exists. failed! but deleting fails, saying not found: c:\windows\system32>c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regiis -pz "myrsakey" microsoft (r) asp.net regiis version 4.0.30319.17929 administration utility install , uninstall asp.net on local machine. copyright (c) microsoft corporation. rights reserved. deleting rsa key container... rsa key container not found. failed! the problem turned out related permissions of "c:\users\all users\microsoft\crypto\rsa\machinekeys" folder. making sure commands executed using user be...

c++ - Precision error in double -

a large double value gets changed when printed %lf values upto following combination gives proper results 9 digits before decimal / 6 digits after decimal e.g. of value 9 digits before decimal printed %lf input : 3435537287.32 output : 3435537287.320000 once increase digits before decimal 10, values printed %lf adds garbage value. e.g. of value 10 digits before decimal printed %lf input : 34355372871.3487 output : 34355372871.348701 can see above output input value changed. is there compile time option g++/xlc++ can used value is'nt changed? ::code snippet:: double d2 = 34355372871.3487; double d4 = 3435537287.3487; printf("d2 = %lf\n", d2); printf("d4 = %lf\n", d4); thanks, hudson it precision of double. double stored 64 bits (8bytes). ( http://en.wikipedia.org/wiki/double-precision_floating-point_format ) it uses 52 bits mantissa, 1 bit signal , 11 bits exponent. then, 52 bits mantissa gives 15–17 significant decim...

html - Fotorama thumbnail images not displaying -grey block & no image on click -

i'm having display issues fotorama 4 , cannot head around how fix it. when preview code in codepen.io looks fine when put wix website working on client of thumbnails grey blocks , when click on them no image shows. i'm thinking maybe i've messed somewhere. customised regular code had text display on first image , text disappear on hover. still new customising code suggestions helpful! here customised code using: http://cdpn.io/dyfus as github gist: https://gist.github.com/niamuneca/6173379 if have idea issue please point out , leave tested correction below. your layout wrong. replace this: <img src="1.jpg"><img src="1_thumb.jpg" /></a> <img src="2.jpg"><img src="2_thumb.jpg" /></a> <img src="3.jpg"><img src="3_thumb.jpg" /></a> with this: <a href="1.jpg"><img src="1_thumb.jpg" /></a> <a href...

.htaccess - htaccess redirect with parameters not working correctly -

hope can me. need redirect from /abc_company_detail.php?id=4 detail/4/ so when call url http://mydomain.com/abc_company_detail.php?id=4 got pretty url http://mydomain.com/detail/4/ you can use php framework, , managed url you. if want manually have configure .htacess file. try link. .htaccess friendly url kind of question had been asked before.

javascript - Getting analyserNode data for multiple audio files -

i building analysernode music visualizer such this demo , multiple tracks play simultaneously, , wanted frequency, dbs , waveform in real time each track separately. i managed load , play tracks in sync soundjs analyser data passes through tick(evt) method demo represents tracks. there way information per sound instance playing? thanks in advance did answer on soundjs forum work you?

mamp - Delete old tmp file when Apache starts -

i'm using bitnami mamp stack on osx , clear tmp directory whenever start apache web server. so need know add following command, or script containing command rm -rf ~/library/containers/com.bitnami.mampstack/data/app/php/tmp . takk, robert. just inside mamp program folder. there ./bin/start.sh add line this. or startapache.sh if want execute apache restarts.

java - Display/disappear default text in TextField when user enters data/erase the text -

Image
i trying make registration form , trying display default text in text fields, simple meaning below image. trying , until user enters data field example there field called "first name". when user selects field "first name" text disappears , user can type first name. if user doesn't type anything, text should display again in text field. i tried using focus listener, couldn't work because method if user types data field , go next field , text of previous field gets deleted , default text gets displayed. here have done :- txtfirstname.addfocuslistener(new focuslistener() { public void focusgained(focusevent e) { txtfirstname.settext(""); } public void focuslost(focusevent e) { txtfirstname.settext("first name"); } }); thank time. what trying , until user enters data field example there field called "first name". when user selects field "first name" text ...

html - image viewer using css is not working -

Image
hello friends, i trying develop simple image viewer can see in given picture want when user hover on black box red box appear got problem on last div when user hover on last div red div going outside please me . there way solve using css only. please see code css div{float:left; text-align:center; font-size:16px; color:#404040; margin:0 30px 20px 30px; position:relative; .viewer{ position:absolute; width:300px; background:red; height:400px; top:20px; left:110px; } thanks in advance .. :) i redid you. try , should good. looks have relative , absolute positioning mixed up. html <!-- begin image hover --> <ul class="enlarge"> <!-- first image --> <li> <img src="image.jpg" width="150px" height="100px" alt="dechairs" /><span><img src="image.jpg" alt="deckchairs" /><br />deckc...

Angularjs $watch provides the latest input even when all the information was deleted -

have way around this? there better solution? simulation: http://plnkr.co/edit/2vrt8o?p=preview context: in case inputs used filters, , information entered user used in searches. $ watches used capture information , move service in turn passes second controller. may enough check if old , new values not equal? this: if (newvalue != oldvalue) { $scope.bar = newvalue; } plunk: http://plnkr.co/edit/ooh1am?p=preview

Java Selenium WebDriver - correct exception handling techniques when unable to locate window -

i'm using java , selenium automate test cases. involves loading single page search results , iterating on each 100-1000 links on single page. setting test config check 100 results okay, higher , @ point nosuchwindowexception thrown(subclass of webdriverexception). happens when switch the parent handle newly opened window handle. i've written try-catch statement inside while loop catch exception , retry procedure... however, whatever try, selenium not play nice, , code execution abruptly ends.. :( here code: boolean completed = false; do{ try{ //click search result driver.findelement(by.xpath("my xpath string")).click(); //switch new window for(string winhandle: driver.getwindowhandles()){ driver.switchto().window(winhandle); } //for our test need save source source = driver.getpagesource(); //close popup window , and switch parent ...

c# - Adding values to member fields of object in List<T> at same index -

i have collection of type object called mhp. mhp has multiple member fields(name, ac, par_id, etc). create list; private list<mhp> mhplist = new list<mhp>(); public list<mhp> mhplist { { return mhplist; } set { mhplist = value; } } and populate portion of fields values in loop creating new object: mhplist.add(new mhp { mhp_name = something, mhp_ac = number }); now want populate remaining field value , i’m doing creating new object, places value in new index of collection; mhplist[0] mhp_name = ‘something’, mhp_ac = ‘#’, mhp_parid = null. mhplist[1] mhp_name = null, mhp_ac = null, mhp_parid = ‘something’ i’ve tried creating new list , adding new object list using following add new list mhplist: mhplist.addrange(newlist) as wellas , mhp.insertrange, each time add new index of object in collection. how add values unpopulated fields within same index of collection? just access item using it's index: mhplist = new list<mhp>(...

c# - Finding a set of numbers equals to the number -

i trying write c# program following: takes 2 parameters: list of objects , number iterates through list , find first set of objects equals number. stop iteration if set found , return set. so, have list of user defined object, person example. say, person object has 2 fields, name , age. example, mylist - person1: john, 10 - person2: mary, 25 - person3: mike, 35 - person4: ann, 20 - person5: joe, 5 i want find set list equals number passing in. if passing in above list , 50, want return person2, person4, person5 list. this subset sum problem . unfortunately, np-complete, there no known polynomial solution it. however, have pseudo-polynomial solution, using dyanamic programming , using next recursive function: f(i,0) = true f(0,k) = false (k != 0) f(i,k) = f(i-1,k) or f(i-1,k-weight[i]) running f(n,w) yields true if such solution exists, , false otherwise. the dynamic programming solution fills table, after table full, need "retrace...

ruby on rails - Assigning attributes in HTML form or when calling .new(*attrs) -

i have worked on numerous projects have seen both setting of attributes new object in html form , when calling model.new(foo: 'bar') which correct way of doing in fashion of "best practices"? form: <%= form_for user.new, remote: true |f| %> <%= f.hidden_field :foo, value: "bar" %> <%= f.text_field :email %> <% end %> instance variable: #obviously set in controller @user = user.new(foo: "bar") <%= form_for @user, remote: true |f| %> <%= f.text_field :email %> <% end %> at first case, when validation of user not passed, empty form rendered, @ second case form filled fields rendered. it's because instance variable @user @ controller keep entered values. so recommend use second variant.

c# - Is there more elegant method for multiple conditions verification -

case: asp.net mvc, c# , extjs. user has got filter, can choose multiple values. there 13 such filters , user can add them or remove ui. problem: on server side i've got class getting filters values: public list<string> filter1 { get; set; } public list<string> filter2 { get; set; } ... public list<string> filter13 { get; set; } then select data database , convert ienumerable<dataclass> dataclass looks below: public string data1 { get; set; } public string data2 { get; set; } ... public string data13 { get; set; } then filter data this: if (filter.filter1 != null && filter.filter1.any()) { data = data.where(x => filter.filter1.contains(x.data1)); } ... if (filter.filter13 != null && filter.filter13.any()) { data = data.where(x => filter.filter13.contains(x.data13)); } so there 13 if , 13 same filter logic. , code looks horrible. there way make more beautiful filter? added: filter1 can applied data1 , ...

asp.net - Changes to aspx.vb file not reflected on the server -

i made tweak aspx.vb file on test server, small change custom error message being written in code, making copy of file, changing text , replacing file on server. however, change not reflect when go page browser. i thinking had file not being compiled. however, seems if aspx.vb file should compiled dynamically. there setting ensures happens? copy of web.config file: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <compilation debug="true" strict="true" explicit="true" /> <authentication mode="windows" /> <identity impersonate="true" /> <customerrors mode="on" /> </system.web> <system.webserver> <validation validateintegratedmodeconfiguration="false" /> <modules runallmanagedmodulesforallrequests="true" /> <defaultdocument> <files> ...

C# winforms application: event handler when returning (focus) from an external application -

i have winforms application has perform action every time when returning external application (i.e. focus has been lost application, alt-tabbing program , back). is there application event handler this? i have looked activate , deactive handlers of form, these handlers fired when form receives focus (when closing messagebox or closing subform). windows sends wm_activateapp message window when being activated, , when being deactivated. want handle, when wparam true (indicating activation). winforms not wrap event (at least not i'm aware of), you'll need add code form's window procedure manually: public class myform : form { // other code protected override void wndproc(ref message m) { const int wm_activateapp = 0x001c; switch (m.msg) { case wm_activateapp: { if (m.wparam.toint32() != 0) { // application's window being activated, ...

jquery - After textbox field loosing focues? -

i new ajax/jquery. developing application takes loan number input. when ever textbox field loose focus should display information particular loan getting information database. i developing in mvc. view consists loannumber = textboxfield. contact name = textboxfield phone = textboxfield. below sample code tells whether loan number exists or not. $("#loannumber").blur(function () { var num = $("#loannumber").val(); var status = $("#divstatus"); $.post("/fnmaimport/checkloannumber", { loannumber: num }, function (data) { if (data == true) { status.html("<font color=green>'<b> loan number " + num + "</b>' available!</font>"); } else { status.html("<font color=red>'<b> loan number " + num + ...

Converting rows to columns in ORACLE SQL with parametrization -

for 1 of etl-jobs need sql-query converts rows columns. difficulty want parameterize how many rows getting converted 1 column shown in following example: atm scenario looks this: oracle 11g one column table: parameter ab ae cf gh 5g h3 7p ….. sql-query: select listagg ('''' ||parameter ||'''', ',') within group ( order rownumber) parameter, (select case when rownum <= 5 5 when rownum <= 10 10 when rownum <= 15 15 when rownum <= 20 20 when rownum <= 25 25 end rownumber parameter sr0_crtl_sl_ol_psm_parameter ) group rownumber result this: parameter ab, bg, rt, zh, jk ae, hl, gh, dz, kl cf, gh, nm, sd, ….. what have query takes number eg. 5 following result: parameter ab, bg, rt, zh, jk ae, hl, gh, dz, kl cf, gh, nm, sd, ….. or takes eg. 8 , result like: parameter ab, bg, rt, zh, jk, ae, hl, gh dz, kl, cf, gh, nm, ...

javascript - Phonegap email composer plugin for BlackBerry OS 7 -

it might repeating question did not find solution after search of whole day. i'm developing phonegap application blackberry os 7 stuck email(message) composer plugin. there plugin of phonegap (cordova 2.7) email composer support blackberry os 7. if guys have idea please share it. have tried blackberry os message api , tried mailto: of html5 both not working might i'm doing in wrong way, if guys have tried , success please share process. blackberry 7 provides html5 api blackberry.invoke.messagearguments email composer , easy use instead of writing plugin this. steps implement blackberry.invoke.messagearguments add these code config.xml file <feature id="blackberry.invoke" /> <feature id="blackberry.invoke.messagearguments" /> <feature id="blackberry.message" /> add code js file , call method. function sendmail(){ var torecipient = "user@gmail.com"; var subject = "test mail"; var...

javascript - Rendering a partial multiple times in Handlebars+Nodejs -

i'm quite new world of node , handlebars , have managed single partial rendering in node doing following: response.render('index', { 'data': data, partials: { results: 'results' } }); and in html page have following {{> results}} which renders results.html partial. need have same partial rendering on index page multiple times each different set of data, i've tried following: response.render('index', { partials: { 'data': data, results: 'results' } }); but didn't work.

sql - Joining two log tables to get the status of an account at the time it was subject to a logged event -

i trying join 2 log tables using sql server 2012 , in order add status of each account @ time subject of action logged. the first table report created logs of contact requests users (to other users) of website, based on request date ( request_date ) , receiver ( receiver_account_id ) of request. if contact request approved, approval date ( approval_date ) column populated well. table looks this: receiver_account_id sender_account_id request_date approval_date 13 19 2012-08-10 2012-09-01 13 21 2013-05-15 null 17 19 2011-09-11 null 25 44 2012-11-05 2012-11-07 the second table logs status changes of accounts: date account_id status 2011-07-10 13 free 2012-08-15 13 premium 2010-12-10 17 free 2012...

Old SSIS in SQL Server 2012 -

we in process of migrating our sql server 2005 2012 version. there's significant number of ssis (developedn in vs 2005) running on server. will ok re-deploy these packages on new sql instance? or have go through visual studio upgrade process each? any comments, advice appreciated. thanks in advance. you're looking @ upgrade, variety of reasons. in 2005, packages have been stored in msdb.dbo.sysdtspackages90 2008 forward, table renamed msdb.dbo.sysssispackages even if deploy them sysssispackages , kept 2005 integration services service installed, don't think 2005 dtexec work 2008 version of stored procs in msdb relative ssis work. procs should backwards compatible msdb ssis "stuff" in 2012 poured of attention 2012 ssisdb catalog , clr methods there. depending on connection managers, sql server ole db connection strings changed sqlncli01 sqlncli1.0 (approximate) the internals of how data flows works has changed. mechanism signaling end...

javascript - Google Event Tracker not firing -

i've got event tracker (located in main.js rather inline click handler) supposed fire when user clicks on item specific class. however, client reporting these event tracker never fire, or atleast never sees response them. however, other ga event trackers throughout site working. can see issues code below causing this? the js function in main.js handles looks so: $('.vote.complete').click(function() { whence = "tocompleted"; vote_id = $(this).data('vote_id'); cid = $(this).data('campaign_id'); c_title = $('#outfitpair'+cid).data('campaign_title'); u_id = $('#outfitpair'+cid).data('other_id'); _gaq = window._gaq; if(_gaq != undefined){ _gaq.push(['_trackevent', 'viewpreviousvote', c_title, u_id]); } $('#outfitpair'+cid).find('.button.vote').removeclass('to-vote'); $(this).addclass('to-vote'); $.get('/campa...

Visual Studio won't let me add a COM control to a form in C# -

i'm trying add activex control form in visual studio's designer mode , prompts failed import activex control. please ensure registered. . it's in case have registered properly. prove word, can add same control in same machine other project's form! can't project want. these 2 projects same , can not find difference might have caused this. can suggest might have gone wrong? [update] i'm using visual studio 2010 version 10.0.30319.1 , both projects c# winforms.

.net - Using github on my project that uses NuGet -

i'm creating open-source .net web development framework called "expressforms". uploaded project github: https://github.com/daniellangdon/expressforms . i used nuget set code run latest versions of asp.net mvc , entity framework; these saved in "packages" directory below solution. can see default, git ignores directory when uploading project github. when download project github directory, directory missing , solution won't build. what need make developer can download code github , build right away without fuss? i still new git, it's i'm missing basic. sounds need enable nuget package restore in newly downloaded solution . when using nuget github, github ignores files under packages directory because it's not idea commit binary files (like dll libraries) git, because causes git repos become bloated in size on time because have keep each version of binary in repo history forever (unless go , erase them git filter-branch ). ...

Taking common elements from 2 vectors in Lua -

i have 2 vectors, lets v1 = (a,b,c,d,e) , v2 = (e,h,t,b,w) , want third vector containing common elements of v1 , v2 , in case v3 = (e,b) i've seen asked in c++, cant see lua. i assume when saying vectors, mean v1 , v2 both array-like tables, this: local v1 = {1,2,4,8,16} local v2 = {2,3,4,5} then can this: local v3 = {} k1,v1 in pairs(v1) k2,v2 in pairs(v2) if v1 == v2 v3[#v3 + 1] = v1 end end end

sql server - Scalability limits of federated database on Azure -

we plan use federated azure sql database in our next project, because need database solution can handle large amount of concurrent requests - inserts, selects, updates, etc. however, there hard limit of 180 concurrent requests on database instance. the problem if use federations, every connection must connect federation root first (just regular sql server database). server redirect our client federation member contains required data: -- statement redirect federation root db federation member db use federation myfederation (uid = 0xff) reset, filtering = on; does mean, there no (easy) way scale beyond 180 concurrent requests on federation root server? you should @ sql database premium reservations, eliminate connection limit. http://msdn.microsoft.com/en-us/library/windowsazure/dn369873.aspx it in preview currently, doesn't mean can't start developing on it. don't sla in preview, retry block , using multiple instances mitigated.

c# - 51Degrees Memory Consumption -

i'm crossing posting 51degrees forums hasn't gotten traction there. i went ahead , implemented latest nuget package version of 51degrees site manage here @ work. (2.19.1.4) attempting bring in house management of mobile views site (it's done third party). functionality interested in detection. disabled redirect functionality commenting out redirect element in config , modified logging level fatal (the log in app_data folder). to our understanding, changes needed. , worked. switch our layout view between desktop , mobile based on information 51degrees providing. while testing , promoting through dev , qa noted increased memory consumption in app pool, nothing overly worried about. app pool @ standard traffic levels consumes 230 mb of memory in prod. spike 300 mb during peak times, nothing worrisome, considering fair amount of inproc caching. as of sunday promoted 51degreees lite prod, disabled mobile views (we did in qa well). wanted see how perform in prod , kin...

linux - Minicom offline when trying to communicate using USB to RS232 cable -

i'm using usb rs232 cable communicate between 2 linux machines. on machine usb side connected, run: dmesg | grep tty and following output: console [tty0] enabled serial8250: ttys0 @ i/o 0x3f8 (irq = 4) 16550a serial8250: ttys1 @ i/o 0x2f8 (irq = 3) 16550a 00:0a: ttys0 @ i/o 0x3f8 (irq = 4) 16550a 00:0b: ttys1 @ i/o 0x2f8 (irq = 3) 16550a usb 2-1.2: pl2303 converter attached ttyusb0 so far good. run minicom -s , using "serial port setup", change "serial device" "/dev/ttyusb0", "bps/par/bits" "115200 8n1", , select "no" "hardware flow control" , "software flow control". i save these settings default, exit minicom, , run minicom again. minicom opens, remains "offline". can't enter commands. other linux machine connected serial port side of wire on , running fine. why can't connect other linux machine? minicom decides offline/online based on whether dcd line conn...

joomla - Jooma Custom Component Router.php not being called -

i'm using joomla 3.1. i'm having strange issue router.php file in component. i have basic router.php file, not doing yet, before add features need working on basic stuff first. i have menu item component set item type. viewing homepage shows view created. for links, if use following: echo jroute::_('index.php?option=com_vacations&view=test&cat=123'); i this: http://mysite/en/component/vacations/?view=test&cat=123 i not want "component/vacations" shown however. i've tried this: echo jroute::_('index.php?view=test&cat=123'); and get: http://mysite/en/?view=test&cat=123 seemingly correct, second method never touches router.php. means cannot alter display like: http://mysite/en/test/123 how can fix url parsed through router.php? when use jroute create links application create full query in first code: echo jroute::_('index.php?option=com_vacations&view=test&cat=123'); r...

Android ViewPager, first View is not swiping? -

i have viewpager component inside fragmentactivity , filling fragmentstatepageradapter , fragments. the thing works, there 1 thing don't want, maybe it's expected behaviour: the first fragment / view stays static , not move, when swipe next fragment / view. next fragment get's swiped above first one. when swipe first fragment, it's same. first 1 seems sit under other fragments , not move @ all. looks other fragments pulled away blanket above first one... how can have first fragment being moved in , out other fragments? thanks lot! look @ "customize animation pagetransformer" here http://developer.android.com/training/animation/screen-slide.html it explain how make animation between views. , if want default behaviour, remove call setpagetransformer();

Android how to make new Contacts in contacts app opens Activity -

i'm making app sync contacts phone's contact list app. this have: my app has sync adapter. i mannage sync contacts. the contacts there. at end this: screenshot this cool. my problem: i need open app when user clicks on "my app" row. have no idea how this. have 3 days browsing on google , found nothing... this might help: when click on facebook row this: i/activitymanager( 2014): starting: intent { act=android.intent.action.view dat=content://com.android.contacts/data/10940 cmp=com.facebook.katana/.contacturihandler } pid 18506 email row: i/activitymanager( 2014): starting: intent { act=android.intent.action.sendto dat=mailto:yb_test_001%40hotmail.com cmp=com.google.android.gm/.composeactivitygmail } pid 18346 "my app" row: i/activitymanager( 2014): starting: intent { act=android.intent.action.view dat=content://com.android.contacts/data/11653 } pid 18506 e/infinite(18506): contactinfolistadapter: no activity found external...

firefox - Selenium can't determine ready state -

i'm running automated test in firefox browser using selenium web driver , testng, i'm encountering error: org.openqa.selenium.internal.seleniumemulation.waitforpagetoload handleselenesecommand warning: cannot determine whether page supports ready state. abandoning wait. this has been occurring, think might have firefox updates. know might causing issue?

ios - Adding subview to superview shared by a container view resizes container view -

i have view controller view has container view subview. set initial frame of container view in ib , later change according if iad loaded in banner. if add subview view controller's view container view's frame gets resized frame set in ib. i have no idea why happening , appreciate help. created test app eliminate of other variables know situation. when you're using auto layout, can't set frames of views load xib or storyboard. auto layout sets frames, , ignores changes make frames. need update constraints on views if need move or resize them directly. you can create outlet pointing nslayoutconstraint in view controller, , connect outlet appropriate constraint in xib or storyboard. can change constraint's constant property change view's position or height.

filesystems - How to find out if a directory exists on Delphi XE2 *correctly*? -

i need check if directory exists! if directory "e:\test" e: cd/dvd drive , there no disk inserted on it, see following delphi , windows issues. the first method: function direxists(name: string): boolean; var code: integer; begin code := getfileattributesw(pchar(name)); result := (code <> -1) , (file_attribute_directory , code <> 0); end; it gives range check error . can't use {$rangechecks off} , {$rangechecks on} blocks because: it breaks current state of $rangechecks option. we see system error drive not ready instead range check error . need check if directory exists without error dialogs user. the second method: if directoryexists(name, true) ... this function returns true non-existing e:\test directory on empty cd/dvd drive. can't use because works incorrectly. but then, how find out if directory exists? p.s. think error exists cd/dvd drive. using windows 7 x64 on vmware fusion 5 under mac os x 10.8.4 external cd/...

php - using multiple mysql query loop inside each other -

i have big trouble using multiple queries inside each other. , searched not find needed! problem. plz me. i have table named "cat" , titles mysql , it's ok. have other table named works has field named "cat_id" field connect's data of both tables. works table has field named "years" , it's year of production of artwork. cat >> { id , title , ... } works >> { id , title , url , year , cat_id , ... } i need categorize gallery of works year, made code this: <?php $result = q("cat"); while($row = mysqli_fetch_array($result)) { ?> <div> <h2><a href="artwork.php?id=<?php echo $row['id'] ?>"> <?php echo $row['title']; ?></a></h2> <span> <?php $sql = "select distinct year works cat=".$row['cat_id']; $yresult = mysql_query($sql); while ($yrow = mysql_fetch_row($yresult)) { /...

tcl - Adding/subtracting a second to a UTC timestamp -

i have timestamp data in form of "2013-07-31t13:31:29" need add second to. having issue "clock add" plan convert time epoch time , increment it. when trying noticed times don't seem match each-other. timestamp: 2013-07-31t13:31:29 epoch time: 1375252289 gmt: wed, 31 jul 2013 06:31:29 gmt this timestamp generated via tcl code below: # timeminusmilli == 2013-07-31t13:31:29 set epoch [ clock scan $timeminusmilli -gmt 0 ] now, maybe i'm confused, think 2013-07-31t13:31:29 wed, 31 jul 2013 1:31:29, not 6:31:29. the way iso times scanned tcl documented: http://www.tcl.tk/man/tcl8.5/tclcmd/clock.htm#m83 an iso 8601 point-in-time specification, such “ ccyymmdd t hhmmss ,” t literal “t”, “ ccyymmdd hhmmss ”, or “ ccyymmdd t hh:mm:ss ”. note these 3 formats accepted. command not accept full range of point-in-time specifications specified in iso8601. other formats can recognized giving explicit -format option clock scan command. so, either ...

Array value find using index partial string using PHP -

i having below array. value having '1' , key should 'wf_status_step%'. how write php script this? [ini_desc] => 31.07 initiative1 [mea_id] => 1 [status] => 4 [name] => 31.07 measure1 [scope] => npr [sector] => [mea_commodity] => 8463 [commodity_cls] => [delegate_usrid] => 877 [wf_status_step1] => 2 [wf_status_step2] => 1 [wf_status_step3] => 0 [wf_status_step4] => 0 [wf_status_step5] => 0 you can iterate on keys in array find keys match pattern, , simulatenously check associated values. this: <?php $found_key = null; foreach(array_keys($my_array) $key) { if(strpos($key, "wf_status_step") === 0) { //key matches, test value. if($my_array[$key] == 1) { $found_key = $key; break; } } } if( !is_null($found_key) ) { //$found_key 1 you're looking } else { //not found. } ?> if want more sophisticated matching key, can use regular expre...

jquery - Trouble adding double the divs i already have -

okay creating game fun. game involves 5 second timer , divs shapped boxes. first round start off 1 div purpose click on div before timer runs out. if pass go next level adds double boxes level 2 have 2 boxes level 3 4 boxes , on. having trouble creating double length of div. dont have code because nothing ive tried has worked. here jsfiddle: http://jsfiddle.net/jzdkq/ <!doctype html> <html> <head> <title>jquery project: exploding game</title> <meta charset="utf-8"> <style> body, html { width: 960; height: 500%; } div.box { position: relative; width: 100px; height: 100px; background-color: orange; } div.exploding { position: absolute; width: 100px; height: 100px; background-color: red; } </style> </head> <body> </body> </html> your javascript... settimeout(function(){$("body").append("<div class='box'></div>").length() *2;}, 5000); is saying......

What best way to populate java list with separate elements and elements from other lists? -

i need create linked list , populate "containers" , "elements" containers. this code: public list<webelement> getexpectedelements(){ list<webelement> list = new linkedlist<webelement>(arrays.aslist( inetconnection, wiredconnection, phonesconnection, usbconnection, wificonnection )); list.addall(inetconnection.getexpectedelements()); list.addall(wiredconnection.getexpectedelements()); list.addall(phonesconnection.getexpectedelements()); list.addall(usbconnection.getexpectedelements()); list.addall(wificonnection.getexpectedelements()); return list; } is there way in java make nicer (more laconic, dry, etc.) ? you @ least introduce loop: list<webelement> containers = arrays.aslist(inetconnection, wiredconnection, phonesconnection, usbconnection, wificonnection); list<webelement> list = new linked...

access token - Google OAuth 2.0 returns invalid redirect_uri_mismatch when getting access_token -

i trying exchange oauth one-time use code got client-side app access token , refresh token on server. response is: { "error" : "redirect_uri_mismatch" } my post request is: post /o/oauth2/token http/1.1 host: accounts.google.com content-type: application/x-www-form-urlencoded code={my code}& client_id={my client id}& client_secret={my client secret}& grant_type=authorization_code i have checked client id , client secret against in api console , match. i one-time use code on client following java code: static final list<string> scopes = arrays.aslist(new string[]{"https://www.googleapis.com/auth/plus.login","https://www.googleapis.com/auth/userinfo.email"}); string scope = string.format("oauth2:server:client_id:%s:api_scope:%s", server_client_id, textutils.join(" ", scopes)); final string token = googleauthutil.gettoken(c, email, scope); i have redirect_uri in api console, since trying ...

c# - Hide Windows Forms ListView Column in Details View without deleting Column or resizing it to Zero -

Image
i have in c# net 2.0 windows forms listview ten columns filled data @ startup of application. data huge, cannot reloaded fast in-between. listview has details view on , allows user resizing of each column separately. the user shall able hide of ten columns or multiple of them @ once , unhide columns again time in non-specific row. data shall not deleted while hiding column. following things have tried result not satisfying: 1) resizing column size 0 make disappearing until user starts play columns. user accidently resize them because in listview there option allowed user resize each column manually. 2) deleting column out occurs following problem: when try add column back, column doesn't remember position , size. position main problem, i'll try explain why. if user decides first hide "column 2" , "column 3" , user later unhides 3 before 2, "index 2" doesn't exist, cannot insert @ index no. 3 , exception rises. if remember index posi...