Posts

Showing posts from 2010

javascript - How to programatically inject html to qunit-fixture -

i programatically inject html test qunit-fixture. have tried $.load js dealing html gets executed before html loaded. the html: <div id="qunit"></div> <div id="qunit-fixture"></div> <script src="../components/bower/qunit/qunit/qunit.js"></script> <script> qunit.config.autostart = false; </script> <script data-main="tests" src="../components/bower/requirejs/require.js"></script> the js manipulating html module want test: define(['jquery'], function($) { 'use strict'; var foo = { _init: function() { this._addclass(); }, _addclass: function() { console.log('adding class testit'); $('.foo').addclass('testit'); }, greet: function() { return "hello"; } }; foo._init(); return { greet : foo.greet }; }); and test: define(['foo'], function(foo

PHP not sending email to email addresses that have 2 dot ('.') characters in their name -

i have been struggling send email using mail function in php while. want send 2 separate emails 2 different email addresses. $allowhtmlheader = "mime-version: 1.0\r\n"; $allowhtmlheader .= "content-type: text/html; charset=iso-8859-1\r\n"; $headers = "from: webmaster@xyz.com\r\nreply-to: webmaster@xyz.com\r\n" . $allowhtmlheader; $customerheaders = "from: a.b.c@gmail.com\r\nreply-to: a.b.c@gmail.com\r\n" . $allowhtmlheader; $subject = "enquiry"; $message = "try me..."; $cmessage = "i score better!"; if ($_post[cemail] != null) { if (mail("a.b@gmail.com", $subject, $cmessage, $cheaders)) { echo("message sent!"); } else { echo("message delivery failed..."); } if (mail("a.b.c@gmail.com", $subject, $message, $headers)) { echo("message sent!"); } else { echo("message delivery failed..."); }

scala - Play framework- design suggestion for validation -

i need validate if newly added entity, part of model has been added. addition happen taking input user. believe standard way add constraints in form along lines of .verifying( "already exists", <code check if entity exists> ) this lead globalerror entity exists. error message static "already exists". i'm looking for, though, tell user possible matches exist, globalerror incapable of doing. should want not adding validator , allowing binding succeed? way, when myform.fold{ entity returned success => <success code>, erroneousform => <failure code>} i can take success branch , check there if entity duplicate? if similarities exist can redirect user? feel shouldn't controller's job, , of design logic inside controller, should technically lie inside model itself. , model should tell controller wrong , 'type of w can first create new element , upon finding potential rongness' , controller can take appropriate ac

android - Appcelerator Titanium - Problems detected with the SDK settings -

Image
so have error in title, have got several fresh copies of android sdk , titanium. still getting error. tried several other fixes non worked. for install titanium sdk, recommend (windows): unnistall android references, node.js, titanium sdk (users\\appdata\roaming\titanium), clean folders , registry (ccleaner or other) , reboot system. unzip android sdk r22 , install or update android machines less android sdk (android.bat) install android ndk set android_home , ndk_home @ os path (+ reboot) install latest titanium studio sdk + node.js check android sdk , ndk on titanium sdk preferences

c# - How to remove a control from window programmatically? -

i have window button in it, , need remove or not depending on argument passed window: public mainwindow(bool removecontrol) { initializecomponent(); if (removecontrol) { //code remove button } } in xaml file declare normal button: <button width="120" height="25" content="click" name="clickbutton"></button> i know can done doing reverse thing means add button depending of boolean parameter, need so. you can do: mybutton.visibility = visibility.collapsed; ...or if want removed "logical tree"...then depends "container"/parent button in, in how remove it. disconnecting element any/unspecified parent container in wpf remove control window in wpf http://joe-bq-wang.iteye.com/blog/1613370

qt - "You are creating QApplication before calling UIApplicationMain" error on iOS -

when create qtwidgets application, select iphonesimulator-clang qt5.3, , run app in debug mode on ios simulator error below. not adding code; running qt creator template code. "error: creating qapplication before calling uiapplicationmain. if writing native ios application, , want use qt parts of application, place create qapplication within 'applicationdidfinishlaunching' inside uiapplication delegate.” i have qt5.3.1 (installed using online installer) , xcode 5.1.1. running provided calculator example on ios simulator works fine without error. just in case solution decided disappear elsewhere: fix change signature of main function. #if defined(q_os_ios) extern "c" int qtmn(int argc, char **argv) #else int main(int argc, char **argv) #endif { ... }

How do I make my http request proxy in c#? -

when use code below error: servicepointmanager not support proxies https scheme. how change code around make proxyed? var request = (httpwebrequest) webrequest.create("https://website.com/index.php?"); var myproxy = new webproxy("https:/website.com/index.php?"); request.proxy = myproxy; string postdata = "secret=" +textbox1.text; byte[] data = encoding.ascii.getbytes(postdata); request.method = "post"; request.contenttype = "application/x-www-form-urlencoded"; request.contentlength = data.length; using (stream stream = request.getrequeststream()) { stream.write(data, 0, data.length); } var response = (httpwebresponse) request.getresponse(); string read = new streamreader(response.getresponsestream()).readtoend(); response.close();

python - Django filter query - doesn't work -

i have problems django, want write simple query doesn't work. model: class games(models.model): name = models.charfield(max_length=128) path_to_folder = models.charfield(max_length=256) description = models.textfield() cover = models.urlfield() def __str__(self): return self.name i trying (it should find in opinion): >>> gamepanel.models import games >>> e = games.objects.all() >>> print (e) [<games: call of duty 4>] >>> e[0].name 'call of duty 4' >>> q = games.objects.filter(name=e[0].name) but when wrote last line , hit enter get: traceback (most recent call last): file "/home/zoli/desktop/django-master/newest/django-trunk/django/db/models/options.py", line 404, in get_field_by_name return self._name_map[name] attributeerror: 'options' object has no attribute '_name_map' during handling of above exception, exception occurred: traceback (most recent c

Check if variable changed, then unset session each time variable changes - PHP -

i read lot of helpful info here when searching answers programming questions. signed because want ask question php variables not able find concise answer on. i want check if php variable has changed. i have form field users type city, state into. gets stored in $_session['location'] . i have variable stores country. when $country variable changes, city, state remain in form field due being in session. issue because city, state entered won't work different country gets selected. i need able unset $_session['location'] each time country variable changes form field returns empty. i'm not sure how this. here code below attempt of trying unset session in if statement. // country selector switch ($country) { case "usa": $example = "san jose, ca or 94102"; $placeholder = "city, state, or zip"; break; case "canada": $example = "toronto, on"; $placeholder =

php - Output image URL from image object as background-image -

i have field group loads image image object, i'm trying output url style background-image parameter. it's outputting url in way style sheet can't pick up. <? $test_output .= '<div class="complete-image cropped" style="background-image: url("'. $smallimage .'");">'."\n";?> i'm returning test_output @ end correctly, problem syntax? is problem syntax? not php syntax error html! second double quote after url( end value of style attribute , break markup: <? $test_output .= '<div class="complete-image cropped" style="background-image: url("'. $smallimage .'");">'."\n";?> <!-- here --^ --> try using so: <? $test_output .= "<div class=\"complete-image cropped\" style=\"background-imag

javascript - jQuery/AJAX Submit after Validation -

i have form submitted via post request on server calls third party api. api can bit slow (5-8 seconds). not want users submit twice and/or wonder happening form submission. idea show spinning wheel until next page loaded (and api request sent server). the following code shows spinning wheel when button pressed, doesn't care form entered correctly or not. if fields blank, form not submitted, spinning wheel shows. i have form validated , checked make sure fields entered correctly following code $(document).ready(function() { $('#ccform').bootstrapvalidator({ // use feedback icons, ensure use bootstrap v3.1.0 or later feedbackicons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { fname: { validators: { notempty: { message: 'your name required , cannot empty' } } },

c# - ApplicationDbContext Seed starts only if I go to Person Controllers index action in ASP .NET MVC 5.1 application -

i run web application homecontroller.index() action run. go person.index() (it @ bottom of post) via browser , migrations.configuration.seed() invoked. want happen @ application start. configuration: namespace webapplication2.migrations { using microsoft.aspnet.identity; using microsoft.aspnet.identity.entityframework; using system; using system.collections.generic; using system.data.entity; using system.data.entity.migrations; using system.linq; using webapplication2.models; internal sealed class configuration : dbmigrationsconfiguration<webapplication2.models.applicationdbcontext> { public configuration() { automaticmigrationsenabled = true; contextkey = "webapplication2.models.applicationdbcontext"; } protected override void seed(webapplication2.models.applicationdbcontext context) { system.diagnostics.debug.writeline("seed started"); //

How to know the CPU model like core i7-2600k in java? -

i know how system info can not find cpu model using system.getenv neither runtime.getruntime() nor systemenvironment.getsystemenvironment(); how can it? you can in java using sigar api. download sigar here , add sigar.jar , sigar-x86-winnt.dll buildpath. you can cpu details, example cpu model using code below: import org.hyperic.sigar.sigar; import org.hyperic.sigar.sigarexception; public class cpuinfo { /** * @param args * @throws sigarexception */ public static void main(string[] args) throws sigarexception { // todo auto-generated method stub sigar sigar = new sigar(); org.hyperic.sigar.cpuinfo[] cpuinfolist = sigar.getcpuinfolist(); for(org.hyperic.sigar.cpuinfo info : cpuinfolist){ system.out.println("cpu model : "+info.getmodel()); } } }

java - error: class, interface, or enum expected -

i have following code trying working project in class in. include requirements design , implement class day implements day of week in program. class day should store day, such sun sunday. program should able perform following operations on object of type day: a. set day. b. print day. c. return day. d. return next day. e. return previous day. f. calculate , return day adding days current day. example, if current day monday , add 4 days, day returned friday. similarly, if today tuesday , add 13 days, day returned monday. g. add appropriate constructors. h. write definitions of methods implement operations class day, defined in through g. i. write program test various operations on class day. the code follows: `import java.util.*; class day { private int dayvalue; private static final int invalid = -1; public day() { this.dayvalue = invalid; } public day(string day) { setday(day); } public day(int day) { this.dayvalue = (day<0 || day>6) ? invalid :

intuit partner platform - How to read UnitPrice from invoice line in QBO API v3 .NET -

the bizarre properties in .net sdk continue baffle me. how read unitprice invoice line? if this: sild = (salesitemlinedetail)line.anyintuitobject; ln = new qbinvoiceline(); // internal line item class ln.description = line.description; ln.itemref = new qbref() { id = sild.itemref.value, name = sild.itemref.name }; if (sild.qtyspecified) ln.quantity = sild.qty; else ln.quantity = 0; if (sild.itemelementname == itemchoicetype.unitprice) ln.rate = (decimal)sild.anyintuitobject; // exception thrown here the last line throws invalid cast exception, though debugger shows value 20. i've tried other types same exception no matter do. punted , calculating rate so: ln.rate = line.amount / ln.quantity; (with proper rounding , checking divide zero, of course) while we're on subject... noticed in many cases itemelementname == itemchoicetype.pricelevelref. what's that? far know, qbo doesn't support price levels, , wasn't using price level invoice or

upgrade cakephp from 2.3 to 2.5 -

i have problem code , found out have older version of cakephp installed on server using ver 2.3. want upgrade version 2.3 cakephp ver 2.5 .i need to: 1) place new version in lib/cake folder (overwrite?) 2) check migration guide function differences. the advice given here refer migration guide guide says nothing installing , mentions upgrading 2.4 don't have? don't want potential headache moving 2.3 2.5. http://book.cakephp.org/2.0/en/appendices/2-5-migration-guide.html

javascript - Why does Image change position on browser size change -

i have image in html , when change size of browser image , text boxes change size , position. can explain why so?? #economy123{ position:absolute; top:67%; left:53%; } <div class="result-temp" > <img id="economy123" src="{{ asset('assets/images/economy123.png') }}" > </div> if want image stay on same spot after resize browser need use pixels instead of percentages. for example: .result-temp{ width: 400px; height: 400px; } #economy123{ position:relative; top: 100px; left: 100px; width: 200px; height: 200px; } <div class="result-temp"> <img id="economy123" src="{{ asset('assets/images/economy123.png') }}" > </div> this keep image centered after browser resized.

html5 - Efficiency in creating a tab CSS or Jquery? -

i want ask more efficient when creating group of tabs, made in css3 or jquery? example want create tabs compose of different content: tab1 content tables, tab2 content graphs. i found can use, simpletabs it not depend on third-part library jquery, mootools etc. means won't conflict scripts made these libraries or other script. it not need different ids per tab container in order have multiple tab sets. so, can have many simpletabs tab sets want on same page. it remembers last tab clicked on , if reload page (e.g. navigate somewhere , return page containing tabs) specific tab active. it's simple implement, small in size , fast load. works on browsers.

c# - An unhandled exception breaks the application? -

it said in .net 4.0, unhandled exception in task make application broken when finalized. (it said in .net 4.5, ms edits exception rule unhandled exception won't thrown). but tried below code, see appliction. (in .net4.0), seems strong. static void main(string[] args) { (int = 0; < 100; i++) { var t = task.factory.startnew<int>(() => { throw new exception("xxxxxx"); return 1; } , cancellationtoken.none, taskcreationoptions.none, taskscheduler.default); } while (true) { gc.collect(); thread.sleep(1000); } console.readkey(); } the code run gc.collect() finalize task object, application ok. isn't broken. why? if have .net 4.5 installed on machine, in place modification of .net 4.0 may why getting behavior seeing. if want unobserved exceptions still thrown can add following section config file: <configuration> <runtime> <throwunobservedtaskexcepti

c# - Error in code publishing -

if publish code not copying in web folder exists in wwwroot . empty folder there while publishing saying site published successfully. after open blank browser message (to parent directory) it giving no error. building directory '/project/users/'. pre-compilation complete ------ publish started: project: f:\...\project\, configuration: debug cpu ------ connecting site e:\project... publishing directory /... ========== build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== ========== publish: 1 succeeded, 0 failed, 0 skipped ========== i got solution publish in debug mode first change settings , publish in release mode. surely work :)

php codeigniter email library -

Image
i'm having trouble here. why can't send email using smtp? error looks this. the code looks this $config = array( 'protocol' => 'smtp', 'smtp_host' => 'mail.email.com', 'smtp_port' => 25, 'smtp_user' => 'admin@email.com', 'smtp_pass' => 'pass' ); $this->email->initialize($config); $this->email->cc('admin@provider.net'); $this->email->set_mailtype('html'); $this->email->from('admin@provider.net', 'admin'); $this->email->send(); if(!$this->email->send()) { show_error($this->email->print_debugger()); } code update: $this->load->library('email'); $config = array( 'protocol' => 'smtp',

shell - Can I change the root path to execute a cron task? -

i got shell script( toy-example 1 here): it creates file on current directory: #! /usr/bin/sh touch ./toy touch ./doll touch ./boy touch ./kuky touch ./beer this shell put on deep path: /somewhere/which/is/in/a/huge/path/tree/maze but when use crontab execute shell script, no doubt create these files under ~/ . so means if want create these files on /somewhere/which/is/in/a/huge/path/tree/maze , have add long path after every touch command. in case 5 long path. disaster reading. but if can change root file execute shell, i'll need 1 such path in script or crontab. is there way so? change directory: #!/bin/sh cd /somewhere/which/is/in/a/huge/path/tree/maze ... or use variable: dir="/somewhere/which/is/in/a/huge/path/tree/maze" touch "$dir/toy" ...

egit - git commit and push not working after rebase -

i rebased branch against master, committed , pushed end result. this seems work. git status showing nothing commit, working directory clean however, when checked remote repository, changed files didn't arrive. confusing , little scary because local client saying dandy (all files safely stored remotely), when isn't. any suggestions on: how force push remote though local git thinking there's nothing push? how make sure client correctly indicate sync status? how make sure client correctly indicate sync status? before pushing, can detect if push fast forward with: git rev-list origin/yourbranch ^yourbranch if returns commit, means yourbranch history replacing 1 origin, you have force push make happen. see more @ " how detect forced update ".

Strange SVG path syntax used in Snap.svg tutorial? -

while looking through snap.svg tutorial , came across following line of code made me double take: // lets create pattern var p = s.path("m10-5-10,15m15,0,0,15m0-5-20,15") what m10-5-10,15 ? @ first, thought may have been kind of coordinate-range syntax, wouldn't make sense in case, , couldn't find remotely close in svg path spec . couldn't find of note in snap.svg docs . interestingly enough, code seem draw desired pattern ... the simplest answer right one. there no special syntax - coordinates concatenated no white space. the clue command: m moveto command, doesn't draw anything. if in the spec , however, you'll notice following: if moveto followed multiple pairs of coordinates, subsequent pairs treated implicit lineto commands. so, moveto can have multiple coordinate pairs, , after first pair treated lineto command. mystery syntax is, in reality, concise (but less readable) way of writing m10,-5 -10,15 m15,0 0,15 m0,-5

amazon web services - sub-bucket in AWS S3 -

i'm starting aws s3, created bucket, not know how manage it. example, bucket named: testing, i'd create sub-bucket named: company1, company2. in each of sub-bucket, i'm gonna put document on it, doc1.pdf, doc2.pdf, etc. however, cannot' find documents sub-folder or sub-bucket. any helps appreciated. in short, there no concept of creating bucket within bucket or sub-buckets, can find more information on bucket restrictions , limitations . but aws s3 supports concept of folders inside buckets, read more here

javascript - How can I set the channel of a Parse.Installation through cloud code? -

according push documentation , doesn't seem supported yet, i'm not entirely sure. have background job that's running every user in database, , want set respective installations channel based on result.

If it has the same object_id, why changing a value in a method doesn't affect the caller in Ruby? -

i have method: def change_value(obj) puts obj.object_id #70275832194460 obj = nil puts obj.object_id #8 end obj = "hi there" puts obj.object_id #70275832194460 change_value(obj) puts obj.object_id #70275832194460 puts obj #still 'hi there', while expect nil. why if passing object, , changing value new value doesn't maintained outside of method? your method named badly. named change_value , doesn't change value, changes reference . , since ruby pass-by-value, not pass-by-reference, changing reference won't caller. if did change value, able observe difference: def change_value(obj) puts obj.object_id #70275832194460 obj.replace('hi back!') puts obj.object_id #70275832194460 obj = nil puts obj.object_id #8 end obj = 'hi there' puts obj.object_id #70275832194460 change_value(obj) puts obj.object_id #70275832194460 puts obj # 'hi back!'

iOS Swift: Downcasting AnyObject -

i know number of downcasting cocoa swift questions have been asked , there bugs, have tried lot of methods found here , cannot them work, hoping can lend hand. i new programming. making database program ios in swift. i have person class: class person : nsobject { var firstname : string var lastname : string init (firstname : string, lastname : string) { self.firstname = firstname self.lastname = lastname } func encodewithcoder(acoder: nscoder!) { acoder.encodeobject(firstname, forkey:"firstname") acoder.encodeobject(lastname, forkey:"lastname") } init (coder adecoder: nscoder!) { self.firstname = adecoder.decodeobjectforkey("firstname") string self.lastname = adecoder.decodeobjectforkey("lasname") string } } i declare array of class @ top of view controller: var peoplearray = [person]() i fill array declaring sample users , append array: var

text - AutoCAD displays `question mark` instead of tab character when using AutoLISP -

software: autocad 2012 (japanese language) system: ms windows 7 (japanese language) i have made .lsp file defines new function "c:makeatable". i trying print string contains tab character, using autolisp. character shows question mark (?). if manually try edit (by double-clicking it, or using ddedit, or textedit ) automatically gets converted tab character, require. i don`t know character encoding being used (if causing problem). font being used "txt.shx". things have tried: used (chr 9) in concatenation rest of string => still shows question mark tried print 2 parts of string (on either side of tab) separately => not good, since need text single object tried using "ddedit" function in code => requires user press enter @ every invocation, not good. i tried simulatinging enter key using " " , "" , ";" , (terpri). nothing works, still prompts user select object. tried using "textedit&

ios - How do I store user-inputed data so that it can be displayed to other users of an app? -

i'm still new ios development. app able display run-time user-placed pins(for car dealerships) in view controller, user exits app or current map view, pins disappear. along this, plan have these user placed pins can viewed other users of app. so question is, program/framework (etc.) best allow me store these pins various user specific variables (such nsstrings), can load data specific view opens , display other users of app. i've heard of core data , mysql , other things, don't know enough each of them know use or if need them @ all. please give me guidance on should study/begin use accomplish task. thank you! you may use remote mysql database , store information there. need ios framework access mysql. also, can write simple php script on server work mysql database.

performance - What is Time Complexity of the following function? -

Image
int dosomething(int n) { if(n < 2) return 1; else return dosomething(floor(sqrt(n))) + n; } according me corresponding recurrence : solving recurence... putting the function becomes can please verify & rectify solution? you correct upto :- s(m) = o(log(m)) then t(2^m) = o(log(m)) n = 2^m t(n) = o(log(m)) m = log(n) hence t(n) = log(log(n))

jsp - org.apache.jasper.JasperException: java.util.NoSuchElementException at java.util.ArrayList$Itr.next(ArrayList.java:794) -

below exception got of sudden, same code works locally , test system, failing in dev environments, configuration same in layers. org.apache.jasper.jasperexception: unable compile class jsp @ org.apache.jasper.jspcompilationcontext.compile(jspcompilationcontext.java:604) @ org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:328) @ org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:313) @ org.apache.jasper.servlet.jspservlet.service(jspservlet.java:260) @ javax.servlet.http.httpservlet.service(httpservlet.java:723) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ com.opensymphony.sitemesh.webapp.sitemeshfilter.dofilter(sitemeshfilter.java:59) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:235) @ org.apache.catalin

firefox - Error in calling jsonrpc service in jquery -

i have jsonrpc web service deployed on redhat linux ami. can access service in python given below: >>> import jsonrpclib >>> server=jsonrpclib.server(redhat_linux_ami_jsonrpc) >>> x=server.addmicroelement('test test test') >>> x u'first insert' where , redhat_linux_ami_jsonrpc = jsonrpc service hosted on redhat linux ami but when try call in jquery, works in ie fails in firefox. code have written given below: var req = {jsonrpc:'2.0', method: 'addmicroelement',id:(new date).gettime()}; req.params=['new new new']; $.support.cors = true; $.ajax({ crossdomain: true, url: redhat_linux_ami_jsonrpc, data: json.stringify(req), type: "post", contenttype: "application/json", success: function(rpcres) { alert(rpcres.result); }, error: function(err, status, thrown) { alert(status);

What is a maximum size of SQLite database on Android? -

i have sqlite db size on 2.6 gib. (the db contains maps.) db used rmaps app. when move maps parts @ maximum zoom, app closes. however, there no force close message, no report button. so, i've got idea caused reading blocks beyond limit e.g. max(int). since rmaps using simple sql statements, think problem not in rmaps rather in android sqlite driver. is there size limit of sqlite database on android? (i have froyo on nexus one, not think problem of froyo.) log output: 08-14 10:24:51.689 i/activitymanager( 81): starting activity: intent { act=android.intent.action.search flg=0x10000000 cmp=com.robert.maps/.mainmapactivity (has extras) } 08-14 10:25:01.879 e/androidruntime(12441): fatal exception: pool-1-thread-2 08-14 10:25:01.879 e/androidruntime(12441): android.database.sqlite.sqlitediskioexception: disk i/o error 08-14 10:25:01.879 e/androidruntime(12441): @ android.database.sqlite.sqlitequery.native_fill_window(native method) 08-14 10:25:01.879 e/androidruntime(

javascript - Why do variables in the global scope get assigned to the window object? -

var foo = 'bar'; console.log(window.foo); // bar seems variables assigned properties this , inside anonymous functions, this refers parent scope, doesn't assign variables parent scope. function() { var foo = 'bar'; }(); window.foo; // undefined what object variables assigned in non-global scopes? to cite http://perfectionkills.com/understanding-delete/#execution_context : every execution context has so-called variable object associated it. execution context, variable object abstract entity, mechanism describe variable instantiation. now, interesing part variables , functions declared in source text added properties of variable object . when control enters execution context global code, global object used variable object . precisely why variables or functions declared globally become properties of global object yet, these variable object s not accessible. non-internal 1 global object, window or this (in global co

html - How to ignore transparent place on hover event -

Image
how ignore transparent place on hover event ? in first picture need ignore "this place". need hover on rhombus works only. <img src='http://s30.postimg.org/xpd6gwla9/1_copy.jpg' id="first"> #first:hover { -moz-box-shadow: 3px 3px 5px 6px #ccc; -webkit-box-shadow: 3px 3px 5px 6px #ccc; box-shadow: 3px 3px 5px 6px #ccc; } you can't. might able using svg element (not in <img> tag), normal image bounding box rectangular, , box shadows or other styles applied box instead of contours of image.

ios - How to create new list of reminder from code(objective c) on "reminder app" of iphone -

i want create new list of reminder code(objective c) on "reminder app" of iphone. if possible please let me know. warm regard, thanks you can create reminders using reminderwitheventstore: class method. title , calendar properties required. calendar reminder list grouped. before create reminder, ask permission: in .h: @interface remindmeviewcontroller : uiviewcontroller { ekeventstore *store; } and .m, when going need access reminders: store = [[ekeventstore alloc] init]; [store requestaccesstoentitytype:ekentitytypereminder completion:^(bool granted, nserror *error) { // handle not being granted permission }]; to add reminder. happens asynchronously, if try add reminder after this, fail (crashes app in experience). - (ibaction)addreminder:(id)sender { ekreminder *reminder = [ekreminder reminderwitheventstore:store]; [reminder settitle:@"buy bread"]; ekcalendar *defaultreminderli

python - Django filter to return results that start with the entered query -

i have problem pertaining results returned django queryset. i have table classified on perform search operation based on input query q follows: def search(request): q = request.get['query'] result = classified.objects.filter(q(name__icontains=q) | q(category__icontains=q)) return render_to_response('search.html', {'result':result}, request) now example classified.name contains amity , ambulance , camden , cameroon . if type am query, according above filter it'll return 4 of mentioned entries. my question here is, how return amity , ambulance results because that's requirements , plus makes search page more result oriented. do you're doing use istartswith rather icontains https://docs.djangoproject.com/en/dev/ref/models/querysets/#istartswith

python - Swig -outdir option doesn't include the .so file -

i have small project use cmake system create python module out of c++ files. in cmakelists.txt file have swig integrated follows: # swig part here find_package(swig required) include(${swig_use_file}) find_package(pythonlibs) include_directories(${python_include_path}) set(cmake_swig_outdir ${project_binary_dir}/../lib/foo) set_source_files_properties(swig/interface.i properties cplusplus on) set_source_files_properties(swig/interface.i swig_flags "-includeall;-c++;-shadow") swig_add_module(foo python swig/interface.i code/foo.cpp) swig_link_libraries(foo foolib ${python_libraries}) my first question why not both foo.py and _foo.so created in location specified cmake_swig_outdir ? .py file created in directory. bug of cmake useswig.cmake file? .so file still in project_binary_dir location. result, can't load module in python if location cmake_swig_outdir in python_path environment variable. solve problem either: add project_binary_dir directory python_p

.htaccess - How do I allow access only when requested with correct hostname in apache? -

i have web server running on 230.230.230.230 . have virtual host set servername mywebsite.com , documentroot /var/www/html/mywebsite.com/public given file /var/www/html/mywebsite.com/public/index.html , how allow access http://mywebsite.com/index.html not http://230.230.230.230/mywebsite.com/public/index.html ? preferably place .htaccess file in /var/ww/mywebsite.com redirect ip-based/other hostname traffic correct hostname. edit : ended doing .htaccess rewriteengine on rewritebase / rewritecond %{http_host} !^mywebsite\.com$ [nc] rewriterule ^(.*)$ https://mywebsite.com/ [r=301,l]