Posts

Showing posts from July, 2014

dynamics crm 2011 - How to create Custom Fields in Activities in CRM -

crm :suppose have created custom field in "task" type activity.now want show custom field on activity view. possible ??? i think can't on activity view it's based on activity pointer hold common attribute across activity type. solution change view of task view.

matlab - SVM LibSVM Ignore Feature 1,3,5 when Predicting -

this question libsvm or svms in general. wonder if possible categorize feature-vectors of different length same svm model. let's train svm 1000 instances of following feature vector: [feature1 feature2 feature3 feature4 feature5] now want predict test-vector has same length of 5. if probability receive poor, want check first subset of test-vector containing columns 2-5. want dismiss 1 feature. my question is: possible tell svm check features 2-5 prediction (e.g. weights), or have train different svm models. 1 5 features, 4 features , on...? thanks in advance... marcus you can remove features test points fiddling file, highly recommend not using such approach. svm model valid when features present. if using linear kernel, setting given feature 0 implicitly cause ignored (though should not this). when using other kernels, no no. using different set of features predictions set used training not approach. i suggest train new model subset of features wish use

actionscript 3 - Send data from Flash to Starling class -

i want send data mainclass (flash class) starling class. here code of 2 classes. need pass data between them. package { import flash.display.sprite; import flash.events.event; public class mainclass extends sprite { private var mystarling:starling; public function mainclass () { super(); stage.addeventlistener(event.resize,onresize); } private function shangedor(e:stageorientationevent):void { // code } private function onresize(e:event):void { mystarling = new starling(main,stage); mystarling.start(); } } } main.as class of starling : package { import starling.core.starling; import starling.display.sprite; public class main extends starling.display.sprite { private var theme:aeondesktoptheme; public function main() { super(); this.addeventlistener(starling.events.event.added_to_stage,addtostage); } private function addtostage(e:starling.events.e

security - I have a small code on the end of each image link on my site that I didn't add. Does anybody know what this is? -

mywebsiteurl.net/image.jpg?9a7ad6 what "?9a7ad6" after each image link? noticed when copy pasted url of image. i googled it, relevant thing find #9a7ad6 hex code purple. some wordpress themes/plugins use query strings neat things images on fly resizing. in case, query string (stuff after ?) being used prevent caching. if case, here's how fix it: there's setting under browser cache → general says prevent caching of objects after settings change → whenever settings changed, new query string generated , appended objects allowing new policy applied. disable (if you're using plugin) , query strings dropped on static resources .jpg , .png files. source: philip arthur moore wordpress.org: http://wordpress.org/support/topic/wordpress-32-images-show-weird-query-string you may want take @ page: http://diywpblog.com/wordpress-optimization-remove-query-strings-from-static-resources/

visual studio - is there a way to check if the debugger is currently attached? -

i'm developing visual studio plugin, , need check if debugger attached (i.e., application running) prevent user performing actions. looked online unable find useful. is there way accomplish this? thanks! edit: seems question not clear enough. i'm trying achieve is: plugin running inside visual studio. need check if instance of visual studio attached debugging application, plugin can act accordingly. found it: use dte2.debugger property, , currentmode property. way can tell if debugging or not.

javascript - How to load or show images based on device density in Phonegap -

i want show image same splash screen image. want know how same splash screen using javascript, phonegap config.xml file values. i saw example phonegap project files , www containing 1 config.xml file having icon, splash screen images mapped based on density. how access icon, splash image based on device density. please see sample config.xml file and want how defined app splash screen each platform

c# - DateTime Unspecified Kind -

Image
on msdn defined unspecified kind as: so if kind unspecified datetime utc, on same page (given example): class sample { public static void main() { datetime savenow = datetime.now; mydt = datetime.specifykind(savenow, datetimekind.unspecified); display("unspecified: .....", mydt); } public static string datepatt = @"m/d/yyyy hh:mm:ss tt"; public static void display(string title, datetime inputdt) { datetime dispdt = inputdt; string dtstring; dtstring = dispdt.tostring(datepatt); console.writeline("{0} {1}, kind = {2}", title, dtstring, dispdt.kind); dispdt = inputdt.tolocaltime(); dtstring = dispdt.tostring(datepatt); console.writeline(" tolocaltime: {0}, kind = {1}", dtstring, dispdt.kind); dispdt = inputdt.touniversaltime(); dtstring = dispdt.tostring(datepatt); console.writeline(" touniversaltime: {0}, kind = {1}

php - Extract html of other domain page -

this question has answer here: ways circumvent same-origin policy 11 answers what want do: extract html of other domain. what have tried: $.get("http://website1.com", function(data) { alert("data loaded: " + data); }); (not working) (for example) im owner of tow websites: website1.com website2.com now want html of website1.com , show html in website2.com using jquery or other way (website2.com support client-side languages ,website1.com support php). how can it(im owner of website1 , website2)? consider using iframe display page on page.

mysql - how to insert a new value along with other values from table 1 to table 2 by using triggers -

delimiter $$ create trigger after_status_added after insert on user_status each row begin insert all_post_status values(new.status_id,new.friend_id,new.status_time_date, abc); end$$ delimiter ; now want insert value 'abc' value in field "user_type" of all_post_status table . how there new in insert triggers - newly inserted record. http://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html

php - Solr searching with /terms -

i have php application uses solr database. problem appeared when doing /terms request ( terms doc ) so parts of document interest are poi: "bistriÃ…£a", ... text: [ "ddt", "numeric", "/14/gagaga 2/11/economics/17/datenow", "/20/daniel_same/11/economics/17/datenow", "0/gagaga 2", "1/gagaga 2/economics", "2/gagaga 2/economics/datenow", "0/daniel_same", "1/daniel_same/economics", "2/daniel_same/economics/datenow", "ppla", "seat of first-order administrative division", "/19/daniel_same/1071/plurinational state of bolivia/2269/cuba/2272/bistriÃ…£a", "0/daniel_same", "1/daniel_same/plurinational state of bolivia", "2/daniel_same/plurinational state of bolivia/cuba", "3/daniel_same/plurinational state of bolivia/cuba/bistriÃ…£a", "0/undefined_activity", "year", "0/1999", "0/19

Interleave lists in R -

let's have 2 lists in r, not of equal length, like: <- list('a.1','a.2', 'a.3') b <- list('b.1','b.2', 'b.3', 'b.4') what best way construct list of interleaved elements where, once element of shorter list had been added, remaining elements of longer list append @ end?, like: interleaved <- list('a.1','b.1','a.2', 'b.2', 'a.3', 'b.3','b.4') without using loop. know mapply works case both lists have equal length. here's 1 way: idx <- order(c(seq_along(a), seq_along(b))) unlist(c(a,b))[idx] # [1] "a.1" "b.1" "a.2" "b.2" "a.3" "b.3" "b.4" as @james points out, since need list back, should do: (c(a,b))[idx]

Leaflet Map Clustering + Marker Rotation -

has ever tried use leaflet clustering plugin + marker rotation plugin? tried work both work partially. in first view, can see clusters , isolated (and rotated) markers. every time zoom in cluster rotated markers disappear. have idea why happens? to rotate marker, use : this leaflet plugin include in html : <script src="../leaflet-plugin/marker.rotate.js"></script> wen create marker : var marker = new l.marker(map.getcenter(), {iconangle: 90}); a complete example

php - valid regEx expression in ereg_replace makes nothing -

this question has answer here: replace ereg_replace preg_replace 4 answers i'm using php 5.2.17. want remove surplus data json string , i've thought can use replace function so. i'm using ereg_replace next expression: '^.*?(?=\"created_at)' which i've validated @ http://www.regexpal.com . i've pasted json string in there , match right. however, when make call: $tweets = eregi_replace('^.*?(?=\"created_at)', $temp, 'something'); and echo $tweets variable, there's output. no errors in console neither. apache error log, however, complains error called reg_badrpt. there's comment in php docs of eregi_replace suggesting can due need escape special characters, i've escaped " character. , i've tried escape others no different behavior. where problem then? i don't think ereg su

Using Enterpise Library 6 Exception Handling Application Block with WCF? -

i have these 3 packages loaded wcf service project: enterpriselibrary.common version 6.0.1304.0 enterpriselibrary.exceptionhandling 6.0.1304.0 enterpriselibrary.exceptionhandling.wcf version 6.0.1304.0 here service interface , mytestfault datacontract: [servicecontract] public interface irepairservice { [operationcontract] [faultcontract(typeof(mytestfault))] string saverepaircode(string failurecode, string description); } [datacontract] public class mytestfault { #region member fields private string _message = "an unexpected error occured while executing service method."; #endregion #region properties [datamember] public string message { { return _message; } set { _message = value; } } #endregion #region constructor(s) public mytestfault() { } #endregion } here implementation of service: [exceptionshielding("testpolicy")] public class repairservice : irepai

asp.net mvc 3 - Access Photogallery in android browser -

i want access android mobile photogallery android browser. i included cordova.js in application (basically mvc3 application), doesn't work me (navigator.camera undefined). do need include other files/libraries in application apart cordova.js? possible access device resorces in browser or not?

sql server - Rails sqlserver schema dump not generating primary key for non identity pk's -

given these 2 tables create table [dbo].[astrology_sign]( [sign_id] [int] not null, constraint [pk_astrology_sign] primary key nonclustered create table [dbo].[activity_master]( [activity_id] [int] identity(1,1) not null, constraint [pk_activity_master] primary key nonclustered rails generates following 2 entries in schema.rb create_table "astrology_sign", :id => false, :force => true |t| create_table "activity_master", :primary_key => "activity_id", :force => true |t| trying use schema move sqlserver postgres giving me issues. there lot of tables , rather not have edit hand. friend may you... there relations tables , columns in sqlserver join relations. look: select * information_schema.tables join information_schema.columns on information_schema.tables.table_name = information_schema.columns.table_name with information, can program little program convert those. meant can access information tables , columns

html5 - How to? Creating a webm video for three.js example webgl_kinect -

according post( how to? creating webm video kinect data three.js example webgl_kinect ), need both webm , nfo files run example. modify , recreate example own webm file, did not work well. did not work well, modified name of movie kinect.webm, still did not work. give me advice? here url of test file > http://informatics-lab.com/senseable415/webgl_dummy.html your video 604 x 512. not power of 2 in width. try cropping video 512 x 512. three.js r.58

Using find to open all files in subdirectories -

could please me find syntax. i'm trying replicate effect of command, opens files in each of specified subdirectories: open mockups/dashboard/* mockups/widget/singleproduct/* mockups/widget/carousel/* i'd make work set of subdirectories below mockups. i can show subdirectories with: find mockups -type d -print but i'm not sure how use xargs add in "*". also, don't want separately execute open each file "-exec open {} \;", because launches 50 different copies of preview, when need 1 instance of preview 50 files loaded it. thanks! the version of find have @ hand allows specify + sign after -exec argument: from man page: -exec command {} + variant of -exec action runs specified command on selected files, command line built appending each selected file name @ end; total number of invocations of command less number of matched files. command line built

When to encode as HTML in Grails -

i see grails sample code programmer has called method called encodeashtml() . figure should use in grails applications (for security reasons, assume?), wondering when should use method. objects/properties/etc. candidates encodeashtml() method? thank you! use encodeashtml() (or encodeasjavascript , etc) you've got user. every string modified user (got input form, request parameter, external api call, etc) see also: https://en.wikipedia.org/wiki/cross-site_scripting https://www.owasp.org/index.php/xss_(cross_site_scripting)_prevention_cheat_sheet https://www.owasp.org/index.php/xss_filter_evasion_cheat_sheet

java - Clickable HTML link in JEditorPane But using replaceSelcetion methode -

Image
i searched of how make clickable links in jeditorpane , found question is possible create programs in java create text link in chrome? it useful code use repetition statement jeditorpane jep = new jeditorpane(); jep.setcontenttype("text/html"); jep.seteditable(true);// because .replaceselection can't work disabled edit ( int = 1; <= 3; i++ ){ jep.replaceselection( "welcome <a href='https://stackoverflow.com/'>stackoverflow </a>."); } jep.seteditable(false); and show me text without clickable links how i'm going make right , need replaceselection method using replaceselection() on htmldocument inserts raw string; want insert html anchor tag. can, manage raw html text yourself, shown below, , let settext() handle parsing. use 1 of existing htmleditorkit nested actions. use 1 of custom approaches seen here . import java.awt.desktop; import java.awt.headlessexception; import javax.swing.

android - how to send low level wifi message? -

is there low level access androids wifi transmitter? obviously each android phone has radio transmitter / receiver. so how 1 tell transmitter transmit letter "o" or number 1 rather packet? you send packet, can change payload that, in case, can string "o" or number. packet built according iso/osi stack http://en.wikipedia.org/wiki/osi_model tho levels not present.

javascript - is it possible to shrink svg container? -

Image
is possible adjust rendering of svg content on safari , chrome resemble more ff rendering? problem i'm facing safari 5 doesn't support pointer events on svg element, blocking access underlying radio buttons, text , button controls. there way around that? reasoning if can safari shrink it's size based on current content solve problem explained before... here how ff rendering svg content: here how chrome or safari renders :

python - which is the most efficient way of loading a JSON dataset into Pandas DataFrames -

i didn't find in pandas documentations , cookbook (just references csv, , text files separators) on json. is there defined function load json directly dataframe? if there different alternatives, efficient? with pandas 0.12: import pandas pd d = pd.read_json('json file')

c++ - How to install libusb? -

i having hard time installing libusb. went across youtube videos, , talking "installing" libusb. went across tutorial , saying need build "manually". however, downloaded libusb http://sourceforge.net/projects/libusb-win32/files/ . in download, there no software install (according video, libusb_win32.exe). my os windows 7 ultimate 32 bit. pc dell inspiron 4030 (i need install in desktop pc well). ide qt, works visual studio 2010 compiler. how can install this? i bet downloaded .zip file no installer in (probably named libusb-win32-bin-1.2.6.0.zip ). reason don't have install have work. you have unzip , then, add libusb-win32-bin-1.2.6.0\include include directories of project using libusb. then, have add libusb-win32-bin-1.2.6.0\lib\msvc libraries used project. if don't know how here useful link have work msvc 2010.

How to print literal string "$1" in bash script? -

i want print string called "$1". when echo prints string equals "$1" variable. how can print "$1" string? for example: set -- "output" # sets $1 "output" echo $1 # ==> output but want this: echo $1 # ==> $1 you have escape $ have shown: $ echo "\$1" or, noted jeremyp in comments, use single quotes value of $1 not expanded: $ echo '$1'

c# - Do ghostscript convertion in-memory using dot net or any other language -

can use ghostscript api convert pdf other format without reading data disk or writing results disk? has big overhead! i need this: public static byte[][] convertpdf(byte[] pdfdata) { //// returns array of byte-array of pages data } using ghostscript api can send input anywhere like. depending on output device choose may able send output stdout, or retrieve bitmap in memory. if want tiff output have have output file (tagged image file format, clue in name...) similarly, can't pdf files input, have available file, because pdf random access format. what leads think performance problem ?

php - How to detect if a button is clicked or not -

i have simple php coding problem here. have button id 'register' user click. code below not run once button clicked. <?php try { if (isset($_post['register'])) { require_once('library.php'); $user_id = $identity->user_id; $status_type = 'm'; $data = array('status' => $status_type); $dbwrite->update('user', $data, "user_id = $user_id"); header('location: main.php'); exit; } } catch (exception $e) { echo $e->getmessage(); } anyone can me ? name attribute of button must missed. define button in html below <input type="submit" name="register" value="register" />

some doubts about a Prolog program that use a moves graph to move blocks on 3 stack -

Image
i studying prolog using ivan bratko book: programming artificial intelligence , finding problems trying understand how work exercise use graphs decide how move blocks , arrange them in order. this image related program have do: as can see in previous image blocks a,b,c can moved using number of admissible moves are: a block can moved if @ top of stack a block can moved on ground (on void stack) a block can moved on block (at top of stack contains others blocks) so these admissible moves induce graph of possible transitions between 1 state , state in graph, this: so, can se in previous graph can represent situation using list of 3 sublist. each sublist represent stack can put blocks according previous constraints so example situation of central node of previous graph can represented by: [[a], [b], [c]] because each stack contain single block the situation represented node @ top left stacked 1 below other blocks c,a,b can represented by: [[c,a,b], [],

nodatime - Way to use bit shift to move decimal place -

i working on library needs date math extremely quickly. using jon skeet's noda time library, uses tick math, , extremely quick, want elapsed seconds in way faster casting noda time instant or duration timespan. the fastest way have been able far using ticks * 1e-07, thinking bit shifting might work faster (since 1e-07). in advance thoughts! don't cast timespan - take ticks , divide nodaconstants.tickspersecond . it's integer division, , very, quick. given 10 7 isn't power of 2 (or particularly neatly represented combinations of them) suspect you'd best off dividing. i'd surprised if division really proved bottleneck in code. while i'm trying keep noda time quick, i'm not above performing division or 2 appropriate :) if need partial seconds, i'd tempted divide tickspermillisecond instead, , use integer number of milliseconds rather using floating-point arithmetic. if need double elsewhere, of course, that's not going m

flyway - Issue on Google App Engine GAE: Unable to lock table schema_version -

we on gae cloud sql. works great on local dev server. using appenginedriver static connection string. connection in production environment flyway able create schema_version table. but error it's not able lock said table. table empty. have 3 migrations , none have been executed. we launch migration @ time spring creates datasource bean, in java config style. here's stack trace. many thanks! update 1: have added relevant secondary stack trace @ end of first one. com.googlecode.flyway.core.api.flywayexception: unable lock table ourschema . schema_version : java.sql.sqlexception: command not supported in prepared statement protocol yet @ com.google.cloud.sql.jdbc.internal.exceptions.newsqlexception(exceptions.java:219) @ com.google.cloud.sql.jdbc.internal.sqlprotoclient.check(sqlprotoclient.java:198) @ com.google.cloud.sql.jdbc.internal.sqlprotoclient.executesql(sqlprotoclient.java:87) @ com.google.cloud.sql.jdbc.internal.sqlprotoclient.executesql(sq

delphi - Delphi7, make a shape jump when pressing Up key -

i'd make shape jump when player presses key, best think of this, method used terrible , problematic: (shape coordinates: shape1.top:=432;) procedure tform1.formkeydown(sender: tobject; var key: word; shift: tshiftstate); begin case key of vk_up: shape1.top:=shape1.top-40 //so jumps 392 end; end; and timer: procedure tform1.timer1timer(sender: tobject); begin timer1.interval:=300 if shape1.top<400 //if shape1.top=392 < 400 begin shape1.top:=432; //move 432 end; end; the problem players can press key up, don't want. know method terrible, hope have better , grateful if share me. if player can hold down key , keydown fires repeatedly, can lock it. first, declare field on form called fkeylock: set of byte . (note: technique fail if key values higher 255, ones you're deal won't high.) procedure tform1.formkeydown(sender: tobject; var key: word; shift: tshiftstate); begin if key in fkeylock exit; case key of

html - set columns in table to invisible -

Image
the 2 tables inside 1 div (please see code below cut out of code bottom table), make first column of bottom div invisible....any ideas? replies <table align="center" class="detailstable" style="width:100%"> <tr> <th style="width:70%;"></th> <th style="text-align:left;">summary</th> <th style="text-align:right;"></th> </tr> <tr> <th style="width:70%;"></th> <td style="text-align:left; width:100px;">labour</td> <th style="text-align:right; width:100px;"><%: this.formatmoney(labourtotal)%></th> </tr> </table> if want make 'merged' cell contains total value, use css 'border-right-

Call requires API level 16 (current min is 14): android.app.Notification.Builder#build -

Image
the documentation says notification.builder added in api level 11. why lint error? call requires api level 16 (current min 14): android.app.notification.builder#build notification = new notification.builder(ctx) .setcontenttitle("title").setcontenttext("text") .setsmallicon(r.drawable.ic_launcher).build(); manifest: <uses-sdk android:minsdkversion="14" android:targetsdkversion="17" /> am missing something? correct me if wrong api added in level 11, right? added in api level 11 notificationbuilder.build() requires api level 16 or higher. between api level 11 & 15 should use notificationbuilder.getnotification() . use notification = new notification.builder(ctx) .setcontenttitle("title").setcontenttext("text") .setsmallicon(r.drawable.ic_launcher).getnotification();

jquery - Incremental Transform Rotation -

i'd button rotate element 5 additional degrees each time it's clicked. i've been able sort of thing border width like $(document).on('click', '.brdr_width_up', function() { $(ws.currentcell).css({'border-top-width' : '+=1', 'border-right-width' : '+=1','border-bottom-width' : '+=1','border-left-width' : '+=1'}); }); but same idea doesn't seem work transform:rotate: $(document).on('click', '.rotate_cw', function() { $(ws.currentcell).css({'-webkit-transform': 'rotate(+=5deg)'}); $(ws.currentcell).css({'-moz-transform': 'rotate(+=5deg)'}); var deg = $(ws.currentcell).css({'-moz-transform': 'rotate()'}); }); and var line above doesn't bring current rotation add it. does know way this? thanks if don't want messing around matrix, can use data attribute keep

Interrupt works too fast on the Arduino -

i know sounds bit funny :). trying eliminate possibilities: on arduino uno have attached interrupt triggered on high routine increments volatile defined long counter. counter displayed on lcd screen. if connect pulse generator frequency of 1 hz @ ttl levels, expect counter increase 1 per second. not case. as frequency 1 hz (duty cycle 50%) possible once counter incremented irs exited (and clears interrupt flag) but: int0 level still high isr called again? @ 1 hz 50% duty, high stay 500 ms , @ 16 mhz... the processor @ heart of arduino has 2 different kinds of interrupts: “external”, , “pin change”. there 2 external interrupt pins on atmega168/328 (ie, in arduino uno/nano/duemilanove), int0 , int1, , mapped arduino pins 2 , 3. these interrupts can set trigger on rising or falling signal edges, or on low level. triggers interpreted hardware, , interrupt fast. arduino mega has few more external interrupt pins available. so commented: triggers on edge! see more deta

wpf - MVVM pattern - executing view operations -

i'm using mvvm pattern (with mvvm light) build xaml app (win8). have listview, bound property of viewmodel. have button triggers operation on viewmodel, updates property (which results in updating listview). button uses commanding execute operation on viewmodel. far good. the problem after list refreshed need perform operation strictly belongs view, not viewmodel. should scroll list specific item. how trigger operation? should use specific listview event? using eventhandler , scrollintoview(object) method can achieve want without using references of view inside viewmovel , respecting mvvm pattern. create event in viewmodel this: public event eventhandler scrolllistview; in view add callback scroll listview when property updated: viewmodel vm; vm.scrolllistview += (sender, e) => { var specificitem = **some item**; mylistview.selecteditem = specificitem; mylistview.updatelayout(); mylistview.scrollintoview(mylistview.selecteditem); };

asp.net mvc - Unit Testing on Controller that uses AutoMapper -

i trying unit test updateuser controller uses automapping. here code controller updateusercontroller private readonly iunitofwork _unitofwork; private readonly iwebsecurity _websecurity; private readonly ioauthwebsecurity _oauthwebsecurity; private readonly imapper _mapper; public accountcontroller() { _unitofwork = new unitofwork(); _websecurity = new websecuritywrapper(); _oauthwebsecurity = new oauthwebsecuritywrapper(); _mapper = new mapperwrapper(); } public accountcontroller(iunitofwork unitofwork, iwebsecurity websecurity, ioauthwebsecurity oauthwebsecurity, imapper mapper) { _unitofwork = unitofwork; _websecurity = websecurity; _oauthwebsecurity = oauthwebsecurity; _mapper = mapper; } // // post: /account/updateuser [httppost] [validateantiforgerytoken] public actionresult updateuser(updateusermodel model) { if (modelstate.isvalid)

Is it possible to create a 'splash' screen using the Google Maps API? -

i have built custom google map , when page loads 'splash screen' appear on map inside map container (this image instructions), either toggled off or disappear after set time. i know can using css/jquery create layer on map container, possible using map api? you use overlays or custom infowindow (infobox). suggest overlays. existence displaying components on map. infowindow suffice too, role displaying in relation specific spot on map. see this more

html - avoid css hack for IE8 checkbox -

i'm using css3 style checkbox site (slide three) html: <div class="slidethree"> <input type="checkbox" id="slidethree" name="check" /> <label for="slidethree"></label> </div> css: input[type=checkbox] { visibility: hidden; } /* slide 3 */ .slidethree { width: 91px; height: 26px; background: #2b3d61; margin: 5px; -webkit-border-radius: 50px; -moz-border-radius: 50px; border-radius: 50px; position: relative; -webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2); box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2); } .slidethree:after { content: 'off'; font: 14px/26px arial, sans-serif; color: #fff; position: absolute; right: 10px; z-index: 0;

jquery - Floated element's absolute positioned content broke layout and crashes animation -

i creating image gallery , want add each element expanding menu on click. i want recreate itunes 11 album view effect. i put images grid using html unordered list <ul> <li><div class="box"></div></li> <li><div class="box"></div></li> <li><div class="box"></div></li> ... <li><div class="box"></div></li> <li class="clear"></li> </ul> then using jquery wrote function triggered when click on li element, adding div, , div loads menu. $("li").click( function() { $(this).append("<div class='container'></div>"); var cont = $(".container", $(this)); cont.html("<div class='menu'><div class='content'></div></div>"); var item_height = $(this).outerheight(); var cont_heigh

javascript - What is the better way to remove the "parent index of" of an array? -

enter code here im making nodejs application... let me show question;; //id = dinamic string.. "user1", "user2", "userx" usersarray = []; usersarray[id]["socket"] = socket; when sockets ends, want remove [id] usersarray.. @ time id not availabe socket.on('end', function () { ?........? socket.end(); }); how it? there's socket.id works identifier each socket. then, can use associative array instead of usersarray : var usersarray = {}; usersarray[socket.id] = some_user_data; you can remove entry using delete usersarray[socket.id] .

javascript - variable empty when doing an asynchronous call in node.js (closure) -

update: solved, indeed scope issue. got around moving user list code inside database class , returning prebuilt list. using node.js, make asynchronous call function finduser , build list of users callback variable content. works fine during loop (where says content variable available) when loop exits, variable empty. how can rewrite code value of variable content available outside loop? exports.listusers=function(req,res) { var content='' isloggedin=user.finduser({},function(myuser) { content = content +'<li>' + myuser.firstname + ' ' + myuser.lastname + "</li>\n"; //here value of content var available console.log(content) }) //here value of content var empty console.log(content) showpage(req,res,{'content':content}) } if finduser() asynchronous (which indicate), issue finduser() has not yet completed when showpage() called. for asynchronous functions,

sql - randomly generating unique number between 1-999 for primary key in table -

i have problem i'm not sure how solve elegantly. background information i have table of widgets. each widget assigned id range of numbers, let's between 1-999. values of 1-999 saved in database "lower_range" , "upper_range" in table called "config". when user requests create new widget using web app, need able following: generate random number between 1 , 999 using lua's math.random function or maybe random number generator in sqlite (so far, in tests, lua's math.random returns same value...but that's different issue) do select statement see if there widget number assigned... if not, create new widget. otherwise repeat process until number not in use. problem the problem see above logic two-fold: the algorithm can potentially take long time because have keep searching until find unique value. how prevent simultaneous requests new widget numbers generating same value? any suggestions appreciated. thanks

php - Rows are not being deleted -

here php code select , delete rows form table: <h1>deleting multiple records using php &amp; mysql</h1> <p>&nbsp;</p> <?php these db connection: $host = "localhost"; // host name $username = "root"; // mysql username $password = ""; // mysql password $db_name = "project"; // changed database name $tbl_name = "users"; mysql_connect($host, $username, $password) or die("cannot connect"); mysql_select_db($db_name) or die("cannot select db"); $sql = "select * $tbl_name"; $result = mysql_query($sql); $count = mysql_num_rows($result); ?> here html code retrieve data database: <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr><td><form name="form1" method="post" action=""> <table width="400" border="

How do I read or write a cookie in php using gwan? -

how read or write cookie in php using gwan? tried use setcookie, variables appear , post in argv. char cookies[] = "cookie: blah\r\n" // add cookie in response http_header(head_add, cookies, sizeof(cookies) - 1, argv);

Proper usage of Python 3 ftp class -

as python newbie still learning language, struggled couple of days trying simple ascii file transfer (stor/put) using ftp class in ftplib (running python 3.3). after using storbinary() method , consistently getting typeerror: "type str doesn't support buffer api", discovered discussion on thread, implies there bug in port of ftplib python 3: http://bugs.python.org/issue6822 i tried using storbinary() instead of storlines(), using file object opened using 'rb' switch , seems work perfectly. i'm working on windows system, , testing/learning purposes i'm uploading own site on linux host. after uploading both .zip , .txt files , copying them down workstation using filezilla, both files intact. in day-to-day work need upload gzipped , ascii files mainframe, , concerned may leaving myself open file transfer errors using counter-intuitive work-around. i've screwed many manual ftp transfers when forgetting switch appropriate transfer mode, feels cr

android - List view's getChildCount method does not return an accurate count of the number of visible items -

i need able tell items in list view visible. " visibleitemcount " term in onscroll , listview.getchildcount both return values typically 1-3 higher should based on visible on screen. items not same height might play role in throwing off. what best way more accurate reading of visible? the method getchildcount() not supposed return count of visible childs but, docs : returns number of children in group. to number of visible items should using getlastvisibleposition() , getfirstvisibleposition() : int visiblechildscount=lv.getlastvisibleposition()-lv.getfirstvisibleposition();

c# - Linq Query and Expected Results -- Distinct Field -

i have nested linq sql query used populate treeview . first select ( title field) when being bound treeview showing of titles correctly, if there multiple occurences want show once. how can solve this? i tried }).distinct().orderby(c => c.linenumber) }).distinct(); full query var results = (from d in mcontext.docs orderby d.title ascending join b in mcontext.base on d.docid equals b.docid join h in mcontext.viewdocitems on b.baseid equals h.baseid h.itemid == mguid select new { id = d.docid, title = d.title, classid = d.classid, basehis = (from c in d.base select new basehistory() { baseid = c.baseid, name = c.title, basefinal = c.final.value, linenumber = c.linenumber.value itemid = h.itemid }).distinct().orderby(c => c.linenumber) });

right to left - How do I have Android use a qualified resource file only on older devices? -

i have separate layout file arabic users, want use devices don't support android's native rtl mirroring (introduced in api level 17). if using device api 17 or above, want default xml file used. how accomplish this? know: if put home.xml in res/layout/ used default layout file. if put home.xml in res/layout-ar/ used arabic speakers if put home.xml in res/layout-ar-v17/ used arabic speakers v17 or higher.* *the problem is, don't want have home.xml, want system use default , mirror it. you use layout aliases . end 2 layout files, let's call them home_one.xml , home_two.xml. in res/values/layout.xml , res/values-ar-v17/layout.xml have <item name="home" type="layout">@layout/home_one</item> and in res/values-ar/layout.xml need <item name="home" type="layout">@layout/home_two</item>

json - jaxb issue with xsd:choice and xsd:sequence -

i have schema has below element <xs:element name="field"> <xs:complextype> <xs:sequence> <xs:element ref="type" minoccurs="1" maxoccurs="1"/> <xs:choice> <xs:sequence> <xs:choice> <xs:element ref="content"/> <xs:sequence> <xs:element ref="cmd"/> <xs:element ref="legend"/> </xs:sequence> </xs:choice> <xs:element ref="id" minoccurs="0"/> </xs:sequence> <xs:sequence> <xs:element ref="name"/>

tfs - Get Build Quality List -

i have custom build deploys code, part of deploy process need specify build quality. have type in quality, such "ready deployment". want add custom process parameter dropdown contains build qualities setup project. initially started create custom activity build qualities. tfs has method using: buildserver.getbuildqualities(teamprojectname) however, custom activity requires teamprojectname passed in. confused, don't understand how pass argument in. we have lots of projects , want use same build definition of them, can't hardcode team project name. there builddetail variable (of type ibuilddetail ) in workflow. has teamproject property contains name of team project current build workflow running. you should add string input argument activity , set value in xaml designer builddetail.teamproject passed in.

java - How to write a SWT based GUI in Eclipse plug-in? -

i learned how write swt based application following tutorial . however, don't know how move forward gui eclipse plug-in. the plug-in writing right-clicking on ijavaelement node in package explorer, show 1 more action, action bring gui dialog letting me fill out value , save result database. right problems are: i can write stand alone swt based gui application, don't know how put following code snippet in public void run(iaction action) display display = new display(); shell shell = new shell(display); shell.setlayout(new gridlayout()); shell.open(); while (!shell.isdisposed()) { if (!display.readanddispatch()) display.sleep(); } display.dispose(); all swt tutorial found create shell, display in main, looks should differently in eclipse plug-in. must use jface create dialog while developing eclipse plug-in? without adding org.eclipse.swt(.cocoa.macosx.x86_64.source) in plugin.xml dependency, show action if right-clicked on ijavaelement . when try r