Posts

Showing posts from June, 2011

jQuery UI Calendar Widget + Input Placeholders for IE8 -

i using jquery ui's calendar widget form, , received word input placeholder not showing in ie8. ie8 doesn't support them, i've been trying implement shim. 1 found on here following: https://github.com/parndt/jquery-html5-placeholder-shim it simple, , straight forward, doesn't seem work in ie8 still. happens input appears blank, when clicked on, placeholder appears, , disappears once date selected. i've tried re-initializing plugin after datepicker drawn, doesn't seem me. anyone have success combining jquery ui datepicker ie8 placeholder shim?

ios - Quartz and clipping area -

i have question quartz , clipping area: i have rectangle inside rectangle have rectangle b filling of b dveve cut in a: pierced b. best way in quartz? did not understand how clipping if understand correctly, want draw smaller rectangle inside larger rectangle inner rectangle transparent. can achieve drawing cashapelayer path contains both rectangles subpaths. don't forget set layer's fill rule kcafillruleevenodd . try this: cgrect recta = cgrectmake(100, 100, 200, 200); cgrect rectb = cgrectmake(150, 150, 100, 100); uibezierpath *path=[[uibezierpath alloc] init]; // add sub-path recta [path movetopoint:cgpointmake(recta.origin.x, recta.origin.y)]; [path addlinetopoint:cgpointmake(recta.origin.x+recta.size.width, recta.origin.y)]; [path addlinetopoint:cgpointmake(recta.origin.x+recta.size.width, recta.origin.y+recta.size.height)]; [path addlinetopoint:cgpointmake(recta.origin.x, recta.origin.y+recta.size.height)]; [path closepath]; // add sub-path rectb [pa...

mongodb - Mongoid embed_one and has_one -

recently working on mongoid, i'm confused embed_one in mongoid same has_one? if no, what's difference , examples? first of all, read mongoid documentation relations ! mongoid embedded 1-1 one 1 relationships children embedded in parent document defined using mongoid's embeds_one , embedded_in macros. mongoid refrence 1-1 one 1 relationships children referenced in parent document defined using mongoid's has_one , belongs_to macros. from mongodb documentation : embeds_one benefits against has_one generally better performance read operations. the ability request , retrieve related data in single database operation. large data problem : embedding related data in documents, can lead situations documents grow after creation. document growth can impact write performance , lead data fragmentation. furthermore, documents in mongodb must smaller maximum bson document size. that happens when using embeds_man...

c# - Using XmlSerializer and setting root class name -

trying work xmlserializer nicely deserialize stuff webservice. here class declaration: [serializable] public class carrierlookupresponse { [xmlelement(elementname = "responsedo")] public responsedo responsedo { get; set; } } here how xml looks: <?xml version="1.0" encoding="utf-8" ?> <carrierservice.carrierlookup> <responsedo> <status>approved</status> <action>ok</action> <code>sfw00389</code> <displaymsg></displaymsg> <techmsg></techmsg> </responsedo> here code use deserialize: var serializer = new xmlserializer(typeof(carrierlookupresponse)); var carrierlookupresponse = serializer.deserialize(new stringreader(response.key)) carrierlookupresponse; problem simple. service returns "carrierservice.carrierlookup" , need force deserialize "carrierlookupresponse" i can't p...

task in increment , decrement , printf() , why these are evaluated in this manner in C -

this question has answer here: why these constructs (using ++) undefined behavior? 12 answers #include<stdio.h> #include<stdlib.h> int main() { int a=3; //case 1 printf("%d %d %d\n",(--a),(a--),(--a));//output 0 2 0 printf("%d\n",a);//here final value of 'a' //end of case 1 a=3; //case 2 printf("%d\n",(++a)+(a--)-(--a));//output 5 value of 2 printf("%d\n",a);//here final value of 'a' //end of case 2 a=3; //case 3 printf("%d\n",(++a)*(a--)*(--a));//output 48 value of 2 printf("%d\n",a);//here final value of 'a' //end of case 3 //case 4 int i=3,j; i= ++i * i++ * ++i; printf("%d\n",i);//output 81 i=3; j= ++i * i++ * ++i; printf("%d\n",j);//output 80 //end of case 4 return 0; } i clear how these outputs coming spent 3 hours in gazing @ , want know in...

php - form submit inside navigation menu -

Image
what need this my php code is: class logout{ public function __construct(){ session_unset(); session_destroy(); session_write_close(); setcookie(session_name(),'',0,'/'); session_regenerate_id(true); } } if(!empty($_post['logout'])){ $object=new logout(); } for i'm using html code: <ul id="navlist"> <li><a href="index.php">home</a></li> <li><a href="dates.php">dates</a></li> <li><a href="candidate.php">candidates</a></li> <li><a href="database.php">database</a></li> <li><a href="password.php">change password</a></li> <li><a href='logout.php'>log out</a></li> </ul> for logout need javascript form submit anchor i've read not secure....

c# - Use same code on another button -

i'm using exact same code multiple times , thought quite inefficient copy/paste everything. there way let's button2 use exact same code button1 without copy/pasting everything? some of code big, that's why i'm asking. i'm aware of example: private tabpage t { { return (t.selectedtab); } } however have no idea how make work this: (yes, there multiple ways enable full screen mode in application) if (formborderstyle != formborderstyle.none) { formborderstyle = formborderstyle.none; windowstate = formwindowstate.normal; windowstate = formwindowstate.maximized; p1.backcolor = color.white; p2.backcolor = color.white; topmost = true; c2.visible = false; wi.visible = false; t1.visible = false; f.text = "exit full screen"; t2.text = "exit full screen"; } else ...

Email to automatically add calendar reminder to their calendars -

is there way send mass email , automatically add calendar reminder users' calendars? i've found can export .ics file , link users can import program of choice, automatically calendar? i've used article follow, nothing automatically adding user's calendar nor use email service. http://www.whatcounts.com/2013/07/feature-friday-add-calendar-events-in-publicaster-edition/ you can not force automatically download .ics, can imagine, auto downloading in email pose security risk reader. all can host .ics (or file really) on web , hyperlink 'save calendar' type linkin email.

c# - Diference between special tags asp.net -

i'm developing front-end part of application right now, , question came mind. what difference between asp.net special tags: <%= %> <%@ %> <%# %> and if exists special tag please describe function. <%= prints raw value of expression within. syntax can cause xss vulnerabilities , should not used. <%: prints , html-escapes value of expression within. <%# <%= , used data-binding <% executes block of code , ignores , return values <%@ used directives page or imports .

Importing XML in HTML with javascript -

i trying import xml-file html document javascript. it works fine firefox, doesn't work ie-10 , chrome. my script: if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.open("get","xml_input.xml",false); xmlhttp.send(); xmldoc=xmlhttp.responsexml; i think changed xmlhttprequest again can't find it's replacement anywhere. i'm hoping on site can me. are using server of kind? if you're testing off of local address, e.g. file://whatever/your/thing/is won't able make http requests default unless you're in firefox or safari. if using server, errors in console? can see request being attempted in network tab?

javascript - Insert child tag at mouse position -

i have div element text and, possibly, other children tags inside (imgs, spans, etc). need following - when user clicks somewhere within div on text, child tag has inserted in position inside text. absolute positioning not option - need modify innerhtml of div. for instance, if div is <div>some text, more text</div> and user clicks right after "more", div should modified follows <div>some text, more<span>new tag</span> text</div> you wrap each word/character in span , append new tag after one. letteringjs ( http://letteringjs.com/ ) can that. if you'd use inputs, use jcaret ( http://www.examplet.org/jquery/caret.php ) looks quite fancy, judging examples.

openlayers - Adding data to an open layers marker -

i'm using open street maps , open street layers , trying create map of tickets (markers) technician go marker , work , move next. able create marker , have onclick function fires. can't figure out how pull out information marker itself. creating markers like.. addpinvialonglat: function(icon, long, lat, popupstring) { var icon_marker = new openlayers.icon(icon, null, null); var marker = new openlayers.marker(new openlayers.lonlat(long, lat).transform(rapidschedulingmap.coor_from, rapidschedulingmap.coor_to), icon_marker); var popup; marker.events.register('mouseover', marker, function(evt) { popup = new openlayers.popup.framedcloud("popup", new openlayers.lonlat(long, lat).transform(rapidschedulingmap.coor_from, rapidschedulingmap.coor_to), null, popupstring, null, false); rapidschedulingmap.map.addpopup(popup); }); marker.events.register('mouseout', ma...

easy install - whatprovides equivalent for pip or easy_install -

in yum can yum whatprovides *filename . there such equivalent in pip or easy_install? if getting error in importing py module fooblabla, how can find out python egg/package provides that? did try? $ pip search <packagename> this query searches package metadata (including name, short description, keywords, among others). doesn't seem quite deep search whatprovides functionality, unless have package installed already, isn't clear how find modules contained within package (see answers here case). however, don't see how wouldn't know package name if having problems importing module it.

Self calling PHP form doesnt work after "Use URL rewriting" is set to Yes in Joomla 2.5 -

i have self calling php form in joomla article. article linked menu item. <form class="form-inline" name="test" action="<?php echo htmlentities($_server['php_self']); ?>" onsubmit="return validateform()" method="post" > before using "use url rewriting" php form working fine. i.e "use url rewriting" set no. after setting "use url rewriting" yes php self calling form doesnt submit. when submit button pressed, browser throws user homepage. i want use "use url rewriting"->yes makes website seo friendly while using php self calling form. there way both ? thank in advance. i able using $_server['script_url'] , possible other $_server array elements trick too, such $_server['request_uri'] , $_server['redirect_url'] , $_server['redirect_script_url'] . if not help, add code var_dump($_server); to show array elements , look...

swing - Save Java GUI layout configuration (w/ a Desktop Pane) between uses -

i'm developing gui , have save layout information between sessions. specifically, if user runs gui, moves gui different part of screen, gui save screen location before closes next time opens open @ new screen location. same width , height (to preserve re sizing user make gui). lastly, use desktop pane inside gui has multiple internal frames. love preserve layout (screen position, height , width, iconified (minimized) or not) of each internal frame. my question is, there easy, built in way in java? or need manually. searched around couldn't find on topic. i'm developing gui using netbeans gui editor. thanks!! implement windowlistener , in windowclosing() call, save information gui properties system, store them file. upon constructing gui, read properties file (if exists) , set properties of components want maintain attributes for. make sure use different names each of internal frames don't overwrite properties.

android - Best Way to Convert HTML and jQuery Mobile into a cross platform app? -

i write question pure frustration. let me first explain app does: the app pulls , updates data on server. it, don't else except this. i.e wont using camera or contacts list - nothing working server , api. what wish in future: simply have facebook js sdk functionality. android push notifications i have few weeks been using phonegap take html , jquery mobile code , run on android. but in phonegap have add many issues, creating phonegap project mission. facebook plugin phonegap appalling (it doesn't work). i'm looking community guidance , on subject. im hoping phonegap not way out? please really appreciated!! if you're looking alternative phonegap, , app simple, create android, ios app webview (browser) component, through app delivered. or, simpler, create bookmark of app's website url. in both of these scenarios, you'll need trouble issues of jquery , other libraries want integrate.

php - bootstrap typahead and mysql data retrieving -

i have followed tutorial http://blattchat.com/2013/06/04/twitter-bootstrap-typeahead-js-with-underscore-js-tutorial/ , working in own project. managed set hidden field id , submitting form page. how can "local" array replaced array retrieved mysql database. i tried http://www.codingforums.com/showthread.php?t=286412 did not work setting hidden field. ===================================================================== after trying things following working. <div class="content"> <form method="post" name="quicksearchform" id="quicksearchform" action=""> <fieldset> <input type="text" placeholder="quick search" id="quicksearch" class="quicksearch"> <input type="hidden" id="quicksearchid" name="quicksearchid"> <input type="hidden" id="quicksearchtype" name="quicksearchtype"> </...

powershell - get-wmiobject to pull logs using Win32_NTLogEvent -

i have use get-wmiobject pull logs off of remote server. winevent doesn't work 2003 servers , i'm getting blocked using eventlog. when run following command in powershell works fine, when send output file different results , i'm not sure why? get-wmiobject -computername $server -query "select * win32_ntlogevent (logfile='system') , (eventcode='19') , (timewritten>'$begindate')") the output in powershell: category : 8 categorystring : installation eventcode : 19 eventidentifier : 19 typeevent : insertionstrings : {update microsoft .net framework 2.0 sp2 on windows server 2003 , windows xp x86 (kb2836941)} logfile : system message : installation successful: windows installed following update: update microsoft . net framework 2.0 sp2 on windows server 2003 , windows xp x86 (kb2836941) the output of same command made variable , moved ( $x > file.txt ) different. s...

Passing in variable values when calling `sass` from command line -

this question asked few months ago ended not having answer i'm wondering if in time 1 has come up. i want use mixins turn relative url's absolute ones without hard-coding host in file. i'm not using rails or ruby ... rendering standalone, called web server written in different language. it'd nice able specify base/host during command line call -- server supplying proper protocol, host, port, etc. sass tack on relative url's @ end of. the 'solution' last question had asker didn't need functionality. maybe can way? (i'd rather not interpolate entire sass file pre-processing script) the functionality seek part of compass. use url helper functions assets (images, stylesheets, fonts) .foo { background-image: image_url('my-image.png'); } the config.rb options relevant question are: http_path images_dir relative_assets ( see configuration variables ) if want have settings different development vs production...

vim - Toggle semicolon (or other character) at end of line -

appending (or removing) semicolon end of line common operation. yet commands a; modify current cursor position, not ideal. is there straightforward way map command (e.g. ;; ) toggle whether semicolon appears @ end of line? i'm using command in vimrc append: map ;; a;<esc> something work nnoremap ;; :s/\v(.)$/\=submatch(1)==';' ? '' : submatch(1).';'<cr> this uses substitute command , checks see if last character semicolon , if removes it. if isn't append character matched. uses \= in replacement part execute vim expression. if wan't match arbitrary character wrap in function , pass in character wanted match. function! toggleendchar(chartomatch) s/\v(.)$/\=submatch(1)==a:chartomatch ? '' : submatch(1).a:chartomatch endfunction and mapping toggle semicolon. nnoremap ;; :call toggleendchar(';')<cr>

c++ - Program crashing when accessing 2D struct -

so have spent countless hours trying find answer question. have found close not guess post here. i'm trying create 2d array of structs. call function create struct , input values struct. example of possible output: input: int 5, int 5 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 i able create struct program keeps crashing when try input values. inputs great! here's code below. struct values{ int mult; float div; }; values** create_table(int row, int col){ values** tab = new values*[row]; values* one_row = new values[col]; (int = 0; < row; i++){ tab[i] = one_row; } return tab; } void set_m_values(values** tab, int row, int col){ (int = 0; < row; i++){ (int j = 0; < col; j++){ tab[i][j].mult = (i+1)*(j+1); } } } int main() { int row = 5; int col = 5; values** tab = create_table(row, col); set_m_values(tab, row, col); (int = 0; < row; i++){ (int j = 0; j< col; j++){ cout <<tab[0][i].mult; } ...

asp.net mvc - MVC Application to Display embedded PDF documents -

i have mvc 4 project publish azure. want embed pdf documents pages. looking server side solution not depend on client side adobe installation. has found solution this? here related post suggests embedding pdfs in html, typically via pdf.js library.

java - JavaFX Clients and JDBC Servers: Are JavaFX Bean-style objects required on the server side? -

i have jdbc application built around single-server database (the rdbms hsqldb -- love far). in first draft of application, have used following tiered approach: +-------------------------------+ | data store (appx 20 tables) | hsqldb; highly normalized tables +-------------------------------+ | v +-------------------------------+ | domain object layer (1:1) | java class each table in db +-------------------------------+ | v +-------------------------------+ abstraction objects app | client object layer / dao's | logic uses (denormalized) +-------------------------------+ | v +-------------------------------+ adapts observablearraylist() instances | presentation layer (javafx) | of objects gui +-------------------------------+ in domain object layer presently jdbc queries generic static method: static <e> observablelist<e> dogenericquery(sqlparamete...

java - ArrayList of ArrayLists in Recursion -

i've been working on larger project, , ran problem have replicated here in simpler fashion. i'm trying add arraylist of integers arraylist. problem every arraylist add larger arraylist gets updated if same. public class recursiontest { static arraylist<integer> test = new arraylist<integer>(); static arraylist<arraylist<integer>> test1 = new arraylist<arraylist<integer>>(); public static void testrecurse(int n) { test.add(n); if (n % 2 == 0) { test1.add(test); } if (n == 0) { (arraylist<integer> : test1) { (integer : a) { system.out.print(i + " "); } system.out.println(); } return; } testrecurse(n - 1); } public static void main(string[] args) { testrecurse(10); } } the output is: 10 9 8 7 6 5 4 3 2 1 0 10 9 8 7 6 5 4 3 2 1 0 10 9 8 7 6 5 4 3 2 1 0...

Uncaught TypeError: Cannot call method 'replace' of undefined in jquery -

i have template in javascript act html "load-more" widget. want replace variables in template dynamic data have pulled database. trying replace variable "id" in specific div dynamic data. here code: template: var likes_template = '<div class="activity_sub_header">you want <span class="stage_name"></span> play {{auth::user()->city}}!</div>' +'<br>' +'<div class="description">' +'<div class="activity_body">description ... <a href="/artists/id">see more...</a></div>' +'</div>' +'<div class="image"><a href="/artists/id"><img src="image_path" alt="" height="80" width="80" class="img-rounded"></a>' +'</div>...

C Dynamic List Troubles -

typedef struct { long blarg; } item; typedef struct { item* items; int size; } list; list , item structs, simple. list l; l.size = 3; realloc(l.items, l.size*sizeof(item)); create list, allocate hold 3 items. item thing; item thing2; item thing3; thing.blarg = 1337; thing2.blarg = 33; thing3.blarg = 123; l.items[0] = thing; l.items[sizeof(item)+1] = thing2; l.items[(sizeof(item)*2)+1] = thing3; create items , add them list... when printing them: printf("list 0: %ld\n", l.items[0].blarg); printf("list 1: %ld\n", l.items[sizeof(item)+1].blarg); printf("list 2: %ld\n", l.items[(sizeof(item)*2)+1].blarg); list 0: 1337 list 1: 33 { list 2: 1953720652 ! where did go wrong? you should change l.items[sizeof(item)+1] , l.items[(sizeof(item)*2)+1] --> l.items[1] , l.items[2]

string - strcpy 2D Array problems in functions -

may ask wrong code? strcpy seems working inside function. when i'm passing function, first array prints okay other ones don't print correctly? what seems problem code , correct way? here code: void copystring(char *data, int ctr){ int i; char constdata[10][50] = {{"hello"}, {"goodbye"}, {"konichiwa"}, {"sayonara"}, {"ni hao"}, {"zai jian"}, {"annyeong haseyo"}, {"annyeonghi gaseyo"}, {"bonjour"}, {"au revoir"}}; char temp[50][100]; strcpy(temp[ctr], constdata[ctr]); if (ctr == 4) for(i = 0; <=ctr; i++) printf("in function: %s\n", temp[i]); strcpy(&data[ctr], temp[ctr]); } int main() { int = 0, ctr = 0; char data[20][10]; (ctr = 0; ctr <= 4; ctr++) copystring(data[ctr], ctr); printf("\n"); for(i = 0; <= 4; i++) ...

objective c - Algorithm or math to project a GIF file size? -

i have user's animated gif file 10mb. i'd allow users upload , let me host on server, i'd rescale fit maximum file size of 5mb conserve bandwidth hotlinking. i have basic method right determines targetwidth , targetheight based on pixel surface area. it works enough: cgfloat aspectratio = originalheight / originalwidth; cgfloat reductionfactor = desiredfilesize / originalfilesize; cgfloat targetsurfacearea = originalsurfacearea * reductionfactor; int targetheight = targetsurfacearea / sqrt(targetsurfacearea/aspectratio); int targetwidth = targetsurfacearea / targetheight; its accurate, ex. results: 27mb file turn 3.3mb, or 13.9mb turn 5.5mb. i tune accuracy closer 5mb, , hoping know bit more how gif color / frame count better factored algorithm. thanks not sure you're going find easy way this. projecting compressed size of file without running compression algorithm seems me non deterministic. however, if have plenty of com...

zurb foundation - CSS Styles to only One Class -

using zurb's foundation, i'm attempting add own styles navbar, working great. unfortunately, zurb's responsive navbar changes when viewing container becomes smaller. when this, adds second class nav element. before responsive change: <nav class="top-bar"> after responsive change: <nav class="top-bar expanded"> my custom styles terrible expanded navbar, , wondering if there way apply styles when element contained solely 1 class , not multiple. know it's easy apply styles when element has 2 or more classes, can exclude one? thanks! you can use selector style in css: .top-bar:not(.expanded){ //your style }

animation - Layer masking based on positioning iOS -

Image
i've never worked animations on ios , hoping pointed in right direction. have far animated bunch of pill shaped objects in fashion similar have below, have yet implement correct masking based on y positioning of shape. the pill shapes uiviews. i'm looking way backgrounds change based on positioning; background not move, pills. edit: based on rob's answer below, tying animation device's movement so: - (void)setanimationtodevicemotion { motionmanager = [[cmmotionmanager alloc] init]; motionmanager.devicemotionupdateinterval = 0.1f; nsoperationqueue *motionqueue = [[nsoperationqueue alloc] init]; [motionmanager startdevicemotionupdatesusingreferenceframe:cmattitudereferenceframexarbitraryzvertical toqueue:motionqueue withhandler:^(cmdevicemotion *motion, nserror *error) { if (!error) { double pitch = motion.attitude.pitch; nslog(@"%f", pitch); [self addmasktoview:self.imageview withadjustm...

c++ - function does not take 0 arguments / error C2660 -

this error i've managed solve once more had problems computer , lost everything. me? lack resolve error, more can not in way. ------ build started: project: ruby, configuration: release win32 ------ main.cpp main.cpp(172): error c2660: 'escanerprocessomemoria' : function not take 0 arguments ========== build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== the line : // main.cpp #include "stdafx.h" #include "mnamecolor.h" #include "mrealhooks.h" #include "mmrsdecryptor.h" #include "minitialcostume.h" #include "md5wrapper.h" #include "zgameclient.h" #include "zpost.h" #include "globais.h" #include "d3d.h" #include "mrscheck.h" #include "gunzexp.h" #include "hack.h" #include "hotkeys.h" #include "contador.h" #include "heuristica.h" void exchange1( dword pointer, byte value ){ dword old; ...

c - Delete N nodes after M nodes in Linked list -

i wrote c program deleting n nodes after m nodes. can't figure out why not working. using head node rather head pointer. use head node rather head pointer ? here code : #include<stdio.h> #include<stdlib.h> struct node { int data; struct node *next; }; struct node* create() { struct node *head=malloc(sizeof(struct node)); head->next=null; return head; } void insert(struct node *head,int x) { struct node *temp=head; struct node *new=malloc(sizeof(struct node)); new->data=x; new->next=null; while(temp->next!=null) temp=temp->next; temp->next=new; } void display(struct node *head) { struct node *temp=head->next; while(temp!=null) { printf("\n%d\n",temp->data); temp=temp->next; } } void skipmdeleten(struct node *head,int m,int n) { int i; struct node *cur=head->next; while(cur) {printf("djhfj"); for(i=1;i...

java - Get the values of posted array in servlet -

var schedule = []; var data = { 'user_id' : '12', 'day_of_week' : 'monday', 'when' : 'start', 'modified' : 'true' } schedule.push(data); var data = { 'user_id' : '13', 'day_of_week' : 'tuesday', 'when' : 'end', 'modified' : 'false' } schedule.push(data); // schedule have 2 objects in i posting array servlet using jquery ajax post request below . data : {'mydata':schedule}, url :"./mycontroller", now how can array of objects , literate values? each array object has string, long , boolean type values. how can values iterating? may can try this json.getjsonobject("mydata").getstring("your_values");

c++ - Why QFileIconProvider is included in QtWidgets -

are there essential reasons why qfileiconprovider ( link ) included in qtwidgets library instead of qtcore ? class usable , great in cases, location in qtwidgets makes qml application depending on library because of 1 class. as pointed out: looks more bug report or feature request qt project stack overflow question. however, answer isn't hard guess: qt isn't qml. in qt 5 qml sort of addon qt. in pure c++/qt applications qfileiconprovider in qtcore not make sense. helper class qfilesystemmodel, makes sense view class, of course located in qtwidgets. naturally ask, if qfilesystemmodel needs in qtwidgets, this, recommend qt-interest mailing list. http://lists.qt-project.org/mailman/listinfo

ruby on rails - Activeadmin ajaxing form with geocoder -

i have model relation of: event -> has many schedules schedule -> has 1 address i wanted have textfield in address form allows user enter address , click 'search button', user can ajax select geocoder addresses. however, can't seem create custom(non model related) textfield or button form |f| f.inputs f.input :title f.input :category f.input :avatar, :as => :file f.input :description, as: :html_editor #schedules f.has_many :schedules |schedule| schedule.inputs "schedules" link_to("auto fill address", find_location_path) #address schedule.inputs "address", :for => [:address, schedule.object.address || address.new] |address| address.input :full_address address.input :city address.input :country, :include_blank => true address.input :postcode address.input :latitude address.input :longitude end #schedule times schedule.in...

mysql - Auto erase table data in php myadmin -

i'm developing feedback form, students allowed give feedback on particular subjects. have table 3 fields "id, unique no, password", students admission number stored. here want. each students completes giving feedback, particular data's table must deleted automatically. please help. this can done join , i'll demonstrate trigger here, because mentioned in comment above. i assume you've got table store students feedback data. let's call students_feedback , other students_admission example. using mysql triggers , assing database delete student admission data automatically on insert . you'll want use on create , because feedback data stored in students_feedback table, insert event triggered. so, example: create trigger delete_admission after insert on students_feedback each row begin delete students_admission students_admission.id=old.id limit 1; end; use whatever delete query want here. note: before mysql 5.0.10, tr...

html form - bootstrap textbox going out from span -

Image
i using bootstrap website . facing 1 strange problem textbox coming out span defined . here code sign when remove span6 line textbox comes inside div . here fiddle of clean code running in bootstrap... can see issue gone, it's matter of seeing how want modify code reach aspect proper bootstrap usage. the fiddle i can see not using bootstrap it's 12 grid column system. maybe need add picture of end view better idea on how you. you care using input type="textbox" isn't valid. think looking input type="text" controlling width of text boxes pretty simple using .span# (in # goes span number) can set text inputs span12 , make them full width of parent container. here code cleaned bit <div class="row-fluid"> <div class="span12"...

asp.net - PDF creation using itextsharp is not working in client's server -

i tried build pdf dynamically based on conditions , works pretty in our machines , 1 of our client's machine. customer, when deployed system, pdf not generating correctly. have following code generate this public void pdf_moderatedata(string name, string dob, string gender, string age) { phrase pat_name = new phrase(); phrase phr_paitient_name = new phrase(); phrase phr_paitient_dob = new phrase(); paragraph pat_det = new paragraph(); paragraph paitient_name_dob = new paragraph(); paragraph mul_column = new paragraph(); itextsharp.text.font fntnormaltext = fontfactory.getfont(fontfactory.times, 12, itextsharp.text.font.normal); itextsharp.text.font fntboldtext = fontfactory.getfont(fontfactory.times, 12, itextsharp.text.font.bold); itextsharp.text.font fntsmalltext = fontfactory.getfont(fontfactory.times, 8, itextsharp.text.font.normal); phr_paitient_name = new phrase(system.environment.newline + system.environment.newline + name...

javascript - Keeping fixed footer and header from overlapping -

i got code right , made fixed header , footer template working on, , re sizes according window size fine. there way keep header , footer touching each other when resize window. header 190px high , footer 134px high. need when position of footer 190px top of page prevent going higher need this: if(window_size_height = 325px){ stop resizing!} or if(footer 325px top){ footer_y_position cannot go higher} here sample test http://jsfiddle.net/kyyb7/ edit: $(window).resize(function(){ if($(window).height() < 435+$('#header').height()){ $('#footer').css('position','relative'); } else { $('#footer').css('position','fixed'); } }); what can either use css3 media queries mentioned or can use javascript / jquery. this way in jquery: $(window).resize(function(){ if($(window).height() < 325){ $('#footer').css('position','relative'); } else { $(...

javascript - availWidth not working in mozilla & IE -

as menu becoming big lower resolution, im removing less important buttons....but not working in mozilla & ie ? javascript <script> if(screen.availwidth<=1345) {var r1=document.getelementbyid("rem1"); r1.remove();} if(screen.availwidth<=1255) {var r2=document.getelementbyid("rem2"); r2.remove();} </script> html <li id='rem1'><a href=''id='pad2'>resources</a></li> <li id='rem2'><a href='' id='pad2'>help</a></li> the screen.availwidth property seems work ok, alternative can use document.body.clientwidth . remove element can use r1.parentnode.removechild(r1); instead of .remove() method , purpose i'd recommend rather adjust display property here: window.onload = window.onresize = function () { var r1 = document.getelementbyid("pad1"); var r2 = document.getelementbyid(...

django passing post variables -

i'm doing dynamic form javascript in django template. number of inputs depends of number of points user had made in map. when try inputs in view, i've got them disordered. when see post variables debug, variables arranged. idea? template.html function getcoordinates(){ var = 0 form = document.getelementbyid('frm'); (var i=0; i<points_l.length; i++){ inp=document.createelement('input'); inp.type='hidden'; inp.value=coord_l[i].lon+","+coord_l[i].lat;//setattribute('value',coord_l[i]); inp.id='inp_'+i; inp.name = 'inp_'+i; form.appendchild(inp); } form.submit(); } views.py for k, v in request.post.iteritems(): if k.startswith('inp'): elems = v.split(',') lon = ''.join(...

mp3 - Loading audio file from an URL in Lua -

i need load mp3 file url in lua. i've tried doesn't work. require "socket.http" local resp, stat, hdr = socket.http.request{ url = "https://www.dropbox.com/s/hfrdbncfgbsarou/hello.mp3?dl=1", } local audiofile = audio.loadsound(resp) audio.play(audiofile) any ideas? the request function "overloaded" (in terminology of other languages). detailed in documentation , has 3 signatures: local responsebodystring, statusnumber, headertable, statusstring = request( urlstring ) -- local responsebodystring, statusnumber, headertable, statusstring = request( urlstring, requestbodystring ) -- post local success, statusnumber, headertable, statusstring = request( requestparametertable ) -- depends on parameters see documentation details, concerning error results. for last form, lua syntax allow function called table constructor instead of single table parameter in parentheses. that's form , syntax using. but, incor...

r - How to convert spectral density to amplitude -

i have standard periodogram produced spectrum function call in r "stats" package. produces spectral density on y axis. wish inspect amplitude of key frequency signals. how convert spectral density amplitude? there periodgram plot/analysis in r produces frequency vs amplitude plot automatically? appreciate advice. maybe use different terminology do. page says value returned spectrum function list first 2 elements are: freq vector of frequencies @ spectral density estimated. (possibly approximate fourier frequencies.) units reciprocal of cycles per unit time (and not per observation spacing): see ‘details’ spec vector (for univariate series) or matrix (for multivariate series) of estimates of spectral density @ frequencies corresponding freq. so $spec element calling vector of "amplitudes"? (you haven't said "key frequency signals" picked fourth frequency example in ?spectrum : lh.spec <- spectrum(lh) lh.spec$freq[...

php - Onclick event not working with AJAX -

i want display selected image's slideshow of ajax , fetching of title important display corresponding slideshow in javascript, title of clicked image not fetching. javascript: function slide(s) { var _event = s; alert(_event); } code: <div id="inner_body"> <?php $c = mysql_connect("localhost", "abc", "xyz"); mysql_select_db("root"); $sql = "select * images year=2000"; $qc = mysql_query($sql); $count = 0; while ($ans = mysql_fetch_array($qc)) { $title = ucwords($ans['event']); print " <div class='img-wrap' onclick='slide($title)'> <img id='display_img' src='images/thumbnails/$ans[image1]'> <div class='img-overlay'> <b1>" . $title . "</b1> </div> </div>...

c# - which relationship is this, one to one from one side and many to one from other side -

i want know how set relationship in scenario there article , location entitites. in point of time 1 article can @ 1 location, , looking other side 1 location can hold 1 or more articles. so kind of relationship this? from 1 side 1 one , other side many one. thanks one location can have many articles, 1 many relationship. the one on location side of relationship means articles can have 1 location, 'many' on article side, means location can have many articles.

json - jquery autocomplete throws --> "parsererror", SyntaxError: invalid label -

Image
following official example autocomplete, came this. $("#search").autocomplete({ source: function (request, response) { $.ajax({ url: "/search", datatype: "jsonp", data: { featureclass: "p", style: "full", maxrows: 12, name_startswith: request.term }, success: function (data) { response($.map(data.username, function (item) { return { label: item.name, value: item.name }; })); }, error: function (data) { } }); }, minlength: 2, select: f...

c++ - How to properly define a move constructor? -

i did search internet , found 3 ways of defining move constructor: relying on compiler: t(t&& other) = default; dereference this pointer: t(t&& other) { *this = std::move(other); } explicitly reassign members: t(t&& other) { t.a = other.a; t.b = other.b; //... } which 1 proper way ? (and second 1 correct?) the proper generic way move-construct each member, that's defauted version anyway: t(t && rhs) : a(std::move(rhs.a)) , b(std::move(rhs.b)) { } as rough rule, should use default definition if need, , should write ex­pli­cit move constructor if you're doing ex­pli­citly implements move semantics, such unique-ownership resource manager: urm(urm && rhs) : resource(rhs.resource) { rhs.resource = nullptr; } the indicator whether appropriate whether class has user-defined de­struc­tor. in example, destructor release managed resource, , must happen once, moved-from object must mod...

loops - Based on user position, hide rows in table -5 and +5 after name (jquery) -

looking jquery scenario... i displaying list of sports rankings on page table potentially contain couple of thousand players. display purposes, want show 5 rows before , 5 rows after logged in user. for example, if had table info: <table> <tr><td>person 1</td><td>999</td></tr> <tr><td>person 2</td><td>998</td></tr> <tr><td>person 3</td><td>997</td></tr> <tr><td>person 4</td><td>994</td></tr> <tr><td>person 5</td><td>992</td></tr> <tr><td>person 6</td><td>980</td></tr> <tr><td>person 7</td><td>970</td></tr> <tr><td class="me">person 8</td><td>960</td></tr> <tr><td>person 9</td><td>950</td></tr> <tr><td>person 10</td><td...

excel - Convert range formatted as date to text -

i have range of cells in date format, formatted dd.mm.yyyy , this: 05.10.1993 05.10.1993 05.10.1993 05.10.1993 and want convert range of cells text format, using vba, without iterating each cell in range (as slow large range). i used code: set rsel = selection adate = rsel.value rsel.numberformat = "@" rsel.value = adate so assign selected range intermediate array, convert range text format , assign array selected range. result text: 5/10/1993 5/10/1993 5/10/1993 5/10/1993 and wonder did format conversion took place, if debug.print example adate(1,1) expected 05.10.1993 value? or how can instruct format in simple snippet posted expected text result? in code, instead of adate=rsel.value , try this: adate = application.text(rsel.value2,rsel.numberformatlocal) note the following range properties relevant example: .value returns variant (number/date/string/boolean/error) dates in vba date format. .value2 returns variant (number/strin...

java - How can I get a method to print? -

i wanted make simple program calendar in text. first time tried print method, can't figure out how it. public class calendar{ public static void main(string[] args){ system.out.println("january: "); system.out.println("s m t w th f s"); } public static void displaymonth(int i){ (i = 1; < 32; i++){ if (i < 10){ system.out.print(i + " "); }else{ system.out.print(i + " "); } if (i % 7 == 0 ){ system.out.print("\n"); } } } } that code. how "displaymonth appear? add displaymonth(1) bottom of main function. also, find java tutorial. p.s. ignoring argument function, setting 1.

Client Server Communication in Android for Accounting App -

i working on business accounting app in android, contain information company details, products, prices, transactions, etc . hence server have many mysql tables, want android app communicate server authentication, retrieve information , store information quickly, crud etc. i have googled php , json, , rest, unable example close needs. what ways through communication can carried out android app fast possible? if php , json solution, how implement in android? examples? your architecture seems pretty straight forward. have database on server, , webserver hosting php web application have implement rest api, transferring , receiving json on wire, there's nothing spectacular or innovative this. if want speed things framework symfony provide built in jsonresponse class classic json communication on android side, have 2 choices: if use java use native org.json library encode java data json , use org.apache.http classes (like defaulthttpclient, httpget, httppost etc.) co...

angularjs search and ignore spanish characters -

i'm adding simple sort on page. idea search products. these products written in spanish language , has accents. example: 'jamón'. here code: <div class="form-inline"> <label>search</label> <input type="text" ng-model="q"/> </div> <div ng-repeat="product in products_filtered = (category.products | filter:q | orderby:'name')"> .... </div> the problem have have type in "jamón" in order find product "jamón". want more flexible, if user types in "jamon", results must include "jamón". how can search angular filters , forget accents? idea? thanks in advance. you'll need create filter function (or full filter). simplest thing possibly work: html <div ng-app ng-controller="ctrl"> <input type="text" ng-model="search"> <ul> <li ng-repeat="n...

powershell - Find All Files With Parentheses? -

i got new laptop , reason dropbox decided duplicate in there. teach myself bit of posh can can more adept @ it, figured might time, far, no luck mucking about. i'm not total noob, still bit of one. basically dupe files have (1) @ end (e.g. filename (1).txt). able pinpoint with: gci -recurse | ? { $_.name -like "*(1)*" } good far, want move them "dupes" directory , keep subfolder structure. whatever reason, seems should simple, posh makes super hard. i've searched high , low , found few close examples, include bunch of other parameters end confusing me. believe i'm after is: *find items above command *pipe move-item *somehow include new-item -itemtype directory -force *also check see that dir doesn't exist currently have: $from = "c:\users\xxx\dropbox" $to = "c:\users\xxx\downloads\dropbox dupes" gci | ? { $_.name -like "*(1)*" } | new-item -itemtype directory -path $to -force move-item $from $to -...