Search Results

Search found 2362 results on 95 pages for 'matt mc'.

Page 22/95 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Javascript dispatchEvent

    - by xpepermint
    Hey... I'm using Flash a lot and my classes uses EventDispatcher class which allowes me to define custom events of a class. How can I do this in javascript. I would like to do something like this: var MyClass = function() { }; MyClass.prototype = { test : function() { dispatchEvent('ON_TEST'); } }; var mc = new MyClass(); mc.addEventListener('ON_TEST', handler); function handler() { alert('working...') } How is this posible with Javascript?

    Read the article

  • Flash: dynamically adding events code to instances possible?

    - by Kohan
    I want to make a movieclip invisible initially but i dont want to set it manually within the properties in flash because i cant then see it on the scene. I was hoping i could add some code like so: MC Frame one. this.onClipEvent(load) { this._alpha = 0; } but I cannot. How can i set the MC _alpha to 0 for all instances without adding it manually to each instance or setting it in the properties? edit: or creating a class for it just to set the alpha.

    Read the article

  • attaching id to a movieclip

    - by Ross
    I have a loop that creates mc from a database for (var i:Number = 0; i < t.length; i++) { var portfolioItem:PortfolioItem = new PortfolioItem(); addChild(portfolioItem); portfolioItem.name = t[i][0]; portfolioItem.addEventListener(MouseEvent.CLICK, getThisName); } public function getThisName(evt:Event) { trace(evt.target.name); } I try and assign t[i][0] which is the table id to the name attribute but I jsut get 'instance4' or instance 14. How can I give these dynamically create mc's a name or custom property? ideally I would like to use a custom property called portfolio.id but would use the name property or another default property if it works.

    Read the article

  • Error while applying overlay on a location on a Google map in Android

    - by Hiccup
    This is my Activity for getting Location: public class LocationActivity extends MapActivity{ Bundle bundle = new Bundle(); MapView mapView; MapController mc; GeoPoint p; ArrayList <String> address = new ArrayList<String>(); List<Address> addresses; private LocationManager locationManager; double lat, lng; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); mapView = (MapView) findViewById(R.id.mapView1); mapView.displayZoomControls(true); mc = mapView.getController(); LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); // criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); String strLocationProvider = lm.getBestProvider(criteria, true); //Location location = lm.getLastKnownLocation(strLocationProvider); Location location = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); lat = (double) location.getLatitude(); lng = (double) location.getLongitude(); p = new GeoPoint( (int) (lat * 1E6), (int) (lng * 1E6)); mc.animateTo(p); mc.setZoom(17); MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); Geocoder gcd = new Geocoder(this, Locale.getDefault()); try { addresses = gcd.getFromLocation(lat,lng,1); if (addresses.size() > 0 && addresses != null) { address.add(addresses.get(0).getFeatureName()); address.add(addresses.get(0).getAdminArea()); address.add(addresses.get(0).getCountryName()); bundle.putStringArrayList("id1", address); } bundle.putDouble("lat", lat); bundle.putDouble("lon", lng); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.logo); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } @Override public boolean onTouchEvent(MotionEvent event, MapView mapView) { //---when user lifts his finger--- if (event.getAction() == 1) { Bundle bundle = new Bundle(); ArrayList <String> address = new ArrayList<String>(); GeoPoint p = mapView.getProjection().fromPixels( (int) event.getX(), (int) event.getY()); Geocoder geoCoder = new Geocoder( getBaseContext(), Locale.getDefault()); try { List<Address> addresses = geoCoder.getFromLocation( p.getLatitudeE6() / 1E6, p.getLongitudeE6() / 1E6, 1); addOverLay(); MapOverlay mapOverlay = new MapOverlay(); Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.crumbs_logo); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); String add = ""; if (addresses.size() > 0) { address.add(addresses.get(0).getFeatureName()); address.add(addresses.get(0).getLocality()); address.add(addresses.get(0).getAdminArea()); address.add(addresses.get(0).getCountryName()); bundle.putStringArrayList("id1", address); for(int i = 0; i <= addresses.size();i++) add += addresses.get(0).getAddressLine(i) + "\n"; } bundle.putDouble("lat", p.getLatitudeE6() / 1E6); bundle.putDouble("lon", p.getLongitudeE6() / 1E6); Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show(); } catch (IOException e) { e.printStackTrace(); } return true; } else return false; } } public void onClick_mapButton(View v) { Intent intent = this.getIntent(); this.setResult(RESULT_OK, intent); intent.putExtras(bundle); finish(); } public void addOverLay() { MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } public void FindLocation() { LocationManager locationManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE); LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) { // updateLocation(location); Toast.makeText( LocationActivity.this, String.valueOf(lat) + "\n" + String.valueOf(lng), 5000) .show(); } public void onStatusChanged(String provider, int status, Bundle extras) { } public void onProviderEnabled(String provider) { } public void onProviderDisabled(String provider) { } }; locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); } } I face two problems here. One is that when I click (do a tap) on any location, the overlay is not changing to that place. Also, the app crashes when I am on the MapView page and I click on back button. What might be the error?

    Read the article

  • how to create a subquery in sql using count based on outer query

    - by user1754716
    I hope someone can help me with this query. Basically I have two queries that I want to "combine". I want the second query as an extra column along with the first query. The first one is this : SELECT t_Item_Storage_Location.Storage_Loc_Nbr, t_Storage_Location.Storage_Loc_Type_Code, Count(t_Load.Load_Id) AS CurrentLoadCount, t_load.MMM_Id_Nbr FROM t_Load INNER JOIN (t_Storage_Location INNER JOIN t_Item_Storage_Location ON t_Storage_Location.Storage_Loc_Nbr = t_Item_Storage_Location.Storage_Loc_Nbr) ON (t_Load.Storage_Loc_Nbr = t_Item_Storage_Location.Storage_Loc_Nbr) AND (t_Load.MMM_Id_Nbr = t_Item_Storage_Location.MMM_Id_Nbr) where ((((t_Item_Storage_Location.MMM_Id_Nbr) Between '702004%' And '702011%') AND ((t_Item_Storage_Location.Storage_Loc_Nbr) Like '%A') AND ((t_Storage_Location.Storage_Loc_Type_Code)='CD') AND ((t_Load.Active_Status_Ind)='A') AND ((t_Load.QC_Status_Code) Like 'R%') AND ((t_Load.MMM_Facility_Code)='MC')) OR (((t_Item_Storage_Location.Storage_Loc_Nbr) Like '%B')) OR (((t_Item_Storage_Location.Storage_Loc_Nbr) Like '%C')) OR (((t_Item_Storage_Location.Storage_Loc_Nbr) Like '%D')) OR (((t_Item_Storage_Location.Storage_Loc_Nbr) Like '%E')) ) GROUP BY t_Item_Storage_Location.MMM_Id_Nbr, t_Item_Storage_Location.Storage_Loc_Nbr, t_Storage_Location.Storage_Loc_Type_Code, t_Load.MMM_Facility_Code, t_load.MMM_Id_Nbr HAVING Count(t_Load.Load_Id)<4 The second one, is based on the t_load.MMM_Id_Nbr of the first one. Basically I want a count of all the loads with that mmm_id_nbr. SELECT count(Load_ID) as LoadCount, MMM_Id_Nbr, storage_Loc_Nbr FROM t_load WHERE QC_Status_Code like 'R%' and mmm_Facility_Code ='MC' and Active_Status_Ind='A' GROUP by MMM_Id_Nbr, storage_loc_Nbr

    Read the article

  • Generic extension method returning IEnumerable<T> without using reflection

    - by roosteronacid
    Consider this snippet of code: public static class MatchCollectionExtensions { public static IEnumerable<T> AsEnumerable<T>(this MatchCollection mc) { return new T[mc.Count]; } } And this class: public class Ingredient { public String Name { get; set; } } Is there any way to magically transform a MatchCollection object to a collection of Ingredient? The use-case would look something like this: var matches = new Regex("([a-z])+,?").Matches("tomato,potato,carrot"); var ingredients = matches.AsEnumerable<Ingredient>();

    Read the article

  • deprecated readLine() What to change?

    - by user1681751
    I'm trying to get this to work in the eclipse, but the "readLine" is striked through and a notice says it is depreciated, the code works, albeit not the "while ((var2 = var5.readLine()) != null) {" bit.. So I'm wondering how to fix it, a java beginner. String var2 = ""; HttpURLConnection var3 = null; DataOutputStream var4 = null; DataInputStream var5 = null; ...more code here.... try { var5 = new DataInputStream(var3.getInputStream()); while ((var2 = var5.readLine()) != null) { System.out.println("Server Response " + var2); ScreenShotHelper.mc.thePlayer.addChatMessage("\u00a7aSuccessfully uploaded screenshot! Direct link:"); ScreenShotHelper.mc.thePlayer.addChatMessage("\u00a7a" + var2); } var5.close(); }

    Read the article

  • Google Map key in Android?

    - by Amandeep singh
    I am developing an android app in which i have to show map view i have done it once in a previous app but the key i used in the previous is not working int his app . It is just showing a pin in the application with blank screen. Do i have to use a different Map key for each project , If not Kindly help me how can i use my previous Key in this. and also I tried generating a new key but gave the the same key back . Here is the code i used public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); btn=(Button)findViewById(R.id.mapbtn); str1=getIntent().getStringExtra("LATITUDE"); str2=getIntent().getStringExtra("LONGITUDE"); mapView = (MapView)findViewById(R.id.mapView1); //View zoomView = mapView.getZoomControls(); mapView.setBuiltInZoomControls(true); //mapView.setSatellite(true); mc = mapView.getController(); btn.setOnClickListener(this); MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); String coordinates[] = {str1, str2}; double lat = Double.parseDouble(coordinates[0]); double lng = Double.parseDouble(coordinates[1]); p = new GeoPoint( (int) (lat * 1E6), (int) (lng * 1E6)); mc.animateTo(p); mc.setZoom(17); mapView.invalidate(); //mp.equals(o); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); Paint mPaint = new Paint(); mPaint.setDither(true); mPaint.setColor(Color.RED); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(2); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pin); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } Thanks....

    Read the article

  • c++ undefined references with static library

    - by stupid_idiot
    hi guys i'm trying to make a static library from a class but when trying to use it i always get errors with undefined references on anything. the way i proceeded was creating the object file like g++ -c myClass.cpp -o myClass.o and then packing it with ar rcs myClass.lib myClass.o there is something i'm obviously missing generaly with this.. i bet it's something with symbols.. thx for any advices, i know it's most probably something i could find out if reading some tutorial so sorry if bothering with stupid stuff again :) edit: myClass.h: class myClass{ public: myClass(); void function(); }; myClass.cpp: #include "myClass.h" myClass::myClass(){} void myClass::function(){} program using the class: #include "myClass.h" int main(){ myClass mc; mc.function(); return 0; } finally i compile it like this: g++ -o main.exe -L. -l myClass main.cpp

    Read the article

  • Use format strings that contain %1, %2 etc. instead of %d, %s etc. - Linux, C++

    - by rursw1
    Hello, As a follow-up of this question (Message compiler replacement in Linux gcc), I have the following problem: When using MC.exe on Windows for compiling and generating messages, within the C++ code I call FormatMessage, which retrieves the message and uses the va_list *Arguments parameter to send the varied message arguments. For example: messages.mc file: MessageId=1 Severity=Error SymbolicName=MULTIPLE_MESSAGE_OCCURED Language=English message %1 occured %2 times. . C++ code: void GetMsg(unsigned int errCode, wstring& message,unsigned int paramNumber, ...) { HLOCAL msg; DWORD ret; LANGID lang = GetUserDefaultLangID(); try { va_list argList; va_start( argList, paramNumber ); const TCHAR* dll = L"MyDll.dll"; _hModule = GetModuleHandle(dll); ret =::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE|FORMAT_MESSAGE_IGNORE_INSERTS, _hModule, errCode, lang, (LPTSTR) &msg, 0, &argList ); if ( 0 != ret ) { unsigned int count = 0 ; message = msg; if (paramNumber>0) { wstring::const_iterator iter; for (iter = message.begin();iter!=message.end();iter++) { wchar_t xx = *iter; if (xx ==L'%') count++; } } if ((count == paramNumber) && (count >0)) { ::LocalFree( msg ); ret =::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE, _hModule, errCode, GetUserDefaultLangID(), (LPTSTR) &msg, 0, &argList ); } else if (count != paramNumber) { wstringstream tmp; wstring messNumber; tmp << (errCode & 0xFFFF); tmp >> messNumber; message = message +L"("+ messNumber + L"). Bad Format String. "; } } ::LocalFree( msg ); } catch (...) { message << L"last error: " << GetLastError(); } va_end( argList ); } Caller code: wstring message; GetMsg(MULTIPLE_MESSAGE_OCCURED, message,2, "Error message", 5); Now, I wrote a simple script to generate a .msg file from the .mc file, and then I use gencat to generate a catalog from it. But is there a way to use the formatted strings as they contain %1, %2, etc. and NOT the general (%d, %s...) format? Please note, that the solution has to be generic enough for each possible message with each posible types\ arguments order... Is it possible at all? Thank you.

    Read the article

  • AS3 (Pixelfumes Reflection Class)

    - by Mick
    Hi I am using a reflection class in my code. I have stripped it right down to the code below. I have a mc on the stage with an instance name of sand. I have tried all combinations and do not get an error BUT i don't get a reflection either. I have been on the forums for the site but cant find any info. Does anyone have any experience with this plugin please ? import com.pixelfumes.reflect.*; new Reflect({mc:sand, alpha:100, ratio:255, distance:0, updateTime:0.2, reflectionAlpha:100, reflectionDropoff:3.64});

    Read the article

  • C# / IronPython Interop and the "float" data type

    - by Adam Haile
    Working on a project that uses some IronPython scripts to as plug-ins, that utilize functionality coded in C#. In one of my C# classes, I have a property that is of type: Dictionary<int, float> I set the value of that property from the IronPython code, like this: mc = MyClass() mc.ValueDictionary = Dictionary[int, float]({1:0.0, 2:0.012, 3:0.024}) However, when this bit of code is run, it throws the following exception: Microsoft.Scripting.ArgumentTypeException was unhandled by user code Message=expected Dictionary[int, Single], got Dictionary[int, float] To make things weirder, originally the C# code used Dictionary<int, double> but I could not find a "double" type in IronPython, tried "float" on a whim and it worked fine, giving no errors. But now that it's using float on both ends (which it should have been using from the start) it errors, and thinks that the C# code is using the "Single" data type?! I've even checked in the object browser for the C# library and, sure enough, it shows as using a "float" type and not "Single"

    Read the article

  • WPF: Custom control that binds its content to a label

    - by nialsh
    I want to write a custom control that's used like this: <HorizontalTick>Some string</HorizontalTick> It should render like this: -- Some string ------------------------------------------- Here's my code: <UserControl x:Class="WeatherDownloadDisplay.View.HorizontalTick" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignWidth="348" Name="controlRoot"> <DockPanel LastChildFill="True"> <UserControl VerticalAlignment="Center" BorderBrush="Black" BorderThickness="1" Width="10"/> <Label Content="???" /> <UserControl VerticalAlignment="Center" BorderBrush="Black" BorderThickness="1"/> </DockPanel> It works except for the label binding. Can someone help me fill in the question marks? I thought about using a ContentPresenter but it seems like an inline binding would be best. -Neal

    Read the article

  • signature output operator overload

    - by coubeatczech
    hi, do you know, how to write signature of a function or method for operator<< for template class in C++? I want something like: template <class A class MyClass{ public: friend ostream & operator<<(ostream & os, MyClass<A mc); } ostream & operator<<(ostream & os, MyClass<A mc){ // some code return os; } But this just won't compile. Do anyone know, how to write it correctly?

    Read the article

  • [as3] Movieclip.width returns higher value than Movieclip stage on Width.

    - by Sawrb
    I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .width value of the parent MC at run-time. And the ParentMC on stage is not scaled (it is at 100% width/height). Any pointers, to what could be the reasons for the discrepancy in .width values on stage and on run-time? Its breaking the scaling code that follows.

    Read the article

  • Google Map + MarkerClusterer only takes place when map completely zooms out

    - by user415795
    The clustering works but somehow it only takes place at the maximum zoom out(the largest view with all nations), the moment I zoom in by 1 value, the clustering icon changes back to markers. I try with all kinds of values on the maxZoom and gridSize clusterer options with no help. Can someone please kindly advice. Thanks. <script language="javascript" type="text/javascript"> var markersArray = []; var mc = null; var markersArray = []; var mc = null; var map; var mapOptions; var geocoder; var infoWindow; var http_request = false; var lat = 0; var lng = 0; var startingZoom = 7; var lowestZoom = 1; // The lower the number, the more places can be seen on within the bounds. var highestZoom = 8; function mapLoad() { geocoder = new google.maps.Geocoder(); infoWindow = new google.maps.InfoWindow(); mapOptions = { zoomControl: true, zoom: 2, minZoom: lowestZoom, maxzoom: highestZoom, draggable: true, scrollwheel: true, disableDoubleClickZoom: true, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map'), mapOptions); } $(document).ready(function () { var searchUrl; var locations; // Place the user's current location marker on the map var Location = new google.maps.LatLng(1.340319, 103.743744); var Location2 = new google.maps.LatLng(1.322347, 103.757881); createMarker('1', Location, 'My Location', '', '', '', '/Images/home.png'); createMarker('1', Location2, 'My Location', '', '', '', '/Images/bb.png'); var bounds = new google.maps.LatLngBounds(); bounds.extend(gameLocation); map.fitBounds(bounds); }); // Create the marker with address information function createMarker(actId, point, address1, address2, town, postcode, icon) { var marker = new google.maps.Marker({ map: map, icon: icon, position: point, title: address1, animation: google.maps.Animation.DROP }); marker.metadata = { id: actId }; markersArray.push(marker); mc = new MarkerClusterer(map, markersArray); return marker; } </script>

    Read the article

  • Stop running this script, IE7 using PHP

    - by Jomel Dicen
    I incorporate javascript in my PHP program: Try to check my codes. It loops depend on the number of records in database. for instance: $counter = 0; foreach($row_value as $data): echo $this->javascript($counter, $data->exrate, $data->tab); endforeach; private function javascript($counter=NULL, $exrate=NULL, $tab=NULL){ $js = " <script type='text/javascript'> $(function () { var textBox0 = $('input:text[id$=quantity{$counter}]').keyup(foo); var textBox1 = $('input:text[id$=mc{$counter}]').keyup(foo); var textBox2 = $('input:text[id$=lc{$counter}]').keyup(foo); function foo() { var value0 = textBox0.val(); var value1 = textBox1.val(); var value2 = textBox2.val(); var sum = add(value1, value2) * (value0 * {$exrate}); $('input:text[id$=result{$counter}]').val(parseFloat(sum).toFixed(2)); // Compute Total Quantity var qtotal = 0; $('.quantity{$tab}').each(function() { qtotal += Number($(this).val()); }); $('#tquantity{$tab}').text(qtotal); // Compute MC UNIT var mctotal = 0; $('.mc{$tab}').each(function() { mctotal += Number($(this).val()); }); $('#tmc{$tab}').text(mctotal); // Compute LC UNIT var lctotal = 0; $('.lc{$tab}').each(function() { lctotal += Number($(this).val()); }); $('#tlc{$tab}').text(lctotal); // Compute Result var result = 0; $('.result{$tab}').each(function() { result += Number($(this).val()); }); $('#tresult{$tab}').text(result); } function add() { var sum = 0; for (var i = 0, j = arguments.length; i < j; i++) { if (IsNumeric(arguments[i])) { sum += parseFloat(arguments[i]); } } return sum; } function IsNumeric(input) { return (input - 0) == input && input.length > 0; } }); </script> "; return $js; } When I running this on IE this message is always annoying me " Stop running this script? A script on this page is causing your web browser to run slowly. If it continues to run, your computer might become unresponsive." but in firefox it's functioning well.

    Read the article

  • Using ManagementClass.Getinstances() from IronPython

    - by Leo Bontemps
    I have an IronPython script that looks for current running processes using WMI. The code looks like this: import clr clr.AddReference('System.Management') from System.Management import ManagementClass from System import Array mc = ManagementClass('Win32_Processes') procs = mc.GetInstances() That last line where I call the GetInstances() method raises the following error: Traceback (most recent call first): File "<stdin>", line 1, in <module> SystemError: Not Found I am not understanding what's not being found?!? I believe that I may need to pass an instance of ManagementOperationObserver and of EnumerationOptions to GetInstance() however, I don't understand why that is, since the method with the signature Getinstance() is available in ManagementClass.

    Read the article

  • Possible to access all Movie clips on a layer, on timeline, through stage ?

    - by azislo
    I have a code ... var selection:Array = new Array(); var diplayObjCont:* = stage; // The rectangle that defines the selection in the containers coordinate space. // Loop throught the containers children. for(var a:int; a<diplayObjCont.numChildren; a++){ // Get the childs bounds in the containers coordinate space. var child:DisplayObject = diplayObjCont.getChildAt(a); selection.push(child); } trace(selection); that returns just [object MainTimeline] So, can I access layers on this MainTimeline to get all Movie Clips on this layer ? So I can do a simple operation "A_1_2.buttonMode = true;" to all my MC's (in an array for example) without writing every line (lot of MC's on layer and lot of lines).

    Read the article

  • Listing common SQL Code Smells.

    - by Phil Factor
    Once you’ve done a number of SQL Code-reviews, you’ll know those signs in the code that all might not be well. These ’Code Smells’ are coding styles that don’t directly cause a bug, but are indicators that all is not well with the code. . Kent Beck and Massimo Arnoldi seem to have coined the phrase in the "OnceAndOnlyOnce" page of www.C2.com, where Kent also said that code "wants to be simple". Bad Smells in Code was an essay by Kent Beck and Martin Fowler, published as Chapter 3 of the book ‘Refactoring: Improving the Design of Existing Code’ (ISBN 978-0201485677) Although there are generic code-smells, SQL has its own particular coding habits that will alert the programmer to the need to re-factor what has been written. See Exploring Smelly Code   and Code Deodorants for Code Smells by Nick Harrison for a grounding in Code Smells in C# I’ve always been tempted by the idea of automating a preliminary code-review for SQL. It would be so useful to trawl through code and pick up the various problems, much like the classic ‘Lint’ did for C, and how the Code Metrics plug-in for .NET Reflector by Jonathan 'Peli' de Halleux is used for finding Code Smells in .NET code. The problem is that few of the standard procedural code smells are relevant to SQL, and we need an agreed list of code smells. Merrilll Aldrich made a grand start last year in his blog Top 10 T-SQL Code Smells.However, I'd like to make a start by discovering if there is a general opinion amongst Database developers what the most important SQL Smells are. One can be a bit defensive about code smells. I will cheerfully write very long stored procedures, even though they are frowned on. I’ll use dynamic SQL occasionally. You can only use them as an aid for your own judgment and it is fine to ‘sign them off’ as being appropriate in particular circumstances. Also, whole classes of ‘code smells’ may be irrelevant for a particular database. The use of proprietary SQL, for example, is only a ‘code smell’ if there is a chance that the database will have to be ported to another RDBMS. The use of dynamic SQL is a risk only with certain security models. As the saying goes,  a CodeSmell is a hint of possible bad practice to a pragmatist, but a sure sign of bad practice to a purist. Plamen Ratchev’s wonderful article Ten Common SQL Programming Mistakes lists some of these ‘code smells’ along with out-and-out mistakes, but there are more. The use of nested transactions, for example, isn’t entirely incorrect, even though the database engine ignores all but the outermost: but it does flag up the possibility that the programmer thinks that nested transactions are supported. If anything requires some sort of general agreement, the definition of code smells is one. I’m therefore going to make this Blog ‘dynamic, in that, if anyone twitters a suggestion with a #SQLCodeSmells tag (or sends me a twitter) I’ll update the list here. If you add a comment to the blog with a suggestion of what should be added or removed, I’ll do my best to oblige. In other words, I’ll try to keep this blog up to date. The name against each 'smell' is the name of the person who Twittered me, commented about or who has written about the 'smell'. it does not imply that they were the first ever to think of the smell! Use of deprecated syntax such as *= (Dave Howard) Denormalisation that requires the shredding of the contents of columns. (Merrill Aldrich) Contrived interfaces Use of deprecated datatypes such as TEXT/NTEXT (Dave Howard) Datatype mis-matches in predicates that rely on implicit conversion.(Plamen Ratchev) Using Correlated subqueries instead of a join   (Dave_Levy/ Plamen Ratchev) The use of Hints in queries, especially NOLOCK (Dave Howard /Mike Reigler) Few or No comments. Use of functions in a WHERE clause. (Anil Das) Overuse of scalar UDFs (Dave Howard, Plamen Ratchev) Excessive ‘overloading’ of routines. The use of Exec xp_cmdShell (Merrill Aldrich) Excessive use of brackets. (Dave Levy) Lack of the use of a semicolon to terminate statements Use of non-SARGable functions on indexed columns in predicates (Plamen Ratchev) Duplicated code, or strikingly similar code. Misuse of SELECT * (Plamen Ratchev) Overuse of Cursors (Everyone. Special mention to Dave Levy & Adrian Hills) Overuse of CLR routines when not necessary (Sam Stange) Same column name in different tables with different datatypes. (Ian Stirk) Use of ‘broken’ functions such as ‘ISNUMERIC’ without additional checks. Excessive use of the WHILE loop (Merrill Aldrich) INSERT ... EXEC (Merrill Aldrich) The use of stored procedures where a view is sufficient (Merrill Aldrich) Not using two-part object names (Merrill Aldrich) Using INSERT INTO without specifying the columns and their order (Merrill Aldrich) Full outer joins even when they are not needed. (Plamen Ratchev) Huge stored procedures (hundreds/thousands of lines). Stored procedures that can produce different columns, or order of columns in their results, depending on the inputs. Code that is never used. Complex and nested conditionals WHILE (not done) loops without an error exit. Variable name same as the Datatype Vague identifiers. Storing complex data  or list in a character map, bitmap or XML field User procedures with sp_ prefix (Aaron Bertrand)Views that reference views that reference views that reference views (Aaron Bertrand) Inappropriate use of sql_variant (Neil Hambly) Errors with identity scope using SCOPE_IDENTITY @@IDENTITY or IDENT_CURRENT (Neil Hambly, Aaron Bertrand) Schemas that involve multiple dated copies of the same table instead of partitions (Matt Whitfield-Atlantis UK) Scalar UDFs that do data lookups (poor man's join) (Matt Whitfield-Atlantis UK) Code that allows SQL Injection (Mladen Prajdic) Tables without clustered indexes (Matt Whitfield-Atlantis UK) Use of "SELECT DISTINCT" to mask a join problem (Nick Harrison) Multiple stored procedures with nearly identical implementation. (Nick Harrison) Excessive column aliasing may point to a problem or it could be a mapping implementation. (Nick Harrison) Joining "too many" tables in a query. (Nick Harrison) Stored procedure returning more than one record set. (Nick Harrison) A NOT LIKE condition (Nick Harrison) excessive "OR" conditions. (Nick Harrison) User procedures with sp_ prefix (Aaron Bertrand) Views that reference views that reference views that reference views (Aaron Bertrand) sp_OACreate or anything related to it (Bill Fellows) Prefixing names with tbl_, vw_, fn_, and usp_ ('tibbling') (Jeremiah Peschka) Aliases that go a,b,c,d,e... (Dave Levy/Diane McNurlan) Overweight Queries (e.g. 4 inner joins, 8 left joins, 4 derived tables, 10 subqueries, 8 clustered GUIDs, 2 UDFs, 6 case statements = 1 query) (Robert L Davis) Order by 3,2 (Dave Levy) MultiStatement Table functions which are then filtered 'Sel * from Udf() where Udf.Col = Something' (Dave Ballantyne) running a SQL 2008 system in SQL 2000 compatibility mode(John Stafford)

    Read the article

  • Daily tech links for .net and related technologies - Apr 15-18, 2010

    - by SanjeevAgarwal
    Daily tech links for .net and related technologies - Apr 15-18, 2010 Web Development Guarding against CSRF Attacks in ASP.NET MVC2 - Scott Kirkland Same Markup: Writing Cross-Browser Code - Tony Ross Introducing Machine.Specifications.Mvc - James Broome ASP.NET 4 - Breaking Changes and Stuff to be Aware of - Scott Hanselman JSON Hijacking in ASP.NET MVC 2 - Matt Easy And Safe Model Binding In ASP.NET MVC - Justin Etheredge MVC Portable Areas Enhancement - Embedded Resource Controller - Steve Michelotti...(read more)

    Read the article

  • SSIS Catalog, Windows updates and deployment failures due to System.Core mismatch

    - by jamiet
    This is a heads-up for anyone doing development on SSIS. On my current project where we are implementing a SQL Server Integration Services (SSIS) 2012 solution we recently encountered a situation where we were unable to deploy any of our projects even though we had successfully deployed in the past. Any attempt to use the deployment wizard resulted in this error dialog: The text of the error (for all you search engine crawlers out there) was: A .NET Framework error occurred during execution of user-defined routine or aggregate "create_key_information": System.IO.FileLoadException: Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) System.IO.FileLoadException: System.IO.FileLoadException:     at Microsoft.SqlServer.IntegrationServices.Server.Security.CryptoGraphy.CreateSymmetricKey(String algorithm)    at Microsoft.SqlServer.IntegrationServices.Server.Security.CryptoGraphy.CreateKeyInformation(SqlString algorithmName, SqlBytes& key, SqlBytes& IV) . (Microsoft SQL Server, Error: 6522) After some investigation and a bit of back and forth with some very helpful members of the SSIS product team (hey Matt, Wee Hyong) it transpired that this was due to a .Net Framework fix that had been delivered via Windows Update. I took a look at the server update history and indeed there have been some recently applied .Net Framework updates: This fix had (in the words of Matt Masson) “somehow caused a mismatch on System.Core for SQLCLR” and, as you may know, SQLCLR is used heavily within the SSIS Catalog. The fix was pretty simple – restart SQL Server. This causes the assemblies to be upgraded automatically. If you are using Data Quality Services (DQS) you may have experienced similar problems which are documented at Upgrade SQLCLR Assemblies After .NET Framework Update. I am hoping the SSIS team will follow-up with a more thorough explanation on their blog soon. You DBAs out there may be questioning why Windows Update is set to automatically apply updates on our production servers. We’re checking that out with our hosting provider right now You have been warned! @Jamiet

    Read the article

  • Open World Day 1 Continued

    - by Antony Reynolds
    A Day in the Life of an Oracle OpenWorld Attendee Part II A couple of things I forgot to mention about yesterdays OpenWorld. First I attended a presentation on SOA Suite and Virtualization which explained how Oracle Virtual Assembly Builder (OVAB) can be used to accelerate the deployment of an Enterprise Deployment Guide (EDG) compliant SOA Suite infrastructure.  OVAB provides the ability to introspect a deployed software component such as WebLogic Server, SOA Suite or other components and extract the configuration and package it up for rapid deployment into an Oracle Virtual Machine.  OVAB allows multiple machines to be configured and connections made between the machines and outside resources such as databases.  That by itself is pretty cool and has been available for a while in OVAB.  What is new is that Oracle has done this for an EDG compliant installations and made it available as an OVAB assembly for customers to use, significantly accelerating the deployment of an EDG deployment.  A real help for customers standing up EDG environments, particularly in test, dev and QA environments. The other thing I forgot to mention was the most memorable demo I saw at OpenWorld.  This was done by my co-author Matt Wright who was showcasing the products of his company Rubicon Red.  They showed a really cool application called OneSpot which puts all the information about a single users business processes in one spot!  Apparently a customer suggested the name.  It allows business flows to be defined that map onto events.  As events occur the status of the business flow is updated to reflect the change.  The interface is strongly reminiscent of social media sites and provides a graphical view of business flows.  So how does this differ from BPEL and BPM process flows?  The OneSpot process flow is more like a BAM process flow, it is based on events arriving from multiple sources, and is focused on the clients view of the process, not the actual business process.  This is important because it allows an end user to get a view of where his current business flow is and what actions, if any, are required of him.  This by itself is great, but better still is that OneSpot has a real time updating view of events that have occurred (BAM style no need to refresh the browser).  This means that as new events occur the end user can see them and jump to the business flow or take other appropriate actions.  Under the covers OneSpot makes use of Oracle Human Workflow to provide a forms interface, but this is not the HWF GUI you know!  The HWF GUI screens are much prettier and have more of a social media feel about them due to their use of images and pulling in relevant related information.  If you are at OOW I strongly recommend you visit Matt or John at the Rubicon Red stand and ask, no demand a demo of OneSpot!

    Read the article

  • Getting Ramped for Silverlight 4

    - by GeekAgilistMercenary
    Here is a quick walk through of setting up your Silverlight 4 development environment.  The first assumed step is that you have Visual Studio 2010 already installed and any appropriate patches.  Then download the following in order and install each. Silverlight 4 Tools RC2 for Visual Studio and Silverlight 4 RTW Expression Blend 4 Release Candidate Silverlight Toolkit - Not necessary, but lots of good bits in this download. WCF RIA Services - This is also not necessary, but you should grab it just in case anyway. Once each of these are installed jump into Visual Studio 2010.  Start a new Silverlight 4 Project by going to File -> New -> Project -> and select the Silverlight Project Templates.  Here you'll see a new list of projects that are specific to the above listed downloads. Silverlight Business Application WCF RIA Service Class Library Silverlight Unit Test Application One way to confirm (and what I am going to display here in this entry) Silverlight 4 is installed ok is to select the Silverlight Application Template and start a new project. On the next screen you will see some of the standard options.  I always go with the ASP.NET MVC Option and with these new installations I am going to select Silverlight 4 (should be selected already) from the drop down and check the Enable WCF RIA Services check box. I also, for good measure, always create a unit test project for the ASP.NET MVC Project that will host the Silverlight Application Project.  When all is setup, the Solutions Explorer should look like what is shown below. Add the following code to the XAML of the MainPage.xaml of the Silverlight Project. <UserControl x:Class="Silverlight4.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">   <Grid x:Name="LayoutRoot" Background="White"> <TextBlock x:Name="textBlockTest" Text="Hello World!" /> </Grid> </UserControl> Now execute the project, if all runs well you have installed Silverlight 4 successfully. Bam!  Silverlight 4 ready to go!  I will have more on Silverlight 4 very soon, as I will be starting a project (personal) and blogging it as I work through it.  Also, if you run into any issues I would like to read about them, so please comment.  I had a few issues and also had some design time rendering issues in the VS 2010 IDE when I installed these bits at first. Check out the original entry here.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >